From df645103d905bd1c6f8a8f549c6c16b5efde9550 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@jalin.de>
Date: Tue, 12 Jun 2018 17:35:59 +0200
Subject: [PATCH] revert PassengerLogFile

---
 hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm |  114 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 58 insertions(+), 56 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm b/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm
index b98de63..a1c89c3 100644
--- a/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm
+++ b/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm
@@ -5,151 +5,153 @@
 
 <VirtualHost ${pac.curINetAddr.inetAddr}:80 ${pac.oldINetAddr.inetAddr}:80>
     ServerName ${dom.name}
-    ServerAlias *.${dom.name}
+    ServerAlias ${dom.serveraliases}
     ServerAdmin webmaster@${dom.name}
 
     SuexecUserGroup ${dom.user.name} ${pac.name}
 
-#if( ${dynamicWeb} )    
-    PassengerEnabled on
+    PassengerEnabled Off
     PassengerUser ${dom.user.name}
     PassengerGroup ${pac.name}
     PassengerAppRoot /home/doms/${dom.name}/app/
-#end    
 
     DocumentRoot /home/doms/${dom.name}/htdocs
 
     Alias /cgi-bin/ /home/doms/${dom.name}/cgi/
     Alias /fastcgi-bin/ /home/doms/${dom.name}/fastcgi/
+#if( ${letsencrypt} )
+    Alias /.well-known/acme-challenge/ /var/lib/hostsharing/acmebot/webroot/${dom.name}/
+#end
 
     <Directory />
+        PassengerEnabled Off
         Options -ExecCGI ${includes} ${indexes} ${multiviews} +SymLinksIfOwnerMatch
     </Directory>
 
     <Directory /home/doms/${dom.name}/>
-        AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,Indexes,MultiViews,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
+        PassengerEnabled On
+        AllowOverride AuthConfig FileInfo Indexes Limit Options=ExecCGI,IncludesNoExec,Indexes,MultiViews,SymLinksIfOwnerMatch,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
     </Directory>
 
-#if( ${dynamicWeb} )
     <Location /cgi-bin/>
+        PassengerEnabled Off
         SetHandler cgi-script
-        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
+        Options +ExecCGI -Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
     </Location>
-#else
-    <Location /cgi-bin/>
-        Redirect 501 /
-    </Location>
-#end
 
-#if( ${dynamicWeb} )
     <Location /fastcgi-bin/>
+        PassengerEnabled Off
         SetHandler fcgid-script
-        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
+        Options +ExecCGI -Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
     </Location>
-#else
-    <Location /fastcgi-bin/>
-        Redirect 501 /
-    </Location>
-#end
 
+#if( ${php5} )
+    FcgidInitialEnv HTTP_PHP_BIN /usr/lib/cgi-bin/php5
+
+#end
     RewriteEngine On
     RewriteOptions Inherit
 
     RewriteCond %{REQUEST_URI} !^/cgi-bin/
-    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/    
+    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
+#if( ${letsencrypt} )
+    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
+#end
     RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:[0-9]+)?$ [novary]
     RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# -d
-    RewriteRule ^(.*) /home/doms/${dom.name}/subs/#[[${tolower:%1}$1 ]]# [last]     
-    
+    RewriteRule ^(.*) /home/doms/${dom.name}/subs/#[[${tolower:%1}$1 ]]# [last] 
+     
 #if( !${htdocsfallback} )
     RewriteCond %{REQUEST_URI} !^/cgi-bin/
-	RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
-    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
+    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
+#if( ${letsencrypt} )
+    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
+#end
+    RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(: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
-#end
 </VirtualHost>
 
 <VirtualHost ${pac.curINetAddr.inetAddr}:443 ${pac.oldINetAddr.inetAddr}:443>
     ServerName ${dom.name}
-    ServerAlias *.${dom.name}
-    ServerAdmin ${dom.user.name}@${dom.name}
+    ServerAlias ${dom.serveraliases}
+    ServerAdmin webmaster@${dom.name}
 
     SuexecUserGroup ${dom.user.name} ${pac.name}
     
-#if( ${dynamicWeb} )    
-    PassengerEnabled on
+    PassengerEnabled Off
     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
+    SSLCertificateFile /etc/apache2/pems-enabled/${dom.name}.crt
+    SSLCertificateKeyFile /etc/apache2/pems-enabled/${dom.name}.key
+    SSLCertificateChainFile /etc/apache2/pems-enabled/${dom.name}.chain
        
     DocumentRoot /home/doms/${dom.name}/htdocs-ssl
 
     Alias /cgi-bin/ /home/doms/${dom.name}/cgi-ssl/
     Alias /fastcgi-bin/ /home/doms/${dom.name}/fastcgi-ssl/
+#if( ${letsencrypt} )
+    Alias /.well-known/acme-challenge/ /var/lib/hostsharing/acmebot/webroot/${dom.name}/
+#end
 
     <Directory />
         SSLRequireSSL On
+        PassengerEnabled Off
         Options -ExecCGI ${includes} ${indexes} ${multiviews} +SymLinksIfOwnerMatch
     </Directory>
 
     <Directory /home/doms/${dom.name}/>
-        AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,Indexes,MultiViews,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
+        PassengerEnabled On
+        AllowOverride AuthConfig FileInfo Indexes Limit Options=ExecCGI,IncludesNoExec,Indexes,MultiViews,SymLinksIfOwnerMatch,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
     </Directory>
 
-#if( ${dynamicWeb} )
     <Location /cgi-bin/>
+        PassengerEnabled Off
         SetHandler cgi-script
-        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
+        Options +ExecCGI -Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
     </Location>
-#else
-    <Location /cgi-bin/>
-        Redirect 501 /
-    </Location>
-#end
 
-#if( ${dynamicWeb} )
     <Location /fastcgi-bin/>
+        PassengerEnabled Off
         SetHandler fcgid-script
-        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
+        Options +ExecCGI -Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
     </Location>
-#else
-    <Location /fastcgi-bin/>
-        Redirect 501 /
-    </Location>
-#end
     
+#if( ${php5} )
+  FcgidInitialEnv HTTP_PHP_BIN /usr/lib/cgi-bin/php5
+
+#end
     RewriteEngine On
     RewriteOptions Inherit
     
     RewriteCond %{REQUEST_URI} !^/cgi-bin/
     RewriteCond %{REQUEST_URI} !^/fastcgi-bin/    
+#if( ${letsencrypt} )
+    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
+#end
     RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:[0-9]+)?$ [novary]
     RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1} ]]# -d
-    RewriteRule ^(.*) /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1}$1 ]]# [last]    
-    
+    RewriteRule ^(.*) /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1}$1 ]]# [last] 
+          
 #if( !${htdocsfallback} )
     RewriteCond %{REQUEST_URI} !^/cgi-bin/
-	RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
+    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
+#if( ${letsencrypt} )
+    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
+#end
     RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:443)?$ [novary]
     RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${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
-#end
+
 </VirtualHost>

--
Gitblit v1.9.0-SNAPSHOT