Install Apache, MySQL and PHP in your Linux distro.

Make sure that you have opened the :80 port before you begin

Debian Distros

The following steps have been tested on Ubuntu 16.04. Should work in any Debian distro


All packages are available as repos.

Install Apache 2

sudo apt install apache2

Install MySQL Server

sudo apt install mysql-server

Install PHP and extensions

sudo apt install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php


Create domain dir

sudo mkdir /var/www/
sudo mkdir /var/www/
public_html will be the folder you will upload the website files

Change public_html permissions

sudo chown -R $USER:$USER /var/www/
It is recommended to add your user in www-data group and change the permissions to www-data:www-data instead of $USER:$USER

sudo chmod -R 755 /var/www

Create new vhost

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/

sudo nano /etc/apache2/sites-available/
Change the variables accordingly

Enable the new vhost

sudo a2ensite

sudo a2dissite 000-default.conf

Reload Apache

sudo service apache2 reload