Skip to content

Commit 0a1f027

Browse files
committed
- Detect installed services
- Update server.ini during install - Changed default vmail directory form /home/vmail to /var/vmail
1 parent 4edde67 commit 0a1f027

File tree

10 files changed

+144
-11
lines changed

10 files changed

+144
-11
lines changed

install/dist/conf/centos52.conf.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@
4444
$conf['cron_tab'] = '/var/spool/cron/root';
4545
$conf['pam'] = '/etc/pam.d';
4646

47+
//* Services provided by this server, this selection will be overridden by the expert mode
48+
$conf['services']['mail'] = true;
49+
$conf['services']['web'] = true;
50+
$conf['services']['dns'] = true;
51+
$conf['services']['file'] = true;
52+
$conf['services']['db'] = true;
53+
$conf['services']['vserver'] = true;
54+
4755
//* MySQL
56+
$conf['mysql']['installed'] = false; // will be detected automatically during installation
4857
$conf['mysql']['init_script'] = 'mysqld';
4958
$conf['mysql']['host'] = 'localhost';
5059
$conf['mysql']['ip'] = '127.0.0.1';
@@ -64,6 +73,7 @@
6473
$conf['mysql']['master_ispconfig_password'] = md5 (uniqid (rand()));
6574

6675
//* Apache
76+
$conf['apache']['installed'] = false; // will be detected automatically during installation
6777
$conf['apache']['user'] = 'apache';
6878
$conf['apache']['group'] = 'apache';
6979
$conf['apache']['init_script'] = 'httpd';
@@ -73,6 +83,7 @@
7383
$conf['apache']['vhost_port'] = '8080';
7484

7585
//* Postfix
86+
$conf['postfix']['installed'] = false; // will be detected automatically during installation
7687
$conf['postfix']['config_dir'] = '/etc/postfix';
7788
$conf['postfix']['init_script'] = 'postfix';
7889
$conf['postfix']['user'] = 'postfix';
@@ -81,13 +92,15 @@
8192
$conf['postfix']['vmail_username'] = 'vmail';
8293
$conf['postfix']['vmail_groupid'] = '5000';
8394
$conf['postfix']['vmail_groupname'] = 'vmail';
84-
$conf['postfix']['vmail_mailbox_base'] = '/home/vmail';
95+
$conf['postfix']['vmail_mailbox_base'] = '/var/vmail';
8596

8697
//* Getmail
98+
$conf['getmail']['installed'] = false; // will be detected automatically during installation
8799
$conf['getmail']['config_dir'] = '/etc/getmail';
88100
$conf['getmail']['program'] = '/usr/bin/getmail';
89101

90102
//* Courier
103+
$conf['courier']['installed'] = false; // will be detected automatically during installation
91104
$conf['courier']['config_dir'] = '/etc/authlib';
92105
$conf['courier']['courier-authdaemon'] = 'courier-authlib';
93106
$conf['courier']['courier-imap'] = 'courier-imap';
@@ -96,25 +109,31 @@
96109
$conf['courier']['courier-pop-ssl'] = '';
97110

98111
//* SASL
112+
$conf['saslauthd']['installed'] = false; // will be detected automatically during installation
99113
$conf['saslauthd']['config'] = '/etc/sysconfig/saslauthd';
100114
$conf['saslauthd']['init_script'] = 'saslauthd';
101115

102116
//* Amavisd
117+
$conf['amavis']['installed'] = false; // will be detected automatically during installation
103118
$conf['amavis']['config_dir'] = '/etc/amavisd';
104119
$conf['amavis']['init_script'] = 'amavisd';
105120

106121
//* ClamAV
122+
$conf['clamav']['installed'] = false; // will be detected automatically during installation
107123
$conf['clamav']['init_script'] = 'clamd';
108124

109125
//* Pureftpd
126+
$conf['pureftpd']['installed'] = false; // will be detected automatically during installation
110127
$conf['pureftpd']['config_dir'] = '/etc/pure-ftpd';
111128
$conf['pureftpd']['init_script'] = 'pure-ftpd';
112129

113130
//* MyDNS
131+
$conf['mydns']['installed'] = false; // will be detected automatically during installation
114132
$conf['mydns']['config_dir'] = '/etc';
115133
$conf['mydns']['init_script'] = 'mydns';
116134

117135
//* Jailkit
136+
$conf['jailkit']['installed'] = false; // will be detected automatically during installation
118137
$conf['jailkit']['config_dir'] = '/etc/jailkit';
119138
$conf['jailkit']['jk_init'] = 'jk_init.ini';
120139
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';

install/dist/conf/debian40.conf.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@
4444
$conf['cron_tab'] = '/var/spool/cron/crontabs/root';
4545
$conf['pam'] = '/etc/pam.d';
4646

