Smart modification of httpd.conf for easier updating
Jul 07, '03 08:37:00AM
Contributed by: TvE
Are you tired of reconfigering Apache after Apple has updated it and installed a new httpd.conf configuration file? It could be that you have enabled PHP and SSI and don't want to edit those four or five lines again. If this is the case, then you could just insert a link to your own configuration file from /etc -> httpd -> httpd.conf. I have done so - here's my example:
- Insert one line at the bottem of /etc -> httpd -> httpd.conf. The line to be inserted is this:
Include /private/etc/httpd/httpd.conf.TvE
- Create the file /private -> etc -> httpd -> httpd.conf.TvE ... replace the .TvE with your own initials (or whatever). In my case, this file contains these lines:
LoadModule php4_module libexec/httpd/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php
AddType text/html .shtml
AddHandler server-parsed .shtml
DirectoryIndex index.html index.shtml index.shtm index.htm index.php
- Restart Apache in the Terminal (or Personal Web Sharing in the GUI).
The next time Apple updates Apache and your httpd.conf has been brought back to default, you only have to insert the one line mentioned in the first step (and restart Apache) to be back in business again. It's very elemental but could save you a lot af hassle after an update
[robg adds: The method I use is to just run File Merge on the new and old httpd.conf file (Apple's installer seems to always create httpd.conf.applesaved when it updates the httpd file). However, this method would save some time, and insure that I always captured Apple's changes instead of relying on my proper reading of a diff file.]
Comments (10)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20030628122935391