Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I accidentally, on a Ubuntu Server, deleted /etc/apache2. I hadn't altered any config in there, so I have not lost anything as long as I can regenerate it... I tried apt-get removeing and installing apache2, but it just says it's missing some files in /etc/apache2 when I try to start it. How can I regenerate it?

Thanks in advance!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Most everything in there should be in the apache2.2-common package. This'll force the re-installation of those config files:

dpkg --force-confmiss -i /var/cache/apt/archives/apache2.2-common*.deb

Start with that, and see if anything's still missing.

share|improve this answer
    
Apache doesn't like the new config: # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <Files ~ "^\.ht"> Order allow,deny <-- This line Deny from all Satisfy all </Files> is problematic: $ sudo service apache2 restart Syntax error on line 160 of /etc/apache2/apache2.conf: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration Action 'configtest' failed. The Apache error log may have more information. ...fail! –  JJ56 May 21 '12 at 0:28
    
PS: Sorry it's all so messy. The <-- This Line isn't actually in the config, I'm just showing 160. –  JJ56 May 21 '12 at 0:30
    
Is it a problem that mods-enabled is empty? –  JJ56 May 21 '12 at 0:31
    
I see on another Ubuntu server I have that all these mods are enabled: dl.dropbox.com/u/40837996/Screenshots/18vx.png Do I need to go through and enable all those by hand? –  JJ56 May 21 '12 at 0:32
    
@JJ56 Those symlinks apparently aren't included files - the default module set is probably enabled by one of the installation scripts. So, yes, you probably need to re-enable those. –  Shane Madden May 21 '12 at 0:39

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.