Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was setting an apache instance up. And accidentally, I did rm -rf /etc/apache2. Now I don't have any configurations.


I sudo apt-get install apache2 --reinstall, but didn't' work :(

How can I make the directory again?

I'm using Ubuntu 10.04 LTS server.

share|improve this question
up vote 8 down vote accepted

I got the answer.

sudo apt-get remove --purge apache2 apache2-utils
sudo apt-get install --reinstall  apache2 apache2-utils
share|improve this answer
Good job answering your own question. You should click the tick below the voting buttons to accept it. :) – Mochan Jan 15 '13 at 8:19

I needed:

sudo apt-get remove --purge apache2 apache2-utils apache2.2-common 

and then had to also reinstall php5:

sudo apt-get install --reinstall apache2-utils apache2 libapache2-mod-php5

Just had to think about the other things I had installed.

(Ubuntu 12.10)

share|improve this answer

Your Answer


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.