Skip to content

Commit 196513e

Browse files
author
thom
committed
Only use NameVirtualHost for Apache 2.2 (#4230)
1 parent 39e6974 commit 196513e

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

install/dist/tpl/gentoo/apache_ispconfig.vhost.master

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
######################################################
66

77
{vhost_port_listen} Listen {vhost_port}
8-
NameVirtualHost *:{vhost_port}
8+
<tmpl_if name='apache_version' op='<' value='2.4' format='version'>
9+
NameVirtualHost *:{vhost_port}
10+
</tmpl_if>
911

1012
<VirtualHost _default_:{vhost_port}>
1113
ServerAdmin webmaster@localhost
12-
14+
1315
<IfModule mod_fcgid.c>
1416
DocumentRoot /var/www/ispconfig/
1517
SuexecUserGroup ispconfig ispconfig
@@ -25,7 +27,7 @@ NameVirtualHost *:{vhost_port}
2527
</Directory>
2628
DirectoryIndex index.php
2729
</IfModule>
28-
30+
2931
<IfModule mod_php5.c>
3032
DocumentRoot /usr/local/ispconfig/interface/web/
3133
AddType application/x-httpd-php .php
@@ -37,11 +39,11 @@ NameVirtualHost *:{vhost_port}
3739
php_value magic_quotes_gpc 0
3840
</Directory>
3941
</IfModule>
40-
42+
4143
# ErrorLog /var/log/apache2/error.log
4244
# CustomLog /var/log/apache2/access.log combined
4345
ServerSignature Off
44-
46+
4547
<IfModule mod_security2.c>
4648
SecRuleEngine Off
4749
</IfModule>
@@ -64,4 +66,3 @@ NameVirtualHost *:{vhost_port}
6466
Order Deny,Allow
6567
Deny from all
6668
</Directory>
67-

install/tpl/apache_ispconfig.conf.master

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,13 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m
132132

133133
Alias /awstats-icon "/usr/share/awstats/icon"
134134

135-
NameVirtualHost *:80
136-
NameVirtualHost *:443
137-
<tmpl_loop name="ip_adresses">
138-
NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"}
139-
</tmpl_loop>
135+
<tmpl_if name='apache_version' op='<' value='2.4' format='version'>
136+
NameVirtualHost *:80
137+
NameVirtualHost *:443
138+
<tmpl_loop name="ip_adresses">
139+
NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"}
140+
</tmpl_loop>
141+
</tmpl_if>
140142

141143
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
142144
<IfModule mod_ssl.c>

server/conf/apache_ispconfig.conf.master

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
################################################
2+
# ISPConfig General Apache Options
3+
################################################
4+
ServerTokens ProductOnly
5+
ServerSignature Off
16

27
################################################
38
# ISPConfig Logfile configuration for vlogger
@@ -127,11 +132,13 @@ CustomLog "| /usr/local/ispconfig/server/scripts/vlogger -s access.log -t \"%Y%m
127132

128133
Alias /awstats-icon "/usr/share/awstats/icon"
129134

130-
NameVirtualHost *:80
131-
NameVirtualHost *:443
132-
<tmpl_loop name="ip_adresses">
133-
NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"}
134-
</tmpl_loop>
135+
<tmpl_if name='apache_version' op='<' value='2.4' format='version'>
136+
NameVirtualHost *:80
137+
NameVirtualHost *:443
138+
<tmpl_loop name="ip_adresses">
139+
NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"}
140+
</tmpl_loop>
141+
</tmpl_if>
135142

136143
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
137144
<IfModule mod_ssl.c>

0 commit comments

Comments
 (0)