Skip to content

Commit 2b3dfac

Browse files
author
Till Brehm
committed
CentOS 7.2 related fixes in installer and apache vhost template.
1 parent 875504b commit 2b3dfac

File tree

5 files changed

+70
-9
lines changed

5 files changed

+70
-9
lines changed

install/dist/lib/centos72.lib.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2014, Till Brehm, ISPConfig UG
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
require_once realpath(dirname(__FILE__)) . '/centos_base.lib.php';
32+
33+
class installer extends installer_centos {
34+
35+
protected $clamav_socket = '/var/run/clamd.amavisd/clamd.sock';
36+
37+
// everything else is inherited from installer_centos class
38+
}
39+
40+
?>

install/dist/lib/fedora.lib.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ function configure_postfix($options = '')
8989

9090
//* mysql-virtual_relayrecipientmaps.cf
9191
$this->process_postfix_config('mysql-virtual_relayrecipientmaps.cf');
92+
93+
//* mysql-virtual_outgoing_bcc.cf
94+
$this->process_postfix_config('mysql-virtual_outgoing_bcc.cf');
9295

9396
//* mysql-virtual_policy_greylist.cf
9497
$this->process_postfix_config('mysql-virtual_policy_greylist.cf');
@@ -179,6 +182,7 @@ function configure_postfix($options = '')
179182
//if(!is_file('/var/lib/mailman/data/aliases')) touch('/var/lib/mailman/data/aliases');
180183
if(is_file('/var/lib/mailman/data/aliases')) unlink('/var/lib/mailman/data/aliases');
181184
if(!is_link('/var/lib/mailman/data/aliases')) symlink('/etc/mailman/aliases', '/var/lib/mailman/data/aliases');
185+
if(!is_file('/etc/mailman/aliases')) touch('/etc/mailman/aliases');
182186
exec('postalias /var/lib/mailman/data/aliases');
183187
if(!is_file('/etc/mailman/virtual-mailman')) touch('/etc/mailman/virtual-mailman');
184188
exec('postmap /etc/mailman/virtual-mailman');
@@ -491,6 +495,13 @@ public function configure_amavis() {
491495
$content = str_replace('{hostname}', $conf['hostname'], $content);
492496
wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content);
493497
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640);
498+
499+
// for CentOS 7.2 only
500+
$distname = get_distname();
501+
if($distname['confid'] == 'centos72') {
502+
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0750);
503+
chgrp($conf['amavis']['config_dir'].'/amavisd.conf', 'amavis');
504+
}
494505

495506

496507
// Adding the amavisd commands to the postfix configuration

install/lib/install.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ function get_distname() {
296296
} elseif(stristr($content, 'CentOS Linux release 7.2')) {
297297
$distname = 'CentOS';
298298
$distver = 'Unknown';
299-
$distid = 'centos70';
299+
$distid = 'centos72';
300300
$distconfid = 'centos72';
301301
$distbaseid = 'fedora';
302302
swriteln("Operating System: CentOS 7.2\n");

install/lib/installer_base.lib.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,19 @@ public function find_installed_apps() {
171171
if(is_installed('named') || is_installed('bind') || is_installed('bind9')) $conf['bind']['installed'] = true;
172172
if(is_installed('squid')) $conf['squid']['installed'] = true;
173173
if(is_installed('nginx')) $conf['nginx']['installed'] = true;
174-
if(is_installed('iptables') && is_installed('ufw')) $conf['ufw']['installed'] = true;
175-
if(is_installed('iptables') && is_installed('bastille-netfilter')) $conf['firewall']['installed'] = true;
174+
if(is_installed('iptables') && is_installed('ufw')) {
175+
$conf['ufw']['installed'] = true;
176+
} elseif(is_installed('iptables')) {
177+
$conf['firewall']['installed'] = true;
178+
}
176179
if(is_installed('fail2ban-server')) $conf['fail2ban']['installed'] = true;
177180
if(is_installed('vzctl')) $conf['openvz']['installed'] = true;
178181
if(is_installed('metronome') && is_installed('metronomectl')) $conf['xmpp']['installed'] = true;
179182
if(is_installed('spamassassin')) $conf['spamassassin']['installed'] = true;
180-
if(is_installed('vlogger')) $conf['vlogger']['installed'] = true;
181-
if(is_installed('cron')) $conf['cron']['installed'] = true;
183+
// if(is_installed('vlogger')) $conf['vlogger']['installed'] = true;
184+
// ISPConfig ships with vlogger, so it is always installed.
185+
$conf['vlogger']['installed'] = true;
186+
if(is_installed('cron') || is_installed('anacron')) $conf['cron']['installed'] = true;
182187

183188
if ($conf['services']['web'] && (($conf['apache']['installed'] && is_file($conf['apache']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost")) || ($conf['nginx']['installed'] && is_file($conf['nginx']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost")))) $this->ispconfig_interface_installed = true;
184189
}

server/conf/vhost.conf.master

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,15 +350,20 @@
350350
Action php5-fcgi /php5-fcgi virtual
351351
Alias /php5-fcgi {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'}
352352
<tmpl_if name='use_tcp'>
353-
FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -host 127.0.0.1:<tmpl_var name='fpm_port'> -pass-header Authorization
354-
<IfModule mod_proxy_fcgi.c>
355-
ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ fcgi://127.0.0.1:<tmpl_var name='fpm_port'><tmpl_var name='web_document_root'>/$1
356-
</IfModule>
353+
FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -host 127.0.0.1:<tmpl_var name='fpm_port'> -pass-header Authorization
357354
</tmpl_if>
358355
<tmpl_if name='use_socket'>
359356
FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket <tmpl_var name='fpm_socket'> -pass-header Authorization
360357
</tmpl_if>
361358
</IfModule>
359+
<IfModule mod_proxy_fcgi.c>
360+
<tmpl_if name='use_tcp'>
361+
ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ fcgi://127.0.0.1:<tmpl_var name='fpm_port'><tmpl_var name='web_document_root'>/$1
362+
</tmpl_if>
363+
<tmpl_if name='use_socket'>
364+
ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix://<tmpl_var name='fpm_socket'>|fcgi://localhost/<tmpl_var name='web_document_root'>/$1
365+
</tmpl_if>
366+
</IfModule>
362367
</tmpl_if>
363368

364369
<tmpl_if name='php' op='==' value='hhvm'>

0 commit comments

Comments
 (0)