Simple script to help create apache virtual hosts for the MAMP stack.
create-vhost sampledomain.tld
APACHECONF Set this to the path of your httpd-vhosts.conf file
LOGDIR Set this to the location you want apache logs
VHOSTSDIR Set this to the folder on your filesystem where you want new vhosts created
-
Creates a new folder under the configured
VHOSTDIRfolder for your new virtual host -
Adds an entry to your
/etc/hostsfile which will resolve the host name to your PC (Note: this requiressudo, so you will be prompted for your password)127.0.0.1 sampledomain.tld
-
Appends a virtual host definition to your
httpd-vhosts.conffile