HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2012-09-20 2b5e94e7657b44d268b11d063fec29b0175d52f4
Merge branch 'master' of ssh://hsh04-source@hsh04.hostsharing.net/home/doms/source.hostsharing.net/source/hsadmin.git/
4 files modified
43 ■■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl 14 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl 13 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/index.html.jtpl 4 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java 12 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl
@@ -7,7 +7,7 @@
    ServerName {DOM_HOSTNAME}
    ServerAlias *.{DOM_HOSTNAME}
    ServerAdmin {DOM_USERNAME}@{HIVE}.hostsharing.net
    ServerAdmin webmaster@{DOM_HOSTNAME}
    SuexecUserGroup {DOM_USERNAME} {PAC}
@@ -24,15 +24,15 @@
       AllowOverride AuthConfig FileInfo Indexes Limit
    </Directory>
    <Location /cgi-bin/>
    <Directory /home/doms/{DOM_HOSTNAME}/cgi-bin/>
        SetHandler cgi-script
        Options +ExecCGI -Indexes -MultiViews
    </Location>
    </Directory>
    <Location /fastcgi-bin/>
    <Directory /home/doms/{DOM_HOSTNAME}/fastcgi-bin/>
        SetHandler fcgid-script
        Options +ExecCGI -Indexes -MultiViews
    </Location>
    </Directory>
    RewriteEngine On
    RewriteOptions Inherit
@@ -42,12 +42,14 @@
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} -d
    RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1}$1 [last]
<!-- BEGIN: iterate -->
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} !-d
    RewriteRule ^(.*) - [redirect=404,last]
<!-- END: iterate -->
    AddType application/x-httpd-php .php .php5 .php4 .php3
    Action application/x-httpd-php /fastcgi-bin/phpstub
@@ -100,12 +102,14 @@
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} -d
    RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1}$1 [last]
<!-- BEGIN: nosubdomainfallbackforhttps -->
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} !-d
    RewriteRule ^(.*) - [redirect=404,last]
<!-- END: nosubdomainfallbackforhttps -->
    AddType application/x-httpd-php .php .php5 .php4 .php3
    Action application/x-httpd-php /fastcgi-bin/phpstub
hsarback/src/de/hsadmin/mods/dom/httpd-vhost-static.jtpl
@@ -7,7 +7,7 @@
    ServerName {DOM_HOSTNAME}
    ServerAlias *.{DOM_HOSTNAME}
    ServerAdmin {DOM_USERNAME}@{HIVE}.hostsharing.net
    ServerAdmin webmaster@{DOM_HOSTNAME}
    SuexecUserGroup {DOM_USERNAME} {PAC}
@@ -21,13 +21,13 @@
       AllowOverride AuthConfig FileInfo Indexes Limit
    </Directory>
    <Location /cgi-bin/>
    <Directory /home/doms/{DOM_HOSTNAME}/cgi-bin/>
        Redirect 501 /
    </Location>
    </Directory>
    <Location /fastcgi-bin/>
    <Directory /home/doms/{DOM_HOSTNAME}/fastcgi-bin/>
        Redirect 501 /
    </Location>
    </Directory>
    RewriteEngine On
    RewriteOptions Inherit
@@ -35,9 +35,11 @@
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} -d
    RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1}$1 [last]
<!-- BEGIN: iterate -->    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} !-d
    RewriteRule ^(.*) - [redirect=404,last]
<!-- END: iterate -->
</VirtualHost>
@@ -84,6 +86,7 @@
<!-- BEGIN: nosubdomainfallbackforhttps -->    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary]
    RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} !-d
    RewriteRule ^(.*) - [redirect=404,last]
<!-- END: nosubdomainfallbackforhttps -->
</VirtualHost>
<!-- END: main -->
hsarback/src/de/hsadmin/mods/dom/index.html.jtpl
@@ -10,11 +10,11 @@
<p>Diese neue Website wurde gerade bei der
<a href="http://www.hostsharing.net">Hostsharing eG</a>
f&uuml;r {USER_NAME} eingerichtet. </p>
f&uuml;r {USER_NAME} eingerichtet.</p>
<p>Der Inhaber der Domain ist bereits per Email unter
<a href="mailto:webmaster(at){DOMAIN}">webmaster(at){DOMAIN}</a>
zu erreichen. </p>
zu erreichen.</p>
</body>
hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
@@ -44,9 +44,14 @@
                createProftpdConfProc(hiveValues, pacValuesList), 
                createMakePacDirectoryStructure(unixUser),
                createIfUp(pacName),
                createHttpdVirtualProc(pacName, pacValuesList));
                createHttpdVirtualProc(pacName, pacValuesList),
                createAccountingRulesProc());
        WaitingTasksProcessor secProcessor = new WaitingTasksProcessor(priProcessor);
        return secProcessor;
    }
    private Processor createAccountingRulesProc() {
        return new ShellProcessor("mk-iptables-rules Accounting");
    }
    private Processor createHttpdVirtualProc(
@@ -82,7 +87,8 @@
                createNetworkInterfacesProc(hiveValues, pacValuesList), 
                createSudouersProc(hiveValues, pacValuesList), 
                createProftpdConfProc(hiveValues, pacValuesList),
                createHttpdVirtualProc(pac.getName(), pacValuesList)));
                createHttpdVirtualProc(pac.getName(), pacValuesList),
                createAccountingRulesProc()));
        waitingProcessor.appendProcessor(pac.getHiveName(), createDelUserProc(pac.getName()), "remove packet");
        return waitingProcessor;
    }
@@ -152,11 +158,13 @@
        String username = unixUser.getName();
        return new ShellProcessor("chmod 711 " + homedir + " && " +
                "su -l " + username + " -s \"/bin/bash\" -c \"mkdir -p " +
                homedir + "/.bak " +
                homedir + "/doms " + 
                homedir + "/etc " +
                homedir + "/users " + 
                homedir + "/var " + 
                "\" && " +
                "chmod 0700 " + homedir + "/.bak && " +
                "chown httpd " + homedir + "/doms && " +
                "chmod 1550 " + homedir + "/doms && " +
                "chmod 2700 " + homedir + "/etc && " +