diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index 304de25..1d9bddd 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -247,20 +247,12 @@ public class DomainProcessorFactory implements EntityProcessorFactory { domDirsProcessor.appendProcessor( new CreateFileProcessor("/de/hsadmin/mods/dom/index.html.vm", templateVars, dom, domainDir + "/subs-ssl/www/index.html", userName, pacName, "644", false) ); - if (dom.isDynamic()) { - domDirsProcessor.appendProcessor( - new CreateFileProcessor("/de/hsadmin/mods/dom/test.cgi.vm", templateVars, dom, domainDir + "/cgi/test.cgi", userName, pacName, "755", false) - ); - domDirsProcessor.appendProcessor( - new CreateFileProcessor("/de/hsadmin/mods/dom/test.cgi.vm", templateVars, dom, domainDir + "/cgi-ssl/test.cgi", userName, pacName, "755", false) - ); - domDirsProcessor.appendProcessor( - new CopyFileProcessor("/usr/local/src/phpstub/phpstub", domainDir + "/fastcgi/phpstub", userName, pacName, "755") - ); - domDirsProcessor.appendProcessor( - new CopyFileProcessor("/usr/local/src/phpstub/phpstub", domainDir + "/fastcgi-ssl/phpstub", userName, pacName, "755") + domDirsProcessor.appendProcessor( + new CopyFileProcessor("/usr/local/src/phpstub/phpstub", domainDir + "/fastcgi/phpstub", userName, pacName, "755") + ); + domDirsProcessor.appendProcessor( + new CopyFileProcessor("/usr/local/src/phpstub/phpstub", domainDir + "/fastcgi-ssl/phpstub", userName, pacName, "755") ); - } domDirsProcessor.appendProcessor( new ShellProcessor("ln -sf " + domainDir + " /home/doms/ && " + "chown --no-dereference " + userName + ":httpd /home/doms/" + domName @@ -283,7 +275,7 @@ public class DomainProcessorFactory implements EntityProcessorFactory { ifOption(templateVars, query, "multiviews", "+MultiViews", "-MultiViews"); ifOption(templateVars, query, "htdocsfallback", Boolean.TRUE, Boolean.FALSE); Processor domSetupProcessor = new CompoundProcessor( - new CreateFileProcessor("/de/hsadmin/mods/dom/httpd-vhost.vm", templateVars, dom, "/etc/apache2/sites-available/" + domName + ".tmp", "root", "root", "644", true), + new CreateFileProcessor("/de/hsadmin/mods/dom/apache-vhost.vm", templateVars, dom, "/etc/apache2/sites-available/" + domName + ".tmp", "root", "root", "644", true), new ShellProcessor("ls /etc/apache2/pems/" + pac + ".pem >/dev/null 2>&1" + " && sed -i '/SSLCertificate.*default/d' " + "/etc/apache2/sites-available/" + domName + ".tmp" + " && (ls /etc/apache2/pems/" + pac + ".chain.pem >/dev/null 2>&1 || sed -i '/SSLCertificateChain.*" + pac + "/d' " + "/etc/apache2/sites-available/" + domName + ".tmp )" + diff --git a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost.vm b/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm similarity index 85% rename from hsarback/src/de/hsadmin/mods/dom/httpd-vhost.vm rename to hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm index 3d8c1a0..9a90cc8 100644 --- a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost.vm +++ b/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm @@ -4,26 +4,30 @@ # - ServerName ${dom.name} ServerAlias *.${dom.name} ServerAdmin webmaster@${dom.name} SuexecUserGroup ${dom.user.name} ${pac.name} +#if( ${dynamicWeb} ) + PassengerEnabled on + PassengerUser ${dom.user.name} + PassengerGroup ${pac.name} + PassengerAppRoot /home/doms/${dom.name}/app/ +#end + DocumentRoot /home/doms/${dom.name}/htdocs -#if( ${dynamicWeb} ) Alias /cgi-bin/ /home/doms/${dom.name}/cgi/ Alias /fastcgi-bin/ /home/doms/${dom.name}/fastcgi/ -#end Options -ExecCGI ${includes} ${indexes} ${multiviews} +SymLinksIfOwnerMatch - AllowOverride AuthConfig FileInfo Indexes Limit + AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,Indexes,MultiViews,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv #if( ${dynamicWeb} ) @@ -31,16 +35,18 @@ SetHandler cgi-script Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch +#else + + Redirect 501 / + +#end +#if( ${dynamicWeb} ) SetHandler fcgid-script Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch #else - - Redirect 501 / - - Redirect 501 / @@ -67,29 +73,32 @@ AddType application/x-httpd-php .php .php5 .php4 .php3 Action application/x-httpd-php /fastcgi-bin/phpstub #end - - ServerName ${dom.name} ServerAlias *.${dom.name} ServerAdmin ${dom.user.name}@${dom.name} SuexecUserGroup ${dom.user.name} ${pac.name} + +#if( ${dynamicWeb} ) + PassengerEnabled on + PassengerUser ${dom.user.name} + PassengerGroup ${pac.name} + PassengerAppRoot /home/doms/${dom.name}/app-ssl/ +#end SSLEngine On SSLCertificateFile /etc/apache2/pems/default.pem SSLCertificateChainFile /etc/apache2/pems/default.chain.pem SSLCertificateFile /etc/apache2/pems/${pac.name}.pem SSLCertificateChainFile /etc/apache2/pems/${pac.name}.chain.pem - + DocumentRoot /home/doms/${dom.name}/htdocs-ssl -#if( ${dynamicWeb} ) Alias /cgi-bin/ /home/doms/${dom.name}/cgi-ssl/ Alias /fastcgi-bin/ /home/doms/${dom.name}/fastcgi-ssl/ -#end SSLRequireSSL On @@ -97,7 +106,7 @@ - AllowOverride AuthConfig FileInfo Indexes Limit + AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,Indexes,MultiViews,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv #if( ${dynamicWeb} ) @@ -105,16 +114,18 @@ SetHandler cgi-script Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch +#else + + Redirect 501 / + +#end +#if( ${dynamicWeb} ) SetHandler fcgid-script Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch #else - - Redirect 501 / - - Redirect 501 / @@ -141,5 +152,4 @@ AddType application/x-httpd-php .php .php5 .php4 .php3 Action application/x-httpd-php /fastcgi-bin/phpstub #end -