47+
//* Services provided by this server, this selection will be overridden by the expert mode
48+
$conf['services']['mail'] = true;
49+
$conf['services']['web'] = true;
50+
$conf['services']['dns'] = true;
51+
$conf['services']['file'] = true;
52+
$conf['services']['db'] = true;
53+
$conf['services']['vserver'] = true;
54+
4755
//* MySQL
56+
$conf['mysql']['installed'] = false; // will be detected automatically during installation
4857
$conf['mysql']['init_script'] = 'mysql';
4958
$conf['mysql']['host'] = 'localhost';
5059
$conf['mysql']['ip'] = '127.0.0.1';
@@ -64,6 +73,7 @@
6473
$conf['mysql']['master_ispconfig_password'] = md5 (uniqid (rand()));
6574

6675
//* Apache
76+
$conf['apache']['installed'] = false; // will be detected automatically during installation
6777
$conf['apache']['user'] = 'www-data';
6878
$conf['apache']['group'] = 'www-data';
6979
$conf['apache']['init_script'] = 'apache2';
@@ -73,6 +83,7 @@
7383
$conf['apache']['vhost_port'] = '8080';
7484

7585
//* Postfix
86+
$conf['postfix']['installed'] = false; // will be detected automatically during installation
7687
$conf['postfix']['config_dir'] = '/etc/postfix';
7788
$conf['postfix']['init_script'] = 'postfix';
7889
$conf['postfix']['user'] = 'postfix';
@@ -84,10 +95,12 @@
8495
$conf['postfix']['vmail_mailbox_base'] = '/home/vmail';
8596

8697
//* Getmail
98+
$conf['getmail']['installed'] = false; // will be detected automatically during installation
8799
$conf['getmail']['config_dir'] = '/etc/getmail';
88100
$conf['getmail']['program'] = '/usr/bin/getmail';
89101

90102
//* Courier
103+
$conf['courier']['installed'] = false; // will be detected automatically during installation
91104
$conf['courier']['config_dir'] = '/etc/courier';
92105
$conf['courier']['courier-authdaemon'] = 'courier-authdaemon';
93106
$conf['courier']['courier-imap'] = 'courier-imap';
@@ -96,25 +109,31 @@
96109
$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl';
97110

98111
//* SASL
112+
$conf['saslauthd']['installed'] = false; // will be detected automatically during installation
99113
$conf['saslauthd']['config'] = '/etc/default/saslauthd';
100114
$conf['saslauthd']['init_script'] = 'saslauthd';
101115

102116
//* Amavisd
117+
$conf['amavis']['installed'] = false; // will be detected automatically during installation
103118
$conf['amavis']['config_dir'] = '/etc/amavis';
104119
$conf['amavis']['init_script'] = 'amavis';
105120

106121
//* ClamAV
122+
$conf['clamav']['installed'] = false; // will be detected automatically during installation
107123
$conf['clamav']['init_script'] = 'clamav-daemon';
108124

109125
//* Pureftpd
126+
$conf['pureftpd']['installed'] = false; // will be detected automatically during installation
110127
$conf['pureftpd']['config_dir'] = '/etc/pure-ftpd';
111128
$conf['pureftpd']['init_script'] = 'pure-ftpd-mysql';
112129

113130
//* MyDNS
131+
$conf['mydns']['installed'] = false; // will be detected automatically during installation
114132
$conf['mydns']['config_dir'] = '/etc';
115133
$conf['mydns']['init_script'] = 'mydns';
116134

117135
//* Jailkit
136+
$conf['jailkit']['installed'] = false; // will be detected automatically during installation
118137
$conf['jailkit']['config_dir'] = '/etc/jailkit';
119138
$conf['jailkit']['jk_init'] = 'jk_init.ini';
120139
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';

install/dist/conf/fedora9.conf.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@
4444
$conf['cron_tab'] = '/var/spool/cron/root';
4545
$conf['pam'] = '/etc/pam.d';
4646

47+
//* Services provided by this server, this selection will be overridden by the expert mode
48+
$conf['services']['mail'] = true;
49+
$conf['services']['web'] = true;
50+
$conf['services']['dns'] = true;
51+
$conf['services']['file'] = true;
52+
$conf['services']['db'] = true;
53+
$conf['services']['vserver'] = true;
54+
4755
//* MySQL
56+
$conf['mysql']['installed'] = false; // will be detected automatically during installation
4857
$conf['mysql']['init_script'] = 'mysqld';
4958
$conf['mysql']['host'] = 'localhost';
5059
$conf['mysql']['ip'] = '127.0.0.1';
@@ -64,6 +73,7 @@
6473
$conf['mysql']['master_ispconfig_password'] = md5 (uniqid (rand()));
6574

