Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Working with Apache config files on 10.3 Server OS X Server
I found several hints that mentioned how to modify apache using /etc/httpd/httpd.conf or /etc/httpd/users/user_name.conf, but no mention of how to make changes to Mac OS X Server.

System wide changes can be made in Server Admin or in the httpd.conf file (Apple has even added extra comments relevant to Panther Server telling you what you should and shouldn't touch). However, I quickly found that the information for my site couldn't be found in httpd.conf.

It turns out 10.3 Server has a "sites" folder in /etc/httpd, much like the "users" folder on 10.3 Client, and that every site on your server (even if you only have one) is set up as a virtual host. Within the sites folder will be at least one (probably two or more) .conf files: virtual_host_global.conf, plus a conf file for each site you have set up (named using a serial number plus the port and host name of your site).

As hinted at above, the site's .conf file is simply a <VirtualHost> section that gets included with the main httpd.conf file (the last line of my httpd.conf is Include "/etc/httpd/sites/*.conf"). As such, the contents will be familiar to you if you've used httpd.conf and VirtualHost before (and if you haven't, there are many helpful sites on the web about Apache).

For example, I needed to use ProxyPass to make a non-Apache webserver (zope) running on port 9080 appear to be running at port 80. I created a new site in Server Admin, left all the settings as default, and enabled the site. I then put the following in the conf file it created:
## Default Virtual Host Configuration

<VirtualHost *:16080>
 ServerName intranet.example.com
 ServerAdmin webmaster@example.com
 ProxyPass / http://intranet.example.com:9080/
 ProxyPassReverse / http://intranet.example.com:9080/
</VirtualHost>
Observant readers will notice that according to the VirtualHost directives, this site is running at port 16080 rather than port 80 (or whichever port you chose originally). In actual fact, it's available at both. It runs at port 16080, but Mac OS X Server automatically aliases it to port 80 (or whichever port you chose originally).

It's not an amazing discovery but hopefully this will help someone else.

Please note: Because of the drastic changes I made to the ".conf" file, my Server Admin is no longer able to make changes to ANY sites, including enabling or disabling them, or changing the port. Replacing the modified file with the original resolves this issue. If this is an issue for you, I suggest you confine yourself to less drastic changes (e.g. changing AllowOverride None to AllowOverride AuthConfig) or modify the existing ".conf" file without removing any of the directives Server Admin expects to find.
    •    
  • Currently 2.38 / 5
  You rated: 1 / 5 (8 votes cast)
 
[15,219 views]  

Working with Apache config files on 10.3 Server | 1 comments | Create New Account
Click here to return to the 'Working with Apache config files on 10.3 Server' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Working with Apache config files on 10.3 Server
Authored by: eddyer on Sep 27, '04 03:42:54PM

*How about enabling secure traffic? Would that simply be another proxypass entry?

---
keep on keepin on



[ Reply to This | # ]