From ebd0e986ed11f2a34fb58cdd33efbfab192083ad Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Fri, 22 Apr 2016 05:26:17 -0400
Subject: [PATCH] Added PHP 7 check in installer and updater.

---
 install/tpl/apache_ispconfig.vhost.master |  104 ++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 80 insertions(+), 24 deletions(-)

diff --git a/install/tpl/apache_ispconfig.vhost.master b/install/tpl/apache_ispconfig.vhost.master
index 5b62c5b..3619e16 100644
--- a/install/tpl/apache_ispconfig.vhost.master
+++ b/install/tpl/apache_ispconfig.vhost.master
@@ -4,33 +4,89 @@
 # for the ISPConfig controlpanel
 ######################################################
 
-Listen 8080
-NameVirtualHost *:8080
+<tmpl_var name="vhost_port_listen"> Listen <tmpl_var name="vhost_port">
+NameVirtualHost *:<tmpl_var name="vhost_port">
 
-<VirtualHost _default_:8080>
-	ServerAdmin webmaster@localhost
+<VirtualHost _default_:<tmpl_var name="vhost_port">>
+  ServerAdmin webmaster@localhost
+  
+  <FilesMatch "\.ph(p3?|tml)$">
+    SetHandler None
+  </FilesMatch>
+  
+  <IfModule mod_fcgid.c>
+    DocumentRoot /var/www/ispconfig/
+    SuexecUserGroup ispconfig ispconfig
+    <Directory /var/www/ispconfig/>
+      Options -Indexes +FollowSymLinks +MultiViews +ExecCGI
+      AllowOverride AuthConfig Indexes Limit Options FileInfo
+	  <FilesMatch "\.php$">
+		  SetHandler fcgid-script
+	  </FilesMatch>
+      FCGIWrapper /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter .php
+      <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
+	  Require all granted
+	  <tmpl_else>
+      Order allow,deny
+      Allow from all
+	  </tmpl_if>
+    </Directory>
+    IPCCommTimeout  7200
+	MaxRequestLen 15728640
+  </IfModule>
+  
+  <IfModule mpm_itk_module>
     DocumentRoot /usr/local/ispconfig/interface/web/
-	
-	<IfModule mod_php5.c>
-  		AddType application/x-httpd-php .php
-	</IfModule>
-	
-	<Directory /usr/local/ispconfig/interface/web/>
-		Options FollowSymLinks
-		AllowOverride None
-	</Directory>
-	
-	ErrorLog /var/log/apache2/error.log
-	CustomLog /var/log/apache2/access.log combined
-    ServerSignature Off
-	
+	AssignUserId ispconfig ispconfig
+    AddType application/x-httpd-php .php
+    <Directory /usr/local/ispconfig/interface/web>
+      # php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share:/tmp"
+      Options +FollowSymLinks
+      AllowOverride None
+      <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
+	  Require all granted
+	  <tmpl_else>
+      Order allow,deny
+      Allow from all
+	  </tmpl_if>
+	  php_value magic_quotes_gpc        0
+    </Directory>
+  </IfModule>
+  
+  # ErrorLog /var/log/apache2/error.log
+  # CustomLog /var/log/apache2/access.log combined
+  ServerSignature Off
+  
+  <IfModule mod_security2.c>
+    SecRuleEngine Off
+  </IfModule>
+
+  # SSL Configuration
+  <tmpl_var name="ssl_comment">SSLEngine On
+  <tmpl_var name="ssl_comment">SSLProtocol All -SSLv2 -SSLv3
+  <tmpl_var name="ssl_comment">SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
+  <tmpl_var name="ssl_comment">SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
+  <tmpl_var name="ssl_bundle_comment">SSLCACertificateFile /usr/local/ispconfig/interface/ssl/ispserver.bundle
+
 </VirtualHost>
 
-###########################################
-# Logfile configuration for vlogger
-###########################################
+<Directory /var/www/php-cgi-scripts>
+    AllowOverride None
+	<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
+	Require all denied
+	<tmpl_else>
+    Order Deny,Allow
+    Deny from all
+	</tmpl_if>
+</Directory>
 
-LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
-CustomLog "| /usr/sbin/vlogger -s access.log /var/log/ispconfig/httpd" combined_ispconfig
-
+<Directory /var/www/php-fcgi-scripts>
+    AllowOverride None
+    <tmpl_if name='apache_version' op='>' value='2.2' format='version'>
+	Require all denied
+	<tmpl_else>
+    Order Deny,Allow
+    Deny from all
+	</tmpl_if>
+</Directory>
 

--
Gitblit v1.9.1