[Closed] Unwanted redirecting to https with hostname but not with IP address

#1
EDIT: OK, it's sorted, so you can ignore this whole thread! If an admin wants to delete it that's fine.


I have completed a fresh installation of OpenLiteSpeed with various PHP versions on CentOS 7 on physical hardware. This is set up the same as an existing installation also on CentOS 7 in Hyper-V.

With the old server I can access it from a browser as http://192.198.0.100/ or http://oldhostname/ and both work fine. The same applies with :7080 to access WebAdmin.

However with the old server http://192.198.0.101/ works fine, however http://newhostname/ redirects to https://newhostname/ which the browser cannot access. The same applies with :7080 to access WebAdmin.

The only thing in my web root currently is a PHP file running phpinfo(). Hostnames are set up in the hosts file on the PC, and IP addresses are assigned to MAC addresses in the router.

I do not want or need https access. They are local development systems running just on my network, so it is not worth messing around with self-signed SSLs or whatever. I just want the new one to work at http://newhostname/ without trying to redirect to https.

Both servers are set up the same as far as I can tell. They were set up from the same notes, and I have compared all settings in WebAdmin and cannot find any differences. I have restarted the server, cleared browser caches and tried private browsing mode etc.

There must be a difference somewhere that I have missed, and I welcome any suggestions for things to try.

A few possibly relevant settings:

Listeners - there is only 1 listener:
Name "Default", IP Address "Any IPv4", Port "80", Binding "Not Set", Enable REUSEPORT "Not Set", Secure "No".
SSL tab is all "Not Set".
Modules has none listed

WebAdmin Settings - Listeners - there is only 1 listener
IP Address "Any IPv4", Port "7080", Secure "No".
SSL does have the default private key file and certificate file set, and everything else is not set.

Is there any way of exporting settings from both systems as some sort of text or JSON file so I can compare them?

Thank you for any thoughts or suggestions for how I can resolve this.
 
Last edited:
#2
I have now downloaded and compares the httpd_config.conf files from both servers.

The only differences are the serverName (expected), the memory limits for CGIRLimit (higher on the new one) and the memory limits for railsDefaults, wsgiDefaults and nodeDefaults (all 2047M on the old server and 0 on the new server).

So maybe it is something at the CentOS server level rather than OpenLiteSpeed level? Seems unlikely though as OpenLiteSpeed is serving the pages.

I'm even more confused now!
 
#3
OK, it's sorted - so you can ignore this whole thread!

I had set the hostname to "dev" because it's a web dev server and I tend to use short names on my local network. However it seems that browsers look for .dev extensions and redirect them automatically to https. Even though "dev" != ".dev" it's obviously close enough. Now renamed to "webdev" and all is working well.
 
Top