From 35727b04e330b323ace37d8a6de9d9b264dd7e96 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@jalin.de>
Date: Thu, 07 Mar 2019 19:37:57 +0100
Subject: [PATCH] IPv6 changes

---
 hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm |  182 +++++++++++++++++++++++---------------------
 1 files changed, 95 insertions(+), 87 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm b/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm
index 4e1c8c1..7834096 100644
--- a/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm
+++ b/hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm
@@ -1,9 +1,9 @@
-# 
+#
 # This file is managed by HSAdmin.
 # Do not edit manually. Changes will be overwritten.
 #
 
-<VirtualHost ${pac.curINetAddr.inetAddr}:80 ${pac.oldINetAddr.inetAddr}:80>
+<VirtualHost ${pac.curINetAddr.inet4Addr}:80 ${pac.oldINetAddr.inet4Addr}:80 ${pac.curINetAddr.inet6Addr}:80 ${pac.oldINetAddr.inet6Addr}:80>
     ServerName ${dom.name}
     ServerAlias ${dom.serveraliases}
     ServerAdmin webmaster@${dom.name}
@@ -24,82 +24,7 @@
 #end
 
     <Directory />
-		PassengerEnabled Off
-        Options -ExecCGI ${includes} ${indexes} ${multiviews} +SymLinksIfOwnerMatch
-    </Directory>
-
-    <Directory /home/doms/${dom.name}/>
-		PassengerEnabled On
-        AllowOverride AuthConfig FileInfo Indexes Limit Options=ExecCGI,IncludesNoExec,Indexes,MultiViews,SymLinksIfOwnerMatch,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
-    </Directory>
-
-    <Location /cgi-bin/>
-		PassengerEnabled Off
-        SetHandler cgi-script
-        Options +ExecCGI -Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
-    </Location>
-
-    <Location /fastcgi-bin/>
-		PassengerEnabled Off
-        SetHandler fcgid-script
-        Options +ExecCGI -Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
-    </Location>
-
-    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/#[[${tolower:%1} ]]# -d
-    RewriteRule ^(.*) /home/doms/${dom.name}/subs/#[[${tolower:%1}$1 ]]# [last] 
-     
-#if( !${htdocsfallback} )
-    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}\.?(:80)?$ [novary]
-    RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# !-d
-    RewriteRule ^(.*) - [redirect=404,last]
-    
-#end
-    AddType application/x-httpd-php .php .php5 .php4 .php3
-    Action application/x-httpd-php /fastcgi-bin/phpstub
-</VirtualHost>
-
-<VirtualHost ${pac.curINetAddr.inetAddr}:443 ${pac.oldINetAddr.inetAddr}:443>
-    ServerName ${dom.name}
-    ServerAlias ${dom.serveraliases}
-    ServerAdmin ${dom.user.name}@${dom.name}
-
-    SuexecUserGroup ${dom.user.name} ${pac.name}
-    
-    PassengerEnabled Off
-    PassengerUser ${dom.user.name}
-    PassengerGroup ${pac.name}
-    PassengerAppRoot /home/doms/${dom.name}/app-ssl/
-
-    SSLEngine On
-    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
+        PassengerEnabled Off
         Options -ExecCGI ${includes} ${indexes} ${multiviews} +SymLinksIfOwnerMatch
     </Directory>
 
@@ -111,27 +36,110 @@
     <Location /cgi-bin/>
         PassengerEnabled Off
         SetHandler cgi-script
-        Options +ExecCGI -Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
+        Options +ExecCGI +IncludesNoExec -Indexes -MultiViews +SymLinksIfOwnerMatch
     </Location>
 
     <Location /fastcgi-bin/>
-	PassengerEnabled Off
+        PassengerEnabled Off
         SetHandler fcgid-script
-        Options +ExecCGI -Includes -Indexes -MultiViews +SymLinksIfOwnerMatch
+        Options +ExecCGI +IncludesNoExec -Indexes -MultiViews +SymLinksIfOwnerMatch
     </Location>
-    
+
+#if( ${phplatest} )
+    FcgidInitialEnv HTTP_PHP_BIN /usr/lib/cgi-bin/php7.3
+
+#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]
+
+#if( !${htdocsfallback} )
+    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}\.?(:80)?$ [novary]
+    RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# !-d
+    RewriteRule ^(.*) - [redirect=404,last]
+
+#end
+    AddType application/x-httpd-php .php .php5 .php4 .php3
+    Action application/x-httpd-php /fastcgi-bin/phpstub
+</VirtualHost>
+
+<VirtualHost ${pac.curINetAddr.inet4Addr}:443 ${pac.oldINetAddr.inet4Addr}:443 ${pac.curINetAddr.inet6Addr}:443 ${pac.oldINetAddr.inet6Addr}:443>
+    ServerName ${dom.name}
+    ServerAlias ${dom.serveraliases}
+    ServerAdmin webmaster@${dom.name}
+
+    SuexecUserGroup ${dom.user.name} ${pac.name}
+
+    PassengerEnabled Off
+    PassengerUser ${dom.user.name}
+    PassengerGroup ${pac.name}
+    PassengerAppRoot /home/doms/${dom.name}/app-ssl/
+
+    SSLEngine On
+    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}/>
+        PassengerEnabled On
+        AllowOverride AuthConfig FileInfo Indexes Limit Options=ExecCGI,IncludesNoExec,Indexes,MultiViews,SymLinksIfOwnerMatch,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
+    </Directory>
+
+    <Location /cgi-bin/>
+        PassengerEnabled Off
+        SetHandler cgi-script
+        Options +ExecCGI +IncludesNoExec -Indexes -MultiViews +SymLinksIfOwnerMatch
+    </Location>
+
+    <Location /fastcgi-bin/>
+        PassengerEnabled Off
+        SetHandler fcgid-script
+        Options +ExecCGI +IncludesNoExec -Indexes -MultiViews +SymLinksIfOwnerMatch
+    </Location>
+
+#if( ${phplatest} )
+    FcgidInitialEnv HTTP_PHP_BIN /usr/lib/cgi-bin/php7.3
+
+#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/
@@ -141,7 +149,7 @@
     RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:443)?$ [novary]
     RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1} ]]# !-d
     RewriteRule ^(.*) - [redirect=404,last]
-    
+
 #end
     AddType application/x-httpd-php .php .php5 .php4 .php3
     Action application/x-httpd-php /fastcgi-bin/phpstub

--
Gitblit v1.9.0-SNAPSHOT