I posted this question here but was told I might get better results on superuser. So here goes:

I mistakingly deleted the /etc/apache2 folder and screwed up apache. I want to re-install the stock Apache to put this directory back, is there a way to do this from the Snow Leopard install disc?

If not, how can I do this? All links I'm finding don't explain how to install it. The only alternative I found is to use macports, so that is my worst case, but I'd like to fix my install. I'd actually prefer to re-install the operating system than use macports to avoid the problem.

Someone directed me to this link, but it didn't put the folder /etc/apache2 back, so I'm still getting the same errors when I try to start apache. I want to restore or replace the stock version.


NOTE: This is definitely not best practice, and it didn't completely solve my problem.

What I ended up doing is copying the directory /etc/apache2 and its contents from someone else's mac. I had to rename one file /etc/apache2/users/home-name.conf and edit its contents to account for that change. Now, when running any sudo apachectl command such as sudo apachectl -k restart, i am getting this error:

/usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument

Any ideas?

  • Too bad someone told you to ask the question here again. In the future, please don't: questions will be moved automatically is applicable. No need to post the same thing twice. (But: many thanks for linking to that other question!)
    – Arjan
    Nov 12, 2010 at 20:37
  • I deleted the original post on stackoverflow as it was answered here.
    – GiH
    Nov 14, 2010 at 17:29

1 Answer 1


Go onto your install CD. There should be an Apache installer. If there isn't on your copy for whatever reason, just Archive and Install, saying "restore my settings and files". Then, you have a fresh copy of all the system resources like Apache, but don't have to worry about losing anything.

  • wow... proofread your posts... LAWL
    – David
    Nov 12, 2010 at 21:00
  • Sorry. I must have hit undo by mistake before I hit submit. Nov 12, 2010 at 21:02
  • 2
    Archive and Install sounds smart to me! But, @GiH, as apparently you're not using Time Machine yet: this might be a good moment to start using that? Before doing the Archive and Install, that is...
    – Arjan
    Nov 12, 2010 at 21:08
  • Good point. You want to make a backup of some kind before you start messing with your system install. Nov 12, 2010 at 21:10
  • thanks, ill take a look at that. You have any idea where the installer would be? On the DVD there is the OS installer, and an optional install folder. Is it in the OS installer? There is only Optional installs.mpkg and xcode.mpkg in the optional installs folder
    – GiH
    Nov 12, 2010 at 22:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.