From 196513e58879d140123132ae42c7c05575bb9ce7 Mon Sep 17 00:00:00 2001 From: thom <thom@amsterdamtech.nl> Date: Fri, 25 Sep 2020 21:25:04 +0200 Subject: [PATCH] Only use NameVirtualHost for Apache 2.2 (#4230) --- .../tpl/gentoo/apache_ispconfig.vhost.master | 13 +++++++------ install/tpl/apache_ispconfig.conf.master | 12 +++++++----- server/conf/apache_ispconfig.conf.master | 17 ++++++++++++----- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/install/dist/tpl/gentoo/apache_ispconfig.vhost.master b/install/dist/tpl/gentoo/apache_ispconfig.vhost.master index f4f08d2bb6..20e7b3b684 100644 --- a/install/dist/tpl/gentoo/apache_ispconfig.vhost.master +++ b/install/dist/tpl/gentoo/apache_ispconfig.vhost.master @@ -5,11 +5,13 @@ ###################################################### {vhost_port_listen} Listen {vhost_port} -NameVirtualHost *:{vhost_port} +<tmpl_if name='apache_version' op='<' value='2.4' format='version'> + NameVirtualHost *:{vhost_port} +</tmpl_if> <VirtualHost _default_:{vhost_port}> ServerAdmin webmaster@localhost - + <IfModule mod_fcgid.c> DocumentRoot /var/www/ispconfig/ SuexecUserGroup ispconfig ispconfig @@ -25,7 +27,7 @@ NameVirtualHost *:{vhost_port} </Directory> DirectoryIndex index.php </IfModule> - + <IfModule mod_php5.c> DocumentRoot /usr/local/ispconfig/interface/web/ AddType application/x-httpd-php .php @@ -37,11 +39,11 @@ NameVirtualHost *:{vhost_port} 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> @@ -64,4 +66,3 @@ NameVirtualHost *:{vhost_port} Order Deny,Allow Deny from all </Directory> - diff --git a/install/tpl/apache_ispconfig.conf.master b/install/tpl/apache_ispconfig.conf.master index 7d57e00517..b1de2a1676 100644 --- a/install/tpl/apache_ispconfig.conf.master +++ b/install/tpl/apache_ispconfig.conf.master @@ -132,11 +132,13 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m Alias /awstats-icon "/usr/share/awstats/icon" -NameVirtualHost *:80 -NameVirtualHost *:443 -<tmpl_loop name="ip_adresses"> -NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"} -</tmpl_loop> +<tmpl_if name='apache_version' op='<' value='2.4' format='version'> + NameVirtualHost *:80 + NameVirtualHost *:443 + <tmpl_loop name="ip_adresses"> + NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"} + </tmpl_loop> +</tmpl_if> <tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'> <IfModule mod_ssl.c> diff --git a/server/conf/apache_ispconfig.conf.master b/server/conf/apache_ispconfig.conf.master index 831a18a0e1..b1de2a1676 100644 --- a/server/conf/apache_ispconfig.conf.master +++ b/server/conf/apache_ispconfig.conf.master @@ -1,3 +1,8 @@ +################################################ +# ISPConfig General Apache Options +################################################ +ServerTokens ProductOnly +ServerSignature Off ################################################ # ISPConfig Logfile configuration for vlogger @@ -127,11 +132,13 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m Alias /awstats-icon "/usr/share/awstats/icon" -NameVirtualHost *:80 -NameVirtualHost *:443 -<tmpl_loop name="ip_adresses"> -NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"} -</tmpl_loop> +<tmpl_if name='apache_version' op='<' value='2.4' format='version'> + NameVirtualHost *:80 + NameVirtualHost *:443 + <tmpl_loop name="ip_adresses"> + NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"} + </tmpl_loop> +</tmpl_if> <tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'> <IfModule mod_ssl.c> -- GitLab