Skip to content

Commit dba68fc

Browse files
committed
Bugfixes in installer and apache plugin.
1 parent a7bdf8d commit dba68fc

File tree

4 files changed

+39
-233
lines changed

4 files changed

+39
-233
lines changed

install/lib/installer_base.lib.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,18 @@ public function add_database_server_record() {
233233
$tpl_ini_array['dns']['named_conf_path'] = $conf['bind']['named_conf_path'];
234234
$tpl_ini_array['dns']['named_conf_local_path'] = $conf['bind']['named_conf_local_path'];
235235

236+
$tpl_ini_array['web']['nginx_vhost_conf_dir'] = $conf['nginx']['vhost_conf_dir'];
237+
$tpl_ini_array['web']['nginx_vhost_conf_enabled_dir'] = $conf['nginx']['vhost_conf_enabled_dir'];
238+
$tpl_ini_array['web']['nginx_user'] = $conf['nginx']['user'];
239+
$tpl_ini_array['web']['nginx_group'] = $conf['nginx']['group'];
240+
$tpl_ini_array['web']['nginx_cgi_socket'] = $conf['nginx']['cgi_socket'];
241+
$tpl_ini_array['web']['php_fpm_init_script'] = $conf['nginx']['php_fpm_init_script'];
242+
$tpl_ini_array['web']['php_fpm_ini_path'] = $conf['nginx']['php_fpm_ini_path'];
243+
$tpl_ini_array['web']['php_fpm_pool_dir'] = $conf['nginx']['php_fpm_pool_dir'];
244+
$tpl_ini_array['web']['php_fpm_start_port'] = $conf['nginx']['php_fpm_start_port'];
245+
$tpl_ini_array['web']['php_fpm_socket_dir'] = $conf['nginx']['php_fpm_socket_dir'];
246+
236247
if ($conf['nginx']['installed'] == true) {
237-
$tpl_ini_array['web']['nginx_vhost_conf_dir'] = $conf['nginx']['vhost_conf_dir'];
238-
$tpl_ini_array['web']['nginx_vhost_conf_enabled_dir'] = $conf['nginx']['vhost_conf_enabled_dir'];
239-
$tpl_ini_array['web']['nginx_user'] = $conf['nginx']['user'];
240-
$tpl_ini_array['web']['nginx_group'] = $conf['nginx']['group'];
241-
$tpl_ini_array['web']['nginx_cgi_socket'] = $conf['nginx']['cgi_socket'];
242-
$tpl_ini_array['web']['php_fpm_init_script'] = $conf['nginx']['php_fpm_init_script'];
243-
$tpl_ini_array['web']['php_fpm_ini_path'] = $conf['nginx']['php_fpm_ini_path'];
244-
$tpl_ini_array['web']['php_fpm_pool_dir'] = $conf['nginx']['php_fpm_pool_dir'];
245-
$tpl_ini_array['web']['php_fpm_start_port'] = $conf['nginx']['php_fpm_start_port'];
246-
$tpl_ini_array['web']['php_fpm_socket_dir'] = $conf['nginx']['php_fpm_socket_dir'];
247248
$tpl_ini_array['web']['server_type'] = 'nginx';
248249
$tpl_ini_array['global']['webserver'] = 'nginx';
249250
}

install/lib/update.lib.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,18 @@ function updateDbAndIni() {
260260
$tpl_ini_array['dns']['named_conf_path'] = $conf['bind']['named_conf_path'];
261261
$tpl_ini_array['dns']['named_conf_local_path'] = $conf['bind']['named_conf_local_path'];
262262

263+
$tpl_ini_array['web']['nginx_vhost_conf_dir'] = $conf['nginx']['vhost_conf_dir'];
264+
$tpl_ini_array['web']['nginx_vhost_conf_enabled_dir'] = $conf['nginx']['vhost_conf_enabled_dir'];
265+
$tpl_ini_array['web']['nginx_user'] = $conf['nginx']['user'];
266+
$tpl_ini_array['web']['nginx_group'] = $conf['nginx']['group'];
267+
$tpl_ini_array['web']['nginx_cgi_socket'] = $conf['nginx']['cgi_socket'];
268+
$tpl_ini_array['web']['php_fpm_init_script'] = $conf['nginx']['php_fpm_init_script'];
269+
$tpl_ini_array['web']['php_fpm_ini_path'] = $conf['nginx']['php_fpm_ini_path'];
270+
$tpl_ini_array['web']['php_fpm_pool_dir'] = $conf['nginx']['php_fpm_pool_dir'];
271+
$tpl_ini_array['web']['php_fpm_start_port'] = $conf['nginx']['php_fpm_start_port'];
272+
$tpl_ini_array['web']['php_fpm_socket_dir'] = $conf['nginx']['php_fpm_socket_dir'];
273+
263274
if ($conf['nginx']['installed'] == true) {
264-
$tpl_ini_array['web']['nginx_vhost_conf_dir'] = $conf['nginx']['vhost_conf_dir'];
265-
$tpl_ini_array['web']['nginx_vhost_conf_enabled_dir'] = $conf['nginx']['vhost_conf_enabled_dir'];
266-
$tpl_ini_array['web']['nginx_user'] = $conf['nginx']['user'];
267-
$tpl_ini_array['web']['nginx_group'] = $conf['nginx']['group'];
268-
$tpl_ini_array['web']['nginx_cgi_socket'] = $conf['nginx']['cgi_socket'];
269-
$tpl_ini_array['web']['php_fpm_init_script'] = $conf['nginx']['php_fpm_init_script'];
270-
$tpl_ini_array['web']['php_fpm_ini_path'] = $conf['nginx']['php_fpm_ini_path'];
271-
$tpl_ini_array['web']['php_fpm_pool_dir'] = $conf['nginx']['php_fpm_pool_dir'];
272-
$tpl_ini_array['web']['php_fpm_start_port'] = $conf['nginx']['php_fpm_start_port'];
273-
$tpl_ini_array['web']['php_fpm_socket_dir'] = $conf['nginx']['php_fpm_socket_dir'];
274275
$tpl_ini_array['web']['server_type'] = 'nginx';
275276
$tpl_ini_array['global']['webserver'] = 'nginx';
276277
}

server/conf/squidRewriteRules.py.master

Lines changed: 0 additions & 196 deletions
This file was deleted.

server/plugins-available/apache2_plugin.inc.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,23 @@ function update($event_name,$data) {
289289
$app->log('Websites cannot be owned by the root user or group.',LOGLEVEL_WARN);
290290
return 0;
291291
}
292+
293+
// Create group and user, if not exist
294+
$app->uses('system');
295+
296+
$groupname = escapeshellcmd($data['new']['system_group']);
297+
if($data['new']['system_group'] != '' && !$app->system->is_group($data['new']['system_group'])) {
298+
exec('groupadd '.$groupname);
299+
if($apache_chrooted) $this->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' groupadd '.$groupname);
300+
$app->log('Adding the group: '.$groupname,LOGLEVEL_DEBUG);
301+
}
302+
303+
$username = escapeshellcmd($data['new']['system_user']);
304+
if($data['new']['system_user'] != '' && !$app->system->is_user($data['new']['system_user'])) {
305+
exec('useradd -d '.escapeshellcmd($data['new']['document_root'])." -g $groupname -G sshusers $username -s /bin/false");
306+
if($apache_chrooted) $this->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' useradd -d '.escapeshellcmd($data['new']['document_root'])." -g $groupname -G sshusers $username -s /bin/false");
307+
$app->log('Adding the user: '.$username,LOGLEVEL_DEBUG);
308+
}
292309

