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!


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.

  • 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! – JJJollyjim 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. – JJJollyjim May 21 '12 at 0:30
  • Is it a problem that mods-enabled is empty? – JJJollyjim 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? – JJJollyjim 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

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.