While experimenting with mod_python, I ended up completely hosing my local Apache installed. I had the configuration files in a bad state, so I thought I would just drop all of /etc/apache2, remove Apache, and re-install it. But once that happened, /etc/apache2 wasn’t remade! When I tried to start or stop Apache, it spat back:

1
.: 44: Can’t open /etc/apache2/envvars

Oh right, thanks… So here’s what I did to erase Apache’s memory of my mistakes:

  • Find and drop all Apache packages:
    1
    2
    sudo dpkg –get-selections | grep apache
    sudo apt-get remove –purge apache2 apache2-mpm-worker apache2-threaded-dev apache2-utils apache2.2-common libapache2-mod-python libapache2-mod-python-doc libapache2-mod-wsgi
  • Re-install Apache:
    1
    sudo apt-get install apache2 libapache2-mod-python libapache2-mod-wsgi libapache2-mod-python-doc libapache2-mod-php5

After this, all the configuration files were back, and I had a default Apache install.

Thanks to author http://www.samuelhuckins.com/

If you enjoyed this post, make sure you subscribe to my RSS feed!

  One Response to “How to completely reset an Apache instance in Ubuntu”

  1. I’m glad that after surfing the web for uch a long time I have found out this information. I’m really lucky.

    [Reply]

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2011 JCA - Tech Blog Suffusion theme by Sayontan Sinha