Skip to content

Commit 8eef477

Browse files
author
Till Brehm
committed
Merge branch '5719-apps-vhost' into 'stable-3.1'
Fix #5719 Closes #5719 See merge request ispconfig/ispconfig3!1125
2 parents 04cb4d7 + 2747ab0 commit 8eef477

File tree

5 files changed

+45
-44
lines changed

5 files changed

+45
-44
lines changed

install/tpl/apache_apps.vhost.master

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@
5858
<tmpl_var name="ssl_comment">SSLStaplingReturnResponderErrors Off
5959
</tmpl_if>
6060

61-
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
62-
<IfModule mod_ssl.c>
63-
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
64-
</IfModule>
65-
</tmpl_if>
66-
6761
<IfModule mod_headers.c>
6862
RequestHeader unset Proxy early
6963
</IfModule>
@@ -127,6 +121,4 @@
127121
RewriteRule ^/rspamd/(.*) http://127.0.0.1:11334/$1 [P]
128122
{/tmpl_if}
129123

130-
131-
132124
</VirtualHost>

install/tpl/apache_ispconfig.conf.master

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,28 @@ NameVirtualHost *:443
146146
NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"}
147147
</tmpl_loop>
148148

149+
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
150+
<IfModule mod_ssl.c>
151+
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
152+
</IfModule>
153+
</tmpl_if>
154+
155+
<Directory /var/www/php-cgi-scripts>
156+
AllowOverride None
157+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
158+
Require all denied
159+
<tmpl_else>
160+
Order Deny,Allow
161+
Deny from all
162+
</tmpl_if>
163+
</Directory>
164+
165+
<Directory /var/www/php-fcgi-scripts>
166+
AllowOverride None
167+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
168+
Require all denied
169+
<tmpl_else>
170+
Order Deny,Allow
171+
Deny from all
172+
</tmpl_if>
173+
</Directory>

install/tpl/apache_ispconfig.vhost.master

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -111,29 +111,3 @@ NameVirtualHost *:<tmpl_var name="vhost_port">
111111
<tmpl_var name="ssl_comment">SSLStaplingReturnResponderErrors Off
112112
</tmpl_if>
113113
</VirtualHost>
114-
115-
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
116-
<IfModule mod_ssl.c>
117-
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
118-
</IfModule>
119-
</tmpl_if>
120-
121-
<Directory /var/www/php-cgi-scripts>
122-
AllowOverride None
123-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
124-
Require all denied
125-
<tmpl_else>
126-
Order Deny,Allow
127-
Deny from all
128-
</tmpl_if>
129-
</Directory>
130-
131-
<Directory /var/www/php-fcgi-scripts>
132-
AllowOverride None
133-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
134-
Require all denied
135-
<tmpl_else>
136-
Order Deny,Allow
137-
Deny from all
138-
</tmpl_if>
139-
</Directory>

server/conf/apache_apps.vhost.master

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@
5858
<tmpl_var name="ssl_comment">SSLStaplingReturnResponderErrors Off
5959
</tmpl_if>
6060

61-
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
62-
<IfModule mod_ssl.c>
63-
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
64-
</IfModule>
65-
</tmpl_if>
66-
6761
<IfModule mod_headers.c>
6862
RequestHeader unset Proxy early
6963
</IfModule>
@@ -127,6 +121,10 @@
127121
RewriteRule ^/rspamd/(.*) http://127.0.0.1:11334/$1 [P]
128122
{/tmpl_if}
129123

130-
131-
132124
</VirtualHost>
125+
126+
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
127+
<IfModule mod_ssl.c>
128+
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
129+
</IfModule>
130+
</tmpl_if>

server/plugins-available/apps_vhost_plugin.inc.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,19 @@ function update($event_name, $data) {
106106
$vhost_port_listen = '#';
107107
}
108108
$tpl->setVar('vhost_port_listen', $vhost_port_listen);
109-
109+
110+
/* Check if SSL should be enabled: */
111+
if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) {
112+
$tpl->setVar('ssl_comment','');
113+
} else {
114+
$tpl->setVar('ssl_comment','#');
115+
}
116+
if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.bundle')) {
117+
$tpl->setVar('ssl_bundle_comment','');
118+
} else {
119+
$tpl->setVar('ssl_bundle_comment','#');
120+
}
121+
110122
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
111123
if($mail_config['content_filter'] == 'rspamd'){
112124
$use_rspamd = true;
@@ -194,7 +206,7 @@ function update($event_name, $data) {
194206
}
195207
$content = str_replace('{use_tcp}', $use_tcp, $content);
196208
$content = str_replace('{use_socket}', $use_socket, $content);
197-
209+
198210
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
199211
if($mail_config['content_filter'] == 'rspamd'){
200212
$use_rspamd = '';

0 commit comments

Comments
 (0)