is to automate the creation of a new a VHOST (virtual host) for an Apache server based on the assumptions below. This script has been tested as working on Ubuntu 14.04, 16.04, 20.04.
- takes 1 input parameter: the
<projectname>
- generates and set permissions on
/etc/apache2/sites-available/<projectname>.conf
- creates
/web/webroot/<projectname>
folder and sets folder permissions - adds
/etc/apache2/sites-available/<projectname>.conf
toa2ensite
- runs
service apache2 restart
enabling the website and making it active - generates a reference to
<projectname>
in/etc/hosts
for local DNS resolution ofhttp://<projectname>/