OS: Ubuntu 16.04, but it should works on other distros and versions.
sudo apt update && sudo apt install -y apache2 sudo nano /etc/apache2/sites-available/basic-php-example.conf- Paste the following text in the file, changing the two
your_directory_herewith the template's folder.
# Ensure that Apache listens on port 80
Listen 80
<VirtualHost *:80>
DocumentRoot "your_directory_here"
ServerName localhost
<Directory "your_directory_here">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
sudo a2ensite basic-php-example.conf
sudo systemctl restart apache2