sudo vi /etc/apache2/sites-available/hostname
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
#ServerAdmin info@example.com
ServerName example.com
#ServerAlias www.example.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.php index.html
DocumentRoot /home/username/public_html/example/public
# Custom log file locations
LogLevel warn
ErrorLog /home/username/public_html/example/log/error.log
CustomLog /home/username/public_html/example/log/access.log combined
</VirtualHost>
cd /etc/apache2/sites-available
sudo a2ensite test
sudo /etc/init.d/apache2 reload