6675
//* Apache
76+
$conf['apache']['installed'] = false; // will be detected automatically during installation
6777
$conf['apache']['user'] = 'apache';
6878
$conf['apache']['group'] = 'apache';
6979
$conf['apache']['init_script'] = 'httpd';
@@ -73,6 +83,7 @@
7383
$conf['apache']['vhost_port'] = '8080';
7484

7585
//* Postfix
86+
$conf['postfix']['installed'] = false; // will be detected automatically during installation
7687
$conf['postfix']['config_dir'] = '/etc/postfix';
7788
$conf['postfix']['init_script'] = 'postfix';
7889
$conf['postfix']['user'] = 'postfix';
@@ -84,10 +95,12 @@
8495
$conf['postfix']['vmail_mailbox_base'] = '/home/vmail';
8596

8697
//* Getmail
98+
$conf['getmail']['installed'] = false; // will be detected automatically during installation
8799
$conf['getmail']['config_dir'] = '/etc/getmail';
88100
$conf['getmail']['program'] = '/usr/bin/getmail';
89101

90102
//* Courier
103+
$conf['courier']['installed'] = false; // will be detected automatically during installation
91104
$conf['courier']['config_dir'] = '/etc/authlib';
92105
$conf['courier']['courier-authdaemon'] = 'courier-authlib';
93106
$conf['courier']['courier-imap'] = 'courier-imap';
@@ -96,25 +109,31 @@
96109
$conf['courier']['courier-pop-ssl'] = 'courier-imap';
97110

98111
//* SASL
112+
$conf['saslauthd']['installed'] = false; // will be detected automatically during installation
99113
$conf['saslauthd']['config'] = '/etc/sysconfig/saslauthd';
100114
$conf['saslauthd']['init_script'] = 'saslauthd';
101115

102116
//* Amavisd
117+
$conf['amavis']['installed'] = false; // will be detected automatically during installation
103118
$conf['amavis']['config_dir'] = '/etc/amavisd';
104119
$conf['amavis']['init_script'] = 'amavisd';
105120

106121
//* ClamAV
122+
$conf['clamav']['installed'] = false; // will be detected automatically during installation
107123
$conf['clamav']['init_script'] = 'clamd.amavisd';
108124

109125
//* Pureftpd
126+
$conf['pureftpd']['installed'] = false; // will be detected automatically during installation
110127
$conf['pureftpd']['config_dir'] = '/etc/pure-ftpd';
111128
$conf['pureftpd']['init_script'] = 'pure-ftpd';
112129

113130
//* MyDNS
131+
$conf['mydns']['installed'] = false; // will be detected automatically during installation
114132
$conf['mydns']['config_dir'] = '/etc';
115133
$conf['mydns']['init_script'] = 'mydns';
116134

117135
//* Jailkit
136+
$conf['jailkit']['installed'] = false; // will be detected automatically during installation
118137
$conf['jailkit']['config_dir'] = '/etc/jailkit';
119138
$conf['jailkit']['jk_init'] = 'jk_init.ini';
120139
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';

install/dist/conf/opensuse110.conf.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@
4444
$conf['cron_tab'] = '/var/spool/cron/tabs/root';
4545
$conf['pam'] = '/etc/pam.d';
4646

47+
//* Services provided by this server, this selection will be overridden by the expert mode
48+
$conf['services']['mail'] = true;
49+
$conf['services']['web'] = true;
50+
$conf['services']['dns'] = true;
51+
$conf['services']['file'] = true;
52+
$conf['services']['db'] = true;
53+
$conf['services']['vserver'] = true;
54+
4755
//* MySQL
56+
$conf['mysql']['installed'] = false; // will be detected automatically during installation
4857
$conf['mysql']['init_script'] = 'mysql';
4958
$conf['mysql']['host'] = 'localhost';
5059
$conf['mysql']['ip'] = '127.0.0.1';
@@ -64,6 +73,7 @@
6473
$conf['mysql']['master_ispconfig_password'] = md5 (uniqid (rand()));
6574

6675
//* Apache
76+
$conf['apache']['installed'] = false; // will be detected automatically during installation
6777
$conf['apache']['user'] = 'wwwrun';
6878
$conf['apache']['group'] = 'www';
6979
$conf['apache']['init_script'] = 'apache2';
@@ -73,6 +83,7 @@
7383
$conf['apache']['vhost_port'] = '8080';
7484

7585
//* Postfix
86+
$conf['postfix']['installed'] = false; // will be detected automatically during installation
7687
$conf['postfix']['config_dir'] = '/etc/postfix';
7788
$conf['postfix']['init_script'] = 'postfix';
7889
$conf['postfix']['user'] = 'postfix';
@@ -84,10 +95,12 @@
8495
$conf['postfix']['vmail_mailbox_base'] = '/home/vmail';
8596

