Install Apache on Debian and Ubuntu

Install Apache
sudo apt-get install apache2
sudo vi /etc/apache2/sites-available/default

change AllowOverride None > AllowOverride All in line 11

Enable Apache rewrite and restart

Achtung! Don’t forget or things will not work and you’ll waste hours trying to find out why

sudo a2enmod rewrite

Restart Apache

sudo service apache2 restart

If no error, its working

Optional: The following “example” is used to test that Apache is setup properly. You could skip the this part and go directly to installing MySQL Server.

Test that Apache is Setup Properly
sudo vi /etc/apache2/sites-available/

copy this code into the file

<VirtualHost *:80>
     DocumentRoot /var/www/
sudo mkdir /var/www/
sudo vi /var/www/

enter some text “it lives”


to save and exit vi

sudo chown -Rf www-data:www-data /var/www/
sudo chmod -Rf 755 /var/www/
sudo service apache2 restart

You may also like...