Skip to content

Commit ff1d9a7

Browse files
author
wyrie
committed
Installer: Gentoo updates
• Added configure_dovecot function • Updated functions configure_postfix, configure_pureftpd, configure_apache, install_ispconfig, configure_apps_vhost • Bug fix in configure_amavis where installer was not including the ispconfig config file • Bug fix in configure_apache where in suphp.conf the php handler line would be duplicated through updates • replace double-quoted strings with single-quoted whenever appropriate • changed inline comments to coding standards • fixed OS specific paths • changes to installer_base 1) add_database_server_record added os specific override of awstats paths 2) find_installed_apps courier not detecting correctly for gentoo
1 parent 9539ceb commit ff1d9a7

File tree

8 files changed

+459
-149
lines changed

8 files changed

+459
-149
lines changed

install/dist/conf/gentoo.conf.php

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@
8888
$conf['apache']['vhost_conf_enabled_dir'] = $conf['apache']['vhost_conf_dir'];
8989
$conf['apache']['vhost_default'] = '00_default_vhost.conf';
9090
$conf['apache']['vhost_port'] = '8080';
91-
$conf['apache']['php_ini_path_apache'] = '/etc/php5/apache2/php.ini';
92-
$conf['apache']['php_ini_path_cgi'] = '/etc/php5/cgi/php.ini';
91+
$conf['apache']['php_ini_path_apache'] = '/etc/php/apache2-php5/php.ini';
92+
$conf['apache']['php_ini_path_cgi'] = '/etc/php/cgi-php5/php.ini';
9393

9494
//* Website base settings
9595
$conf['web']['website_basedir'] = '/var/www';
@@ -103,24 +103,14 @@
103103
$conf['web']['apps_vhost_user'] = 'ispapps';
104104
$conf['web']['apps_vhost_group'] = 'ispapps';
105105

106-
//* Fastcgi
107-
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php/cgi-php5';
108-
//TODO do fastcgi setup
109-
$conf['fastcgi']['fastcgi_starter_path'] = '/var/www/php-fcgi-scripts/[system_user]/';
110-
//* Website base settings
111-
$conf['web']['website_basedir'] = '/var/www';
112-
$conf['web']['website_path'] = '/var/www/clients/client[client_id]/web[website_id]';
113-
$conf['web']['website_symlinks'] = '/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/';
114-
115-
//* Apps base settings
116-
$conf['web']['apps_vhost_ip'] = '_default_';
117-
$conf['web']['apps_vhost_port'] = '8081';
118-
$conf['web']['apps_vhost_servername'] = '';
119-
$conf['web']['apps_vhost_user'] = 'ispapps';
120-
$conf['web']['apps_vhost_group'] = 'ispapps';
106+
//* Awstats settings
107+
$conf['awstats']['conf_dir'] = '/etc/awstats';
108+
$conf['awstats']['data_dir'] = '/var/lib/awstats';
109+
$conf['awstats']['pl'] = '/usr/bin/awstats.pl';
110+
$conf['awstats']['buildstaticpages_pl'] = '/usr/bin/awstats_buildstaticpages.pl';
121111

122112
//* Fastcgi
123-
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php5/cgi/';
113+
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php/cgi-php5';
124114
$conf['fastcgi']['fastcgi_starter_path'] = '/var/www/php-fcgi-scripts/[system_user]/';
125115

126116
//* Postfix
@@ -191,7 +181,7 @@
191181
//* BIND DNS Server
192182
$conf['bind']['installed'] = false; // will be detected automatically during installation
193183
$conf['bind']['bind_user'] = 'root';
194-
$conf['bind']['bind_group'] = 'bind';
184+
$conf['bind']['bind_group'] = 'named';
195185
$conf['bind']['bind_zonefiles_dir'] = '/etc/bind';
196186
$conf['bind']['named_conf_path'] = '/etc/bind/named.conf';
197187
$conf['bind']['named_conf_local_path'] = '/etc/bind/named.conf.local';

install/dist/lib/gentoo.lib.php

