Apache

Reinstalling apache2

By September 9, 2018 No Comments

Apache breaks for me quite a few times. I wanted to make a log of commands that I run in order to reinstall apache2. Following are the commands that helped me reinstall apache2.

1
2
3
4
5
6
7
8
9
10
11
12
sudo apt-get --purge remove apache2

sudo apt-get autoremove

sudo apt-get install apache2

sudo apt-get install curl

sudo apt-get libapache2-mod-php


sudo nano /etc/apache2/httpd.conf

Inside

Directory /var/www block

1
AllowOverride All

Back to terminal.

1
2
3
4
5
6
7
8
9
10
11
sudo a2enmod rewrite

sudo a2dismod mpm_event

sudo a2enmod mpm_prefork

systemctl restart apache2

sudo a2enmod php5.6

systemctl restart apache2