diff --git a/install/dist/conf/opensuse110.conf.php b/install/dist/conf/opensuse110.conf.php index 4e0eba4d02b9e1823b2d5814fabd6c618892257f..19b6d7af9e38f1b7987c52e658a2e25840e16372 100644 --- a/install/dist/conf/opensuse110.conf.php +++ b/install/dist/conf/opensuse110.conf.php @@ -200,7 +200,7 @@ $conf['nginx']['vhost_port'] = '8080'; $conf['nginx']['cgi_socket'] = '/var/run/fcgiwrap.socket'; $conf['nginx']['php_fpm_init_script'] = 'php-fpm'; $conf['nginx']['php_fpm_ini_path'] = '/etc/php5/fpm/php.ini'; -$conf['nginx']['php_fpm_pool_dir'] = '/etc/php5/fpm'; +$conf['nginx']['php_fpm_pool_dir'] = '/etc/php5/fpm/pool.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php5-fpm'; diff --git a/install/dist/conf/opensuse112.conf.php b/install/dist/conf/opensuse112.conf.php index 9da76dc9e08a6dd20ba921461e8c62f22f19c799..7663e015c4f056e67906e7d60bf5a59a89a879f4 100644 --- a/install/dist/conf/opensuse112.conf.php +++ b/install/dist/conf/opensuse112.conf.php @@ -200,7 +200,7 @@ $conf['nginx']['vhost_port'] = '8080'; $conf['nginx']['cgi_socket'] = '/var/run/fcgiwrap.socket'; $conf['nginx']['php_fpm_init_script'] = 'php-fpm'; $conf['nginx']['php_fpm_ini_path'] = '/etc/php5/fpm/php.ini'; -$conf['nginx']['php_fpm_pool_dir'] = '/etc/php5/fpm'; +$conf['nginx']['php_fpm_pool_dir'] = '/etc/php5/fpm/pool.d'; $conf['nginx']['php_fpm_start_port'] = 9010; $conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php5-fpm'; diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php index a36ebcd418c2aeaf75f84f9d63b11663bf73c905..5c4a3909fff8f88d18a178537e2429f0f13247a9 100644 --- a/install/dist/lib/opensuse.lib.php +++ b/install/dist/lib/opensuse.lib.php @@ -584,6 +584,54 @@ class installer_dist extends installer_base { } + public function configure_nginx(){ + global $conf; + + if($conf['nginx']['installed'] == false) return; + //* Create the logging directory for the vhost logfiles + if(!@is_dir($conf['ispconfig_log_dir'].'/httpd')) mkdir($conf['ispconfig_log_dir'].'/httpd', 0755, true); + + // Sites enabled and avaulable dirs + exec('mkdir -p '.$conf['nginx']['vhost_conf_enabled_dir']); + exec('mkdir -p '.$conf['nginx']['vhost_conf_dir']); + + $content = trim(rf('/etc/nginx/nginx.conf')); + $content = substr($content,0,-1)."\n include /etc/nginx/sites-enabled/*.vhost;\n}"; + wf('/etc/nginx/nginx.conf',$content); + unset($content); + + // create PHP-FPM pool dir + exec('mkdir -p '.$conf['nginx']['php_fpm_pool_dir']); + + $content = rf('/etc/php5/fpm/php-fpm.conf'); + if(stripos($content, 'include=/etc/php5/fpm/pool.d/*.conf') === false){ + af('/etc/php5/fpm/php-fpm.conf',"\ninclude=/etc/php5/fpm/pool.d/*.conf"); + } + unset($content); + + //* make sure that webalizer finds its config file when it is directly in /etc + if(@is_file('/etc/webalizer.conf') && !@is_dir('/etc/webalizer')) { + mkdir('/etc/webalizer'); + symlink('/etc/webalizer.conf','/etc/webalizer/webalizer.conf'); + } + + if(is_file('/etc/webalizer/webalizer.conf')) { + // Change webalizer mode to incremental + replaceLine('/etc/webalizer/webalizer.conf','#IncrementalName','IncrementalName webalizer.current',0,0); + replaceLine('/etc/webalizer/webalizer.conf','#Incremental','Incremental yes',0,0); + replaceLine('/etc/webalizer/webalizer.conf','#HistoryName','HistoryName webalizer.hist',0,0); + } + + // Check the awsatst script + if(!is_dir('/usr/share/awstats/tools')) exec('mkdir -p /usr/share/awstats/tools'); + if(!file_exists('/usr/share/awstats/tools/awstats_buildstaticpages.pl') && file_exists('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl')) symlink('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl','/usr/share/awstats/tools/awstats_buildstaticpages.pl'); + if(file_exists('/etc/awstats/awstats.conf.local')) replaceLine('/etc/awstats/awstats.conf.local','LogFormat=4','LogFormat=1',0,1); + + //* add a sshusers group + $command = 'groupadd sshusers'; + if(!is_group('sshusers')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } + public function configure_firewall() { global $conf;