293310
//* If the client of the site has been changed, we have a change of the document root
294311
if($this->action == 'update' && $data['new']['document_root'] != $data['old']['document_root']) {
@@ -511,23 +528,6 @@ function update($event_name,$data) {
511528
exec('chown -R '.$data['new']['system_user'].':'.$data['new']['system_group'].' '.$error_page_path);
512529
} // end copy error docs
513530

514-
// Create group and user, if not exist
515-
$app->uses('system');
516-
517-
$groupname = escapeshellcmd($data['new']['system_group']);
518-
if($data['new']['system_group'] != '' && !$app->system->is_group($data['new']['system_group'])) {
519-
exec('groupadd '.$groupname);
520-
if($apache_chrooted) $this->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' groupadd '.$groupname);
521-
$app->log('Adding the group: '.$groupname,LOGLEVEL_DEBUG);
522-
}
523-
524-
$username = escapeshellcmd($data['new']['system_user']);
525-
if($data['new']['system_user'] != '' && !$app->system->is_user($data['new']['system_user'])) {
526-
exec('useradd -d '.escapeshellcmd($data['new']['document_root'])." -g $groupname -G sshusers $username -s /bin/false");
527-
if($apache_chrooted) $this->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' useradd -d '.escapeshellcmd($data['new']['document_root'])." -g $groupname -G sshusers $username -s /bin/false");
528-
$app->log('Adding the user: '.$username,LOGLEVEL_DEBUG);
529-
}
530-
531531
// Set the quota for the user
532532
if($username != '' && $app->system->is_user($username)) {
533533
if($data['new']['hd_quota'] > 0) {

0 commit comments

Comments
 (0)