Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.


UPDATE:

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?

share|improve this question
    
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 '10 at 20:37
    
I deleted the original post on stackoverflow as it was answered here. –  GiH Nov 14 '10 at 17:29
add comment

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
wow... proofread your posts... LAWL –  David Nov 12 '10 at 21:00
    
Sorry. I must have hit undo by mistake before I hit submit. –  Nathan Lawrence Nov 12 '10 at 21:02
    
Thank you for fixing it. Now I will +1 you. –  David Nov 12 '10 at 21:05
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 '10 at 21:08
    
Good point. You want to make a backup of some kind before you start messing with your system install. –  Nathan Lawrence Nov 12 '10 at 21:10
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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