HSAdmin Backend Domains, E-Mail, Datenbanken
Michael Hierweck
2014-09-01 a21031775508ccac43bda78885e4c514d3004fe6
Create app and app-ssl directories for new domains.
2 files modified
13 ■■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java 11 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm 2 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
@@ -26,14 +26,10 @@
public class DomainProcessorFactory implements EntityProcessorFactory {
    
    private static final String[] DYNAMIC_STRUCTURE = new String[] {
        "htdocs", "htdocs-ssl", "subs", "subs/www", "subs-ssl", "subs-ssl/www", "cgi", "fastcgi", "cgi-ssl", "fastcgi-ssl", "etc", "var"
    private static final String[] DOM_STRUCTURE = new String[] {
        "htdocs", "htdocs-ssl", "subs", "subs/www", "subs-ssl", "subs-ssl/www", "cgi", "fastcgi", "cgi-ssl", "fastcgi-ssl", "app", "app-ssl", "etc", "var"
    };
    
    private static final String[] STATIC_STRUCTURE = new String[] {
        "htdocs", "htdocs-ssl", "subs", "subs/www", "subs-ssl", "subs-ssl/www", "etc", "var"
    };
    public <T extends AbstractEntity> Processor createCreateProcessor(EntityManager em, T entity) throws ProcessorException {
        String hiveName = entity.getHiveName();
        Domain dom = (Domain) entity;
@@ -210,7 +206,6 @@
        String domsDir = homeDir + "/doms";
        String userName = domUser.getName();
        String domainDir = domsDir + "/" + dom.getName();
        String[] subDirs = dom.isDynamic() ? DYNAMIC_STRUCTURE : STATIC_STRUCTURE;
        String httpdRights = "";
        if (pacName != userName) {
            httpdRights =
@@ -227,7 +222,7 @@
                    "chown " + userName + ":httpd " + domainDir 
                    );
        CompoundProcessor domDirsProcessor = new CompoundProcessor(mkDomainDirProzessor);
        for (String subDir : subDirs) {
        for (String subDir : DOM_STRUCTURE) {
            domDirsProcessor.appendProcessor(new ShellProcessor(
                    "mkdir --mode=755 --parents " + domainDir + "/" + subDir + " && " +
                    "chown " + userName + ":" + pacName +  " " + domainDir + "/" + subDir
hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm
@@ -67,8 +67,8 @@
    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
    RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# !-d
    RewriteRule ^(.*) - [redirect=404,last]
#end
#if( ${dynamicWeb} )
    AddType application/x-httpd-php .php .php5 .php4 .php3
    Action application/x-httpd-php /fastcgi-bin/phpstub