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

Restoring the Apache config file after 10.2.4 update System
Just a quick note for those with custom apache setups. Installing the 10.2.4 update will replace your /etc/httpd/httpd.conf file with a default Apple standard which will disable any custom modifications you've made (eg. PHP won't be enabled, custom aliases won't function, et cetera). Your old file is copied/renamed to httpd.conf.applesaved.

To revert back to your apache setup, simply copy/move this file to its original name "httpd.conf." You could back up the apple created file but it's not necessary.

[robg adds: This was mentioned in the comments to this hint, but I thought it was worth mentioning on its own. I would disagree, however, that it's not worth keeping the Apple file. The Apple httdp.conf file installs the new mod_rendezvous module, which you may very well wish to keep. I just used this week's Pick of the Week, FileMerge, to compare the two httpd files and eliminate the differences.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[8,900 views]  

Restoring the Apache config file after 10.2.4 update | 14 comments | Create New Account
Click here to return to the 'Restoring the Apache config file after 10.2.4 update' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Why RESTORE at all? Stop editing it!
Authored by: ScooterComputer on Feb 19, '03 11:22:26AM

Once again, I'll submit this as a workaround to all of these httpd.conf issues:

Why is anyone modifying httpd.conf to begin with? Having examined the httpd.conf file that Apple installs, I can't find anything that can't relatively easily be overridden through the use of an override file placed in the /private/etc/httpd/users directory. Apple, thankfully, placed an Include statement as the last line of the httpd.conf file that loads all files in the ./users directory; simply create a new file full of any overrides (or multiple files, for better organization) called 1stoverrides.conf in that directory.

This works, as Apache's config loading algorithm uses the LAST statement found, so any override statement will OVERRIDE what is entered into httpd.conf.



[ Reply to This | # ]
Use BBEdit to find the differences!
Authored by: projazz on Feb 19, '03 02:52:01PM

Longtime users of BBEdit already know of the "Find Differences..." (between files) under the Search menu item. (I have not tried Filemerge). Worked well for me. YMMV

---
Thanks,
Projazz



[ Reply to This | # ]
Before there was BBEdit, there was diff
Authored by: XSage on Feb 23, '03 09:57:51AM
The command /usr/bin/diff is the classic unix command line program for finding differences. One could use BBEdit, but for those without it everyone has diff.

For more about it, check out:
man diff

...at the terminal.

[ Reply to This | # ]

Why RESTORE at all? Stop editing it!
Authored by: mithras on Feb 19, '03 04:35:00PM

Your advice is sound, but I don't think it applies to the loading/adding of Apache modules. Very often the loading is order dependent, so a directive placed in an later included file is not likely to work well.

Moreover, if you want to DISable a module that is loaded, I don't think you can do so, except by modifying the original httpd.conf (or using the apxs tool to do so).

---
--
<a href="http://mithras.homeunix.net/downloads">my free OS X applications and scripts</a>



[ Reply to This | # ]
Why RESTORE at all? Stop editing it!
Authored by: ScooterComputer on Feb 19, '03 11:39:30PM
I am currently loading and adding modules in my 1stoverrides.conf file (dav and ssl) with no problems. Yes, you can't UNLOAD a module, but by using ClearModuleList you might be able to rejigger your AddModule execution in an overrides file...try it and see. Plus, most current modules aren't as susceptible to ordering problems as old ones were.

My intention for recommending the 1stoverrides.conf file and not editing the httpd.conf comes from the fact that MOST of the complaints I have seen regarding OS X updates stomping on httpd.conf files are coming from ppl who aren't doing rocket science in the httpd.conf...and in their very general cases (where they probably aren't doing brain surgery with LoadModule/AddModule) then my Hint stands.

For those who ARE doing proper brain surgery in there, you a) know FOR A FACT (because you've tried it) that an Include override won't work, and b) don't go installing updates willy-nilly without backing up your configs and rechecking them after completing the update.

[ Reply to This | # ]

Restoring the Apache config file after 10.2.4 update
Authored by: mervTormel on Feb 19, '03 12:42:17PM

of course, rob is right, you _need_ to know the differences before blasting away at the new config file. and scooter is right on about leaving the dang thing alone and using the overrides conf file.



[ Reply to This | # ]
Restoring the Apache config file after 10.2.4 update
Authored by: usa35 on Feb 19, '03 02:11:40PM

Sorry, but you guys really need to think before you speak.

Some of us actually have a strong NEED or DESIRE to modify the original file. The biggest reason for me is some code that I've developed practically requiring me to not be using my user directory (e.g. ".../~[user]/...") in the URL when testing on localhost.

Sure, there may be (actually, there are) some ways I can code around this, but it is by far less of a hassle to modify httpd.conf and deal with the occassional Apple update mangling, than to allowing user dirs and making user-specific modifications... And since I'm on a laptop that only I use, I will likely never need to allow site access for other user dirs.

FileMerge is the best way to update the new file with modification from your old one.



[ Reply to This | # ]
Restoring the Apache config file after 10.2.4 update
Authored by: Stefus on Feb 19, '03 03:04:35PM

To clarify: You can put ANY httpd.conf-option in *.conf-files within /private/etc/httpd/users regardless of the /~user/-function.



[ Reply to This | # ]
Restoring the Apache config file after 10.2.4 update
Authored by: ScooterComputer on Feb 19, '03 11:49:26PM
Speaking of thinking before speaking...

Directives included in the /private/httpd/users/*.conf files have no particular bearing on ~user homes. The files placed there by the system (through account creation in the Users PrefPane) DO HAPPEN to house the Directory directives for the users, but that is not CAUSE, that is EFFECT. I am using several VirtualHosts.conf files in there as well that point all over my drive (the Shared folder as well as a VirtualHosts folder), including setting up an SSL-protected WebDAV share point.

[ Reply to This | # ]

Add this to /etc/httpd/users/php.conf
Authored by: shmert on Feb 21, '03 12:33:08PM
An example might help, this is the file I use to enable PHP. Didn't have to change a thing after updating to the newest OS X.
LoadModule php4_module        libexec/httpd/libphp4.so
AddModule mod_php4.c


    DirectoryIndex index.html index.php index.php3



    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps



[ Reply to This | # ]
Add this to /etc/httpd/users/php.conf
Authored by: shucks on Feb 22, '03 08:43:59PM

I am wondering whether if you have a user named php then this will break?

---
He Travels Far Who Travels Alone, If He Knows The Way That Is



[ Reply to This | # ]
Add this to /etc/httpd/users/php.conf
Authored by: ScooterComputer on Feb 24, '03 11:51:36AM

No, not unless you create a file named php.conf in the /etc/httpd/users folder, and then create the PHP user using the Users PrefPane. I have never tried doing this, so I don't know what happens...that's why it would be smart to use a filename that is pretty unique (like 1stoverrides.conf).

Otherwise, the only thing these "user" configs do is make a Directory directive pointing to users' Sites folder...simply take a look at them.



[ Reply to This | # ]
Restoring the Apache config file after 10.2.4 update
Authored by: LouieNet on Mar 13, '03 03:17:22AM
Arg. I finally got around to updating to OS X Server 10.2.4. Under what circumstance would my httpd.conf file not get replaced? Nothing shows up when I grep for "rendezvous". :(
-rw-r--r--    1 root     wheel       54732 Dec 22 11:04 /private/etc/httpd/httpd.conf

---
G4 cube, 1152M RAM, OS X Server 10.2.4

[ Reply to This | # ]

Restoring the Apache config file after 10.2.4 update
Authored by: greenmoss on Jan 05, '04 09:32:27AM
There are good reasons to be modifying the httpd.conf file instead of using local configurations as has been suggested by others in this thread. See the apache notes on .htaccess files and when not to use them here.

Specifically:
There are two main reasons to avoid the use of .htaccess files.

The first of these is performance. When AllowOverride is set to allow the use of .htaccess files, Apache will look in every directory for .htaccess files. Thus, permitting .htaccess files causes a performance hit, whether or not you actually even use them! Also, the .htaccess file is loaded every time a document is requested.

Further note that Apache must look for .htaccess files in all higher-level directories, in order to have a full complement of directives that it must apply. (See section on how directives are applied.) (...) And so, for each file access out of that directory, there are 4 additional file-system accesses, even if none of those files are present.


So for small sites where performance is not critical, modifying a local config would be fine. For large, performance-tuned sites this would not be a good idea.

[ Reply to This | # ]