The httpd.conf file controlled by the Server.app is stored at
If you happen to update PHP or other Apache modules through non-Apple methods (e.g. homebrew), then this is where you add your LoadModule and FilesMatch arguments.
You MUST restart the web server through the Server.app for changes to load. apachectl graceful will not load the changes in httpd_server_app.conf.
#This article is in response to “Update PHP on OS X Server 5.x”.
Apache for Mac OS X:: Do I need to setup another host for www?
Surfing the web and watching TV has made you think the “www” in front of a web address is a given. True, most sites do not require you to type “www”. The truth is “http://www.example.com” and “http://example.com” are two different URLs hosted by two different hosts. Most server admins set it so that “example.com” is forwarded to “www.example.com” making “www” the default server.
If you set up everything using the ServerAdmin GUI, creating two hosts “www.example.com” and “example.com” pointing to the same web directory is easy. But it becomes a pain afterwards when you need to tweak settings – you have to do the same thing twice. Also, ServerAdmin writes so much crap to the config files, having redundant info makes server reloads slow. The solution is to use some finesse with your httpd config files.This post will tell you a little more about httpd.conf for Mac OS X.
So, in one of your conf files, you need to add just four lines:
Redirect / http://www.example.com
Apache for Mac OS X:: httpd.conf for Mac OS X Server 10.x
Mac OS X Server 10.x uses the GUI control panel interface called ServerAdmin to administer services. It’s something like apache.conf, linux.conf, bind.conf, and other services put into one place.
When you use ServerAdmin to setup your web server, it writes to a file called httpd_macosxserver.conf. This is a seperate file from the usual httpd.conf and is called by httpd.conf by use of the Include directive.
httpd_macosxserver.conf overrides almost every directive set in httpd.conf, and has some other Mac OS X tweaks not included in the original httpd.conf.
httpd_macosxserver.conf warns in its comments area that you should not edit anything by hand – everytime you use the ServerAdmin GUI, it will be overwritten and lost. So, what do you do if the GUI doesn’t give you enough power and you NEED to edit the conf files by hand?
Why, you just put another Include directive in httpd.conf.
Because httpd.conf is not overwritten by ServerAdmin, you do not have to worry about losing the Include directive, and you will be editing your own conf files safely tucked away somewhere else under your username so that future updates to Apache will not overwrite them.
Apache 2 for Redhat Linux:: ServerAlias does not resolve to correct URLs
ServerAlias is a new directive incorporated in Apache 2 that allows a virtual host to answer to URL queries under many names.
The good thing about it is that you do not need another VirtualHost container to forward different URLs to one site. The downer is that unlike the Redirect directive, ServerAlias does not resolve the URL field of HTTP 1.1 browsers to the canonical name nor the main virtual host name. So if you use CGIs, SSIs, or any kind of scripting that refers to an relative path, you might want to stay away from using the ServerAlias directive.
Apache 2 for Redhat Linux:: Displaying Japanese correctly
After upgrading kukai from RH 7.1 to RH 8, all Japanese websites hosted on kukai showed problems when displaying Japanese characters. In short, I got “moji-bake”.
Apache2 has new directives for languages and encodings. One of which is DefaultEncoding. This is set to iso-8155-1 as the default, for English and Latin characters. You'd think changing this to Shift-JIS or EUC_JP would fix the problem, but it won't and it didn't.
What you do is turn it off completely, just comment out the line in the httpd.conf file.
This problem has been fixed in Apache 2.0.4