This is a basic virtual host creator using ports.
The code was tested and working on Debian Jessie.
Setup instructions
- create a database and import the sql file
- copy php files to your server and change db.php to fit your database connection 2.a chmod +w /var/www
- create /etc/apache2/myports.conf 3.a chmod +rw /etc/apache2/myports.conf
- create /etc/apache2/sites-available/vhosts.conf 4.a chmod +rw /etc/apache2/sites-available/vhosts.conf
- edit /etc/apache2/ports.conf add after 'Listen 80' this line 'Include myports.conf'
- edit /etc/apache2/apache2.conf add after 'Include ports.conf' this line 'Include sites-enabled/vhosts.conf'
- add to /etc/apache2/ the restart.sh script file 7.a chmod +xs /etc/apache2/restart.sh
- append /ets/sudoers : Cmnd_Alias RESTART_APACHE = /etc/apache2/restart.sh www-data ALL=NOPASSWD: RESTART_APACHE