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

I have removed the folder /etc/apache2 to reset its configuration, but when I reinstall Apache2 it is not coming back. Could anybody please explain this to me?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

apache2.2-common packages contain config. Reinstall apache2.2-common:

sudo apt-get --reinstall install apache2.2-common

or use autoremove(remove satisfy dependencies):

sudo apt-get remove apache2
sudo apt-get autoremove
sudo apt-get install apache2
share|improve this answer
Thanks, worked like a charm! –  Z0q Mar 1 '11 at 9:29
This restores conf files, but you're still missing mods and default sites. Running 'apt-get --reinstall install apache2.2-common -o DPkg::options::="--force-confmiss"' seems to restore those. –  Ringo Jun 3 '14 at 17:51

Try doing

apt-get --reinstall install apache2.2-common -o DPkg::options::="--force-confmiss"

This will reinstall all configuration files from apache2.2-common that are missing.

Just reinstalling the package will not reinstall the configuration files.

share|improve this answer

Your Answer


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