df2daf524d
Signed-off-by: Nico Schottelius <nico@manager.schottelius.org>
58 lines
1.6 KiB
Bash
Executable file
58 lines
1.6 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
. `dirname $0`/sub.defaults
|
|
|
|
if [ $# -lt 4 ]; then
|
|
echo "$0:"' TLD SLD SUBDOMAIN VUSER'
|
|
exit 1
|
|
fi
|
|
|
|
TLD="$1"
|
|
SLD="$2"
|
|
SUBDOMAIN="$3"
|
|
VUSER="$4"
|
|
|
|
echo Adding vhost $SUBDOMAIN.$SLD.$TLD for $VUSER...
|
|
|
|
cat << EOF | sed \
|
|
-e "s/__SLD/$SLD/g"\
|
|
-e "s/__TLD/$TLD/g"\
|
|
-e "s/__SUBDOMAIN/$SUBDOMAIN/g" \
|
|
-e "s/__VUSER/$VUSER/g" \
|
|
-e "s/__GROUP/$CUSTOMER_GROUP/g" \
|
|
-e "s,__BASE,$WEBBASE,g" \
|
|
>> "$APACHE_CONF"
|
|
|
|
# __SUBDOMAIN.__SLD.__TLD by __VUSER
|
|
<VirtualHost _default_>
|
|
# SuexecUserGroup __VUSER __GROUP
|
|
ServerAdmin webmaster@__SLD.__TLD
|
|
DocumentRoot __BASE/__VUSER/__TLD/__SLD/__SUBDOMAIN/
|
|
<Directory __BASE/__VUSER/__TLD/__SLD/__SUBDOMAIN/>
|
|
Options Indexes Includes FollowSymLinks MultiViews
|
|
</Directory>
|
|
ServerName __SUBDOMAIN.__SLD.__TLD
|
|
# ServerAlias *.__SLD.__TLD
|
|
# ServerAlias __SLD.__TLD
|
|
ScriptAlias /cgi-bin/ "__BASE/__VUSER/__TLD/__SLD/__SUBDOMAIN/cgi-bin/"
|
|
ErrorLog __BASE/__VUSER/__TLD/__SLD/__SUBDOMAIN/logs/error.log
|
|
CustomLog __BASE/__VUSER/__TLD/__SLD/__SUBDOMAIN/logs/access.log combined
|
|
<Directory __BASE/__VUSER/__TLD/__SLD/__SUBDOMAIN/logs/>
|
|
AuthType Basic
|
|
Require valid-user
|
|
AuthName "Kundenbereich - For customers only"
|
|
AuthUserFile __BASE/__VUSER/__TLD/__SLD/__SUBDOMAIN.passwd
|
|
</Directory>
|
|
|
|
</VirtualHost>
|
|
|
|
EOF
|
|
|
|
# logs password
|
|
echo "Enter password for viewing logs and statistics (twice)"
|
|
htpasswd -c "$WEBBASE/$VUSER/$TLD/$SLD/${SUBDOMAIN}.passwd" "$VUSER"
|
|
|
|
# restart
|
|
echo -n restarting apache...
|
|
$RESTART_APACHE
|
|
echo done.
|