Lines changed: 223 additions & 129 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
######################################################
3+
# This virtual host contains the configuration
4+
# for the ISPConfig apps vhost
5+
######################################################
6+
7+
{vhost_port_listen} Listen {apps_vhost_port}
8+
# NameVirtualHost *:{apps_vhost_port}
9+
10+
<VirtualHost {apps_vhost_ip}:{apps_vhost_port}>
11+
ServerAdmin webmaster@localhost
12+
{apps_vhost_servername}
13+
14+
<IfModule mod_fcgid.c>
15+
DocumentRoot {apps_vhost_dir}
16+
SuexecUserGroup ispapps ispapps
17+
<Directory {apps_vhost_dir}>
18+
Options Indexes FollowSymLinks MultiViews +ExecCGI
19+
AllowOverride AuthConfig Indexes Limit Options FileInfo
20+
<FilesMatch "\.ph(p[3-5]?|tml)$">
21+
SetHandler fcgid-script
22+
</FilesMatch>
23+
FCGIWrapper {website_basedir}/php-fcgi-scripts/apps/.php-fcgi-starter .php
24+
Order allow,deny
25+
Allow from all
26+
</Directory>
27+
DirectoryIndex index.php
28+
</IfModule>
29+
30+
<IfModule mod_php5.c>
31+
DocumentRoot {apps_vhost_dir}
32+
AddType application/x-httpd-php .php
33+
<Directory {apps_vhost_dir}>
34+
Options FollowSymLinks
35+
AllowOverride None
36+
Order allow,deny
37+
Allow from all
38+
</Directory>
39+
</IfModule>
40+
41+
ServerSignature Off
42+
43+
</VirtualHost>
44+
45+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
PHPRC=/etc/php/cgi-php5/
3+
export PHPRC
4+
export PHP_FCGI_MAX_REQUESTS=5000
5+
export PHP_FCGI_CHILDREN=1
6+
exec /usr/bin/php-cgi -d magic_quotes_gpc=off
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
######################################################
3+
# This virtual host contains the configuration
4+
# for the ISPConfig controlpanel
5+
######################################################
6+
7+
{vhost_port_listen} Listen {vhost_port}
8+
NameVirtualHost *:{vhost_port}
9+
10+
<VirtualHost _default_:{vhost_port}>
11+
ServerAdmin webmaster@localhost
12+
13+
<IfModule mod_fcgid.c>
14+
DocumentRoot /var/www/ispconfig/
15+
SuexecUserGroup ispconfig ispconfig
16+
<Directory /var/www/ispconfig/>
17+
Options Indexes FollowSymLinks MultiViews +ExecCGI
18+
AllowOverride AuthConfig Indexes Limit Options FileInfo
19+
<FilesMatch "\.ph(p[3-5]?|tml)$">
20+
SetHandler fcgid-script
21+
</FilesMatch>
22+
FCGIWrapper /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter .php
23+
Order allow,deny
24+
Allow from all
25+
</Directory>
26+
DirectoryIndex index.php
27+
</IfModule>
28+
29+
<IfModule mod_php5.c>
30+
DocumentRoot /usr/local/ispconfig/interface/web/
31+
AddType application/x-httpd-php .php
32+
<Directory /usr/local/ispconfig/interface/web>
33+
Options FollowSymLinks
34+
AllowOverride None
35+
Order allow,deny
36+
Allow from all
37+
php_value magic_quotes_gpc 0
38+
</Directory>
39+
</IfModule>
40+
41+
# ErrorLog /var/log/apache2/error.log
42+
# CustomLog /var/log/apache2/access.log combined
43+
ServerSignature Off
44+
45+
<IfModule mod_security2.c>
46+
SecRuleEngine Off
47+
</IfModule>
48+
49+
# SSL Configuration
50+
{ssl_comment}SSLEngine On
51+
{ssl_comment}SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
52+
{ssl_comment}SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
53+
54+
</VirtualHost>
55+
56+
<Directory /var/www/php-cgi-scripts>
57+
AllowOverride None
58+
Order Deny,Allow
59+
Deny from all
60+
</Directory>
61+
62+
<Directory /var/www/php-fcgi-scripts>
63+
AllowOverride None
64+
Order Deny,Allow
65+
Deny from all
66+
</Directory>
67+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
PHPRC=/etc/php/cgi-php5/
3+
export PHPRC
4+
export PHP_FCGI_MAX_REQUESTS=5000
5+
export PHP_FCGI_CHILDREN=1
6+
exec /usr/bin/php-cgi -d magic_quotes_gpc=off -d session.save_path=/usr/local/ispconfig/server/temp
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
protocols = imap imaps pop3 pop3s
2+
disable_plaintext_auth = no
3+
log_timestamp = "%Y-%m-%d %H:%M:%S "
4+
mail_privileged_group = mail
5+
6+
ssl_cert_file = /etc/ssl/dovecot/server.crt
7+
ssl_key_file = /etc/ssl/dovecot/server.key
8+
9+
##
10+
## IMAP specific settings
11+
##
12+
13+
protocol imap {
14+
login_executable = /usr/libexec/dovecot/imap-login
15+
mail_executable = /usr/libexec/dovecot/imap
16+
mail_plugins = quota imap_quota
17+
mail_plugin_dir = /usr/lib/dovecot/imap
18+
}
19+
20+
##
21+
## POP3 specific settings
22+
##
23+
24+
protocol pop3 {
25+
login_executable = /usr/libexec/dovecot/pop3-login
26+
mail_executable = /usr/libexec/dovecot/pop3
27+
pop3_uidl_format = %08Xu%08Xv
28+
mail_plugins = quota
29+
mail_plugin_dir = /usr/lib/dovecot/pop3
30+
}
31+
32+
##
33+
## LDA specific settings
34+
##
35+
36+
protocol lda {
37+
postmaster_address = postmaster@example.com
38+
mail_plugin_dir = /usr/lib/dovecot/lda
39+
auth_socket_path = /var/run/dovecot/auth-master
40+
mail_plugins = sieve quota
41+
}
42+
43+
## Plugin settings
44+
plugin {
45+
quota = maildir
46+
sieve=/var/vmail/%d/%n/.sieve
47+
}
48+
49+
##
50+
## Authentication processes
51+
##
52+
53+
auth default {
54+
mechanisms = plain login
55+
passdb pam {
56+
args = "*"
57+
}
58+
59+
# SQL database <doc/wiki/AuthDatabase.SQL.txt>
60+
passdb sql {
61+
# Path for SQL configuration file
62+
args = /etc/dovecot/dovecot-sql.conf
63+
}
64+
65+
# new quota support:
66+
userdb prefetch {
67+
}
68+
69+
userdb sql {
70+
args = /etc/dovecot/dovecot-sql.conf
71+
}
72+
73+
74+
## dovecot-lda specific settings
75+
##
76+
socket listen {
77+
master {
78+
path = /var/run/dovecot/auth-master
79+
mode = 0600
80+
user = vmail # User running Dovecot LDA
81+
#group = vmail # Or alternatively mode 0660 + LDA user in this group
82+
}
83+
client {
84+
path = /var/spool/postfix/private/auth
85+
mode = 0660
86+
user = postfix
87+
group = postfix
88+
}
89+
}
90+
91+
}
92+
93+
mail_location = maildir:/var/vmail/%d/%n/Maildir
94+
95+
mail_uid = 5000
96+
mail_gid = 5000

