diff --git a/sbin/a2addsite b/sbin/a2addsite new file mode 100755 index 0000000..8d0b33f --- /dev/null +++ b/sbin/a2addsite @@ -0,0 +1,47 @@ +#!/bin/bash + +# NOTE: These may vary between distros. +SITE_CONFIG_DIR=/etc/apache2/sites-available +WEB_DIR=/var/www +LOG_DIR=/var/log/apache2 + +SITE=$1 +PROGRAM=$(basename $0) +CONFIG_FILE="$SITE_CONFIG_DIR/$SITE" + +# Usage info +if [ $# -ne 1 ] || [ $1 == "--help" ] ; then + cat < $CONFIG_FILE < + ServerName $SITE + UseCanonicalName On + + CustomLog $LOG_DIR/$SITE/access.log combined + ErrorLog $LOG_DIR/$SITE/error.log + + DocumentRoot $WEB_DIR/$SITE/public + + AllowOverride All + Options FollowSymLinks + Order allow,deny + Allow from all + + Alias /uploads $WEB_DIR/$SITE/uploads + +CONFIG