OS X Server port 16080 problem fix

Dec 18, '01 05:56:23PM

Contributed by: sysop

There is a problem with the default settings for the webserver on Mac OS/X 10.x Server where if you change the server to another IP or name, all kinds of redirects point to a :16080 port. This happened to me on a machine with a single IP address. When I gave the server a new address and reconfigured my services, all requests for a /~user site resulted in a :16080/~user being returned to the web-browser.

Of course, a lot of firewalls are not set up to handle those ports, so fixing the server is a better way of solving this problem. Read the rest of the article for instructions on how to do just that...

[Editor's note: I don't run OS X Server, so I can't vouch for either the bug or the fix, but it makes sense on a quick read-through.]

The answer lies in the /private/etc/httpd/httpd_macosxserver.conf file.

Make a copy of that file and edit the copy!

Search for a part which looks like this:

##
## Used by Mac OS X Server Admin only (mandatory section).
## "Preferences" site that gives default values Server Admin clients
## might want to use when creating new sites. This site must always
## be disabled and clients should never delete it. Server Admin will
## also use this site to create the first default site at
## post-install time.
##

#<RAdmin 99>
#NameVirtualHost 10.0.0.2:80
#Listen 10.0.0.2:80
#<VirtualHost 10.0.0.2:80>
#ServerName foo.bar.com
#WebPerfCacheEnable On
#SiteAutomaticallyDisabled Off
#ServerAdmin sysop@bar.com
#DocumentRoot "/Shared Items/www"
#DirectoryIndex index.html
#CustomLog "/private/var/log/httpd/access_log" "%h %l %u %t "%r" %>s %b"
#ErrorLog "/private/var/log/httpd/error_log"
#<IfModule mod_ssl.c>
#SSLEngine Off
#SSLLog "/private/var/log/httpd/ssl_engine_log"
#SSLCertificateChainFile "/private/etc/httpd/ssl.crt/ca.crt"
#SSLCertificateFile "/private/etc/httpd/ssl.crt/server.crt"
#SSLCertificateKeyFile "/private/etc/httpd/ssl.key/server.key"
#SSLCipherSuite "RSA:-HIGH:-MEDIUM:-LOW:+EXP"
#SSLPassPhrase foo.bar.com:80 ""
#</IfModule>
#<IfModule mod_dav.c>
#DAVLockDB "/private/var/run/davlocks/.davlock"
#DAVMinTimeout 600
#</IfModule>
#<Directory "/Shared Items/www">
#Options All +MultiViews -ExecCGI -Indexes
#AllowOverride All
#<IfModule mod_dav.c>
#DAV Off
#</IfModule>
#</Directory>
#</VirtualHost>
#</RAdmin>

You will notice that every line starts with a # and that the IP address mentioned above will not match the one you use at the moment. This will probably be the IP address you used when setting up the server for the first time.

Change the IP and names to the one the server should be using right now. Leave all the #'s in place!

Now to fix the wrong setups of your current sites:

Down the file you will see the same stanzas as above with some things slightly different. There is a stanza for each of your sites. Change every instance of :16080 to :80 you find in these stanzas. Check for wrong site URLs as well.

Save the file and restart your server. Check the functionality of all your sites and keep the backup httpd_macosxserver.conf file for at least a month. You never know...

And by the way: you can automatically add extra default page-names to the template above. I use

#DirectoryIndex index.html index.htm default.html default.htm

to serve any known index-page.

Good luck!

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20011218175623108