install/lib/installer_base.lib.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function find_installed_apps() {
115115
if(is_installed('postfix')) $conf['postfix']['installed'] = true;
116116
if(is_installed('apache') || is_installed('apache2') || is_installed('httpd')) $conf['apache']['installed'] = true;
117117
if(is_installed('getmail')) $conf['getmail']['installed'] = true;
118-
if(is_installed('couriertcpd')) $conf['courier']['installed'] = true;
118+
if(is_installed('courierlogger')) $conf['courier']['installed'] = true;
119119
if(is_installed('dovecot')) $conf['dovecot']['installed'] = true;
120120
if(is_installed('saslsauthd')) $conf['saslauthd']['installed'] = true;
121121
if(is_installed('amavisd-new')) $conf['amavis']['installed'] = true;
@@ -221,6 +221,12 @@ public function add_database_server_record() {
221221
$tpl_ini_array['dns']['bind_zonefiles_dir'] = $conf['bind']['bind_zonefiles_dir'];
222222
$tpl_ini_array['dns']['named_conf_path'] = $conf['bind']['named_conf_path'];
223223
$tpl_ini_array['dns']['named_conf_local_path'] = $conf['bind']['named_conf_local_path'];
224+
225+
if (array_key_exists('awstats', $conf)) {
226+
foreach ($conf['awstats'] as $aw_sett => $aw_value) {
227+
$tpl_ini_array['web']['awstats_'.$aw_sett] = $aw_value;
228+
}
229+
}
224230

225231
$server_ini_content = array_to_ini($tpl_ini_array);
226232
$server_ini_content = mysql_real_escape_string($server_ini_content);

0 commit comments

Comments
 (0)