Completely Re-install Apache2 on Ubuntu


Find and drop all Apache packages:

1
2
3
4
5
6
7
8
9
10
APACHE_PKGS=`sudo dpkg --get-selections | grep apache | cut -f 1`
# Make sure things are sane:
echo $APACHE_PKGS
# Example output: apache2 apache2-mpm-prefork apache2-utils apache2.2-common \
# libapache2-mod-php5 libapache2-mod-python libapache2-svn
# Likely if you have a Python application:
# libapache2-mod-python libapache2-mod-python-doc libapache2-mod-wsgi
# Or if you roll with the PHP: 
# libapache2-mod-php5
sudo apt-get remove --purge $APACHE_PKGS

Re-install Apache

1
2
3
# You might want to consider not re-installing the whole list;
# instead dump it out, audit, and install what you need:
sudo apt-get install $APACHE_PKGS
After this, all the configuration files were back, and I had a default Apache install.

Comments

Popular posts from this blog

Scan FC LUN's in RHEL/CentOS

CEPH bluestore using ceph-ansible

How to enable federated engine in MySQL