https://IP-number not forwarding as http://IP-number

Hi

Please could I ask if anyone knows how to set the default webpage for a user accessing via an IP for HTTPS.

i.e https://956.956.956.956

Please note the above IP is not a real IP.

The HTTP works lovely for forwarding to a designated webpage, as defined in nodeworx, server, ip, deafult.

I hope I have explained correctly my question

Many thanks

John

Are you talking like accessing the server directly via IP instead of a domain? You can set a redirect with the Default Sites feature in NodeWorx under Server>IP Management>Default Sites

Hi Dan

Many thanks for responding, Yes, that is what I was trying to let you know.

Accessing server via an IP in http:// works lovely and redirects as it should to a defaulted website, but there is no setting for https:// to redirect to a default website.

To see what I mean, http://84.234.26.239 and https://84.234.26.239

What I thought would happen for that setting would be to redirect both http:// and https:// but it does not.

Any advice would be appreciated

Many thanks

John

Hi John,

I see what you’re saying now - we definitely forgot to make it so the redirect happens on both HTTP and HTTPS. You can manually edit your webserver’s configuration to add a redirect. I’m also opening a bug report so this can be configured automatically from the panel in the future.

To do this manually you might:
[LIST=1]

  • Set the redirects that you would like to occur on each IP you have on your server using the Default Sites feature.
  • Copy /etc/httpd/conf.d/namevirtualhost.conf to /etc/httpd/conf.d/namevirtualhost2.conf
  • Open /etc/httpd/conf.d/namevirtualhost2.conf and edit each line that says NameVirtualHost <ip>:80 to say NameVirtualHost <ip>:443
  • Copy /etc/httpd/conf.d/vhost_000_defaults.conf to /etc/httpd/conf.d/vhost_000_defaults2.conf
  • Open /etc/httpd/conf.d/vhost_000_defaults2.conf and edit each line that says <VirtualHost <ip>:80> with <VirtualHost <ip>:443>
  • Check to make sure that you configuration is OK and will not break the server by running httpd -t
  • If the result prints out Syntax OK (it might complain about certain IP's not having any virtualhosts, but the important part is that it prints out somewhere in the output Syntax OK), then you're good to go.
  • Restart the webserver with service httpd restart if it's all OK. OR If you have syntax errors, you can just delete the 2 files you copied and edited and the configuration should just go back to how it was. [/LIST] Just keep in mind that you will probably want to repeat the process if you add/change IP's or want to change the redirects.
  • Hi Dan

    Sorry for the late reply, and I have completed your instructions, but it does not work for me.

    Our monitoring systems triggered on the https changes to show them as down, but this is most likely because of the redirects, so not too worried about this.

    To show you what I mean, I have left the https://84.234.26.240 implemented as this is a test site for our control panel at the moment, and has a SSL implemented on it for havehosts.co.uk. The https://84.234.26.239 works as before, as I have removed the redirects from the secondary files.

    My 2 files show as follows:

    namevirtualhost2.conf

    NameVirtualHost 84.234.26.240:443

    vhost_000_defaults2.conf

    <VirtualHost 84.234.26.240:443>
    ServerName 84.234.26.240
    DocumentRoot /var/www/html
    RewriteEngine On
    RewriteOptions inherit
    RewriteRule (.+) http://www.havehosts.co.uk/billing$1 [R=301,L]
    </VirtualHost>

    and both were uploaded into /etc/httpd/conf.d

    I completed a test by httpd -t, which should no errors, and have restarted the httpd service.

    Any advice would be welcome, but thinking about it, it may not be an issue to us, and may be better left as before… the only 1 thing which may be beneficial to us, would be a redirect on port <ip>:2443 to goto our main log in area, so that it picks up on our SSL.

    Hope this makes sense and many thanks for your help

    John