From a21031775508ccac43bda78885e4c514d3004fe6 Mon Sep 17 00:00:00 2001 From: Michael Hierweck Date: Mon, 1 Sep 2014 18:04:31 +0200 Subject: [PATCH] Create app and app-ssl directories for new domains. --- .../de/hsadmin/mods/dom/DomainProcessorFactory.java | 11 +++-------- hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index 1d9bddd..f6c0cdf 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -26,14 +26,10 @@ import de.hsadmin.mods.user.UnixUser; 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 Processor createCreateProcessor(EntityManager em, T entity) throws ProcessorException { String hiveName = entity.getHiveName(); Domain dom = (Domain) entity; @@ -210,7 +206,6 @@ public class DomainProcessorFactory implements EntityProcessorFactory { 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 @@ public class DomainProcessorFactory implements EntityProcessorFactory { "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 diff --git a/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm b/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm index 9a90cc8..b98de63 100644 --- a/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm +++ b/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