add internal domains
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
# echo "* * * * * root /root/scripts/server/list-web-users.sh" > /etc/cron.d/list-web-users
|
# echo "* * * * * root /root/scripts/server/list-web-users.sh" > /etc/cron.d/list-web-users
|
||||||
|
|
||||||
DOMAINROOT="mit.tareo-tz.org"
|
DOMAINROOT="mit.tareo-tz.org"
|
||||||
|
INTDOMAINROOT="web.intra"
|
||||||
WEBDIR="/var/www/html/html"
|
WEBDIR="/var/www/html/html"
|
||||||
|
|
||||||
> $WEBDIR/websites.txt
|
> $WEBDIR/websites.txt
|
||||||
@@ -11,8 +12,9 @@ find /var/www/* -maxdepth 0 -type d -print0 | while IFS= read -r -d $'\0' line;
|
|||||||
|
|
||||||
USER=$(basename $line)
|
USER=$(basename $line)
|
||||||
DOMAIN="$USER.$DOMAINROOT"
|
DOMAIN="$USER.$DOMAINROOT"
|
||||||
|
INTDOMAIN="$USER.$INTDOMAINROOT"
|
||||||
if [ ! "$USER" == "html" ] && [ ! "$USER" == "pma" ]; then
|
if [ ! "$USER" == "html" ] && [ ! "$USER" == "pma" ]; then
|
||||||
echo "<li><a href=\"http://$DOMAIN\">$DOMAIN</a></li>" >> $WEBDIR/websites.txt
|
echo "<li><a href=\"http://$INTDOMAIN\">$INTDOMAIN</a> (alternatively <a href=\"http://$DOMAIN\">$DOMAIN</a>)</li>" >> $WEBDIR/websites.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DOMAINROOT="mit.tareo-tz.org"
|
DOMAINROOT="mit.tareo-tz.org"
|
||||||
|
INTDOMAINROOT="web.intra"
|
||||||
WEBROOT="/var/www"
|
WEBROOT="/var/www"
|
||||||
DATASHEETS="/root/datasheets"
|
DATASHEETS="/root/datasheets"
|
||||||
|
|
||||||
@@ -22,10 +23,12 @@ fi
|
|||||||
read -p "Password of $USER: " PASS
|
read -p "Password of $USER: " PASS
|
||||||
|
|
||||||
DOMAIN="$USER.$DOMAINROOT"
|
DOMAIN="$USER.$DOMAINROOT"
|
||||||
echo "The new user's domain will be $DOMAIN"
|
INTDOMAIN="$USER.$INTDOMAINROOT"
|
||||||
|
echo "The new user's domain will be $DOMAIN. The internal domain will be $INTDOMAIN"
|
||||||
read -p "Is that ok? [Y/n]" yn
|
read -p "Is that ok? [Y/n]" yn
|
||||||
if [ "$yn" == "n" ]; then
|
if [ "$yn" == "n" ]; then
|
||||||
read -p "Type in custom domain: " DOMAIN
|
read -p "Type in custom domain: " DOMAIN
|
||||||
|
read -p "Type in custom internal domain: " INTDOMAIN
|
||||||
fi
|
fi
|
||||||
|
|
||||||
WEBDIR="$WEBROOT/$USER"
|
WEBDIR="$WEBROOT/$USER"
|
||||||
@@ -97,7 +100,7 @@ echo "[INFO] Configuring Apache VirtualHost..."
|
|||||||
cat > /etc/apache2/sites-available/$USER.conf << EOF
|
cat > /etc/apache2/sites-available/$USER.conf << EOF
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerAdmin info@tareo-tz.org
|
ServerAdmin info@tareo-tz.org
|
||||||
ServerName $USER.server.local
|
ServerName $INTDOMAIN
|
||||||
ServerAlias $DOMAIN
|
ServerAlias $DOMAIN
|
||||||
SuexecUserGroup $USER $USER
|
SuexecUserGroup $USER $USER
|
||||||
AddHandler fcgid-script .php
|
AddHandler fcgid-script .php
|
||||||
@@ -164,10 +167,10 @@ cat > $DATASHEETS/datasheet-$USER.txt << EOF
|
|||||||
################################
|
################################
|
||||||
|
|
||||||
# Webserver
|
# Webserver
|
||||||
URL: $DOMAIN
|
URL: $INTDOMAIN
|
||||||
|
|
||||||
# FTP (Use FileZilla)
|
# FTP (Use FileZilla)
|
||||||
Server: http://$DOMAIN
|
Server: http://$INTDOMAIN
|
||||||
Port: 22
|
Port: 22
|
||||||
Protocol: SFTP
|
Protocol: SFTP
|
||||||
Logon type: Normal
|
Logon type: Normal
|
||||||
@@ -182,7 +185,7 @@ User Name: $USER
|
|||||||
Password: $PASS
|
Password: $PASS
|
||||||
Database Host: localhost
|
Database Host: localhost
|
||||||
|
|
||||||
phpMyAdmin: http://pma.$DOMAINROOT
|
phpMyAdmin: http://pma.$INTDOMAINROOT
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
enscript -p $DATASHEETS/datasheet-$USER.ps $DATASHEETS/datasheet-$USER.txt
|
enscript -p $DATASHEETS/datasheet-$USER.ps $DATASHEETS/datasheet-$USER.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user