8697
//* Getmail
98+
$conf['getmail']['installed'] = false; // will be detected automatically during installation
8799
$conf['getmail']['config_dir'] = '/etc/getmail';
88100
$conf['getmail']['program'] = '/usr/bin/getmail';
89101

90102
//* Courier
103+
$conf['courier']['installed'] = false; // will be detected automatically during installation
91104
$conf['courier']['config_dir'] = '/etc/authlib';
92105
$conf['courier']['courier-authdaemon'] = 'courier-authdaemon';
93106
$conf['courier']['courier-imap'] = 'courier-imap';
@@ -96,25 +109,31 @@
96109
$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl';
97110

98111
//* SASL
112+
$conf['saslauthd']['installed'] = false; // will be detected automatically during installation
99113
$conf['saslauthd']['config'] = '/etc/default/saslauthd';
100114
$conf['saslauthd']['init_script'] = 'saslauthd';
101115

102116
//* Amavisd
117+
$conf['amavis']['installed'] = false; // will be detected automatically during installation
103118
$conf['amavis']['config_dir'] = '/etc/amavis';
104119
$conf['amavis']['init_script'] = 'amavis';
105120

106121
//* ClamAV
122+
$conf['clamav']['installed'] = false; // will be detected automatically during installation
107123
$conf['clamav']['init_script'] = 'clamd';
108124

109125
//* Pureftpd
126+
$conf['pureftpd']['installed'] = false; // will be detected automatically during installation
110127
$conf['pureftpd']['config_dir'] = '/etc/pure-ftpd';
111128
$conf['pureftpd']['init_script'] = 'pure-ftpd';
112129

113130
//* MyDNS
131+
$conf['mydns']['installed'] = false; // will be detected automatically during installation
114132
$conf['mydns']['config_dir'] = '/etc';
115133
$conf['mydns']['init_script'] = 'mydns';
116134

117135
//* Jailkit
136+
$conf['jailkit']['installed'] = false; // will be detected automatically during installation
118137
$conf['jailkit']['config_dir'] = '/etc/jailkit';
119138
$conf['jailkit']['jk_init'] = 'jk_init.ini';
120139
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';

install/install.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
die('This software can not be installed on a server wich runs ISPConfig 2.x.');
9090
}
9191

92+
//** Detect the installed applications
93+
$inst->find_installed_apps();
94+
9295
//** Select the language
9396
$conf['language'] = $inst->simple_query('Select language', array('en','de'), 'en');
9497

@@ -222,7 +225,14 @@
222225
if($conf['mydns']['init_script'] != '' && is_file($conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null');
223226

224227
}else{
225-
228+
229+
//* In expert mode, we select the services in the following steps, only db is always available
230+
$conf['services']['mail'] = false;
231+
$conf['services']['web'] = false;
232+
$conf['services']['dns'] = false;
233+
$conf['services']['db'] = true;
234+
235+
226236
//** Get Server ID
227237
// $conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1');
228238
// Server ID is an autoInc value of the mysql database now
@@ -275,6 +285,8 @@
275285

276286
if(strtolower($inst->simple_query('Configure Mail', array('y','n') ,'y') ) == 'y') {
277287

288+
$conf['services']['mail'] = true;
289+
278290
//* Configure Postfix
279291
swriteln('Configuring Postfix');
280292
$inst->configure_postfix();
@@ -325,6 +337,7 @@
325337

326338
//** Configure MyDNS
327339
if(strtolower($inst->simple_query('Configure DNS Server',array('y','n'),'y')) == 'y') {
340+
$conf['services']['dns'] = true;
328341
swriteln('Configuring MyDNS');
329342
$inst->configure_mydns();
330343
if($conf['mydns']['init_script'] != '') system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null');
@@ -333,6 +346,7 @@
333346
//** Configure Apache
334347
swriteln("\nHint: If this server shall run the ispconfig interface, select 'y' in the next option.\n");
335348
if(strtolower($inst->simple_query('Configure Apache Server',array('y','n'),'y')) == 'y') {
349+
$conf['services']['web'] = true;
336350
swriteln('Configuring Apache');
337351
$inst->configure_apache();
338352
}

install/lib/install.lib.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,15 @@ function removeLine($filename,$search_pattern,$strict = 0) {
554554
}
555555
}
556556

557+
function is_installed($appname) {
558+
exec('which '.escapeshellcmd($appname),$out);
559+
if(stristr($out[0],$appname)) {
560+
return true;
561+
} else {
562+
return false;
563+
}
564+
}
565+
557566

558567

559568
?>

0 commit comments

Comments
 (0)