Return to Snippet

Revision: 43715
at March 29, 2011 22:30 by craig0990

Initial Code

if [ -z "$1" ]; then
	echo "Usage: a2mksite <DOMAIN>"
	echo ""
	echo "Please supply a domain name"
	exit 0

cp -R "/var/www/skeleton" "/var/www/$1"
sed -e "s/skeleton/$1/g" "/etc/apache2/sites-available/skeleton" > "/etc/apache2/sites-available/$"
a2ensite "$"

Initial URL

Initial Description
Fairly self-explanator, but:

Expects a directory at <code>/var/www/skeleton</code> with the correct permissions. This is then copied and renamed. Also expects a file named <code>/etc/apache2/sites-available/skeleton</code> which is used to copy the VirtualHost configuration.

Initial Title
Create new Apache VirtualHost files and /var/www directories

Initial Tags

Initial Language