Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Setting web Default port to HTTP (80) instead of HTTPS(443)

I'm currently setting up a server which won't have virtual sites and therefor has its web content in "Default". This of course means, as the Default has HTTPS set up, and OSX server will try to use HTTPS if defined for any sites, that connecting to the website forces the client to connect to HTTPS.


How can I alter or override this?

Mac mini, OS X Server, null

Posted on Jan 20, 2015 7:36 PM

Reply
7 replies

Jan 21, 2015 1:15 AM in response to conn3ct

Hey Conn3ct


If using Server 4.0.3 there is a redirect from port 80 to 443 by default. Within the Server app GUI select Websites select Server Website or the Default website and press the edit pencil you'll notice theres a redirects section with 1 redirect configured. Press edit and remove the redirect.


Apache should now serve the site on 80


Although I don't have previous versions of Server to hand i'm pretty sure this was present in them as well (maybe not be default though)


Hope it helps.


Dan

Jan 21, 2015 3:21 AM in response to Dan@CN

HI Dan - thanks for your reply.


I'm using server 4.3 and I've already removed the redirect from the Default HTTP profile - but http requests are still being redirected to https. So this is configured somewhere and my instinct says either a virtual host config file or somewhere in apache.config.


I'm wondering if the original setting (redirecting http to https) has created a virtual host file somewhere which hasn't been removed or if it's hardcoded into the apache config that any host with HTTPS set up will automagically redirect http to https. If it is hard coded what am I likely to break by changing it?

Jan 21, 2015 3:41 AM in response to conn3ct

Ok so If everything is at its defaults, i'm assuming you haven't delved into the conf before, the .conf for the default website is at: /Library/Server/Web/Config/apache2/sites/0000_any_80_.conf


You would need to remove these lines found after </Directory>:


RewriteEngine On

RewriteCond %{HTTP_HOST} !(^localhost|^127.0.0.1|^::1)

RewriteCond %{REQUEST_URI} !^/netboot/ [NC]

RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R]


That will only affect the default website and shouldn't effect anything else on the server.


I use terminal and then nano to edit this file but thats personal preference.


Dan

Jan 21, 2015 9:18 AM in response to conn3ct

Just checked

/Library/Server/Web/Config/apache2/sites/0000_any_80_.conf

and there was no redirect for HTTPS. Accessing the webserver from my current location - it behaves as expected i.e. http is http.


I was checking the web server yesterday from the internal LAN connected to the same router that the server also uplinks through, though it's on a different wired sub net.

Jan 22, 2015 5:45 AM in response to conn3ct

It sounds like something else on the network maybe causing http traffic to redirect.


I was checking the web server yesterday from the internal LAN connected to the same router that the server also uplinks through, though it's on a different wired sub net.


From the Internal LAN I would first check to see if there are any rules configured on the device responsible for the separate subnet to redirect http traffic. Then if this is all clear, check to see if there any other devices switches / firewalls etc that the traffic may be routing through. Traceroute may help to see what devices the traffic is hopping through.


Other than that i'm out of ideas.


Dan

Setting web Default port to HTTP (80) instead of HTTPS(443)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.