tail -f findings.out

« Going to PyCon 2009!

vim for Bash scripting: A happier union »

How to completely reset an Apache instance in Ubuntu

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

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

Share and Enjoy:
  • email
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • Technorati
  • Netvibes

Post to Twitter Post to Delicious Post to Digg Post to Reddit

Possibly Related (no promises):

  1. Quick tips for NVIDIA and ATI graphics configuration repairs on Ubuntu
  2. Using a Juniper SSL VPN on Ubuntu
  3. 64-bit Ubuntu: Not a problem
  4. Useful grep incantations
  5. Permanently remember password for gksudo

Related posts brought to you by Yet Another Related Posts Plugin.

Tags: , ,
February 22, 2009 - 2:02 AM
23 comments »
  1. Moos
Leave a reply

Subscribe without commenting

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.