From ee5e33f3fe2051e695cb19c28e3eb6474183c9de Mon Sep 17 00:00:00 2001
From: Michael Hierweck <michael@hierweck.de>
Date: Tue, 12 Aug 2014 16:13:26 +0200
Subject: [PATCH] Introduced Phusion Passenger for Dynamic Web.

---
 hsarback/src/de/hsadmin/mods/dom/apache-vhost.vm |   48 +++++++++++++++++++++++++++++-------------------
 1 files changed, 29 insertions(+), 19 deletions(-)

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 @@
 #
 
 <VirtualHost ${pac.curINetAddr.inetAddr}:80 ${pac.oldINetAddr.inetAddr}:80>
-
     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
 
     <Directory />
         Options -ExecCGI ${includes} ${indexes} ${multiviews} +SymLinksIfOwnerMatch
     </Directory>
 
     <Directory /home/doms/${dom.name}/>
-        AllowOverride AuthConfig FileInfo Indexes Limit
+        AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,Indexes,MultiViews,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
     </Directory>
 
 #if( ${dynamicWeb} )
@@ -31,16 +35,18 @@
         SetHandler cgi-script
         Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
     </Location>
+#else
+    <Location /cgi-bin/>
+        Redirect 501 /
+    </Location>
+#end
 
+#if( ${dynamicWeb} )
     <Location /fastcgi-bin/>
         SetHandler fcgid-script
         Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
     </Location>
 #else
-    <Location /cgi-bin/>
-        Redirect 501 /
-    </Location>
-
     <Location /fastcgi-bin/>
         Redirect 501 /
     </Location>
@@ -67,29 +73,32 @@
     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}
 
     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
 
     <Directory />
         SSLRequireSSL On
@@ -97,7 +106,7 @@
     </Directory>
 
     <Directory /home/doms/${dom.name}/>
-        AllowOverride AuthConfig FileInfo Indexes Limit
+        AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,Indexes,MultiViews,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
     </Directory>
 
 #if( ${dynamicWeb} )
@@ -105,16 +114,18 @@
         SetHandler cgi-script
         Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
     </Location>
+#else
+    <Location /cgi-bin/>
+        Redirect 501 /
+    </Location>
+#end
 
+#if( ${dynamicWeb} )
     <Location /fastcgi-bin/>
         SetHandler fcgid-script
         Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
     </Location>
 #else
-    <Location /cgi-bin/>
-        Redirect 501 /
-    </Location>
-
     <Location /fastcgi-bin/>
         Redirect 501 /
     </Location>
@@ -141,5 +152,4 @@
     AddType application/x-httpd-php .php .php5 .php4 .php3
     Action application/x-httpd-php /fastcgi-bin/phpstub
 #end
-
 </VirtualHost>

--
Gitblit v1.9.0-SNAPSHOT