Commit 1bd2693a authored by Falko Timme's avatar Falko Timme
Browse files

Updated Fedora and OpenSUSE install libraries.

parent a2156eb5
...@@ -497,6 +497,7 @@ class installer_dist extends installer_base { ...@@ -497,6 +497,7 @@ class installer_dist extends installer_base {
{ {
global $conf; global $conf;
if($conf['apache']['installed'] == false) return;
if(is_file('/etc/suphp.conf')) { if(is_file('/etc/suphp.conf')) {
//replaceLine('/etc/suphp.conf','php=php:/usr/bin','x-httpd-suphp=php:/usr/bin/php-cgi',0); //replaceLine('/etc/suphp.conf','php=php:/usr/bin','x-httpd-suphp=php:/usr/bin/php-cgi',0);
replaceLine('/etc/suphp.conf','docroot=','docroot=/var/www',0); replaceLine('/etc/suphp.conf','docroot=','docroot=/var/www',0);
...@@ -741,6 +742,8 @@ class installer_dist extends installer_base { ...@@ -741,6 +742,8 @@ class installer_dist extends installer_base {
if (is_dir($dir)) { if (is_dir($dir)) {
if ($dh = opendir($dir)) { if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) { while (($file = readdir($dh)) !== false) {
if($conf['apache']['installed'] == true && $file == 'nginx_plugin.inc.php') continue;
if($conf['nginx']['installed'] == true && $file == 'apache2_plugin.inc.php') continue;
if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') { if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') {
include_once($install_dir.'/server/plugins-available/'.$file); include_once($install_dir.'/server/plugins-available/'.$file);
$plugin_name = substr($file,0,-8); $plugin_name = substr($file,0,-8);
...@@ -822,55 +825,100 @@ class installer_dist extends installer_base { ...@@ -822,55 +825,100 @@ class installer_dist extends installer_base {
$command = "chmod +x $install_dir/server/scripts/*.sh"; $command = "chmod +x $install_dir/server/scripts/*.sh";
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
//* Copy the ISPConfig vhost for the controlpanel if($conf['apache']['installed'] == true){
// TODO: These are missing! should they be "vhost_dist_*_dir" ? //* Copy the ISPConfig vhost for the controlpanel
$vhost_conf_dir = $conf['apache']['vhost_conf_dir']; // TODO: These are missing! should they be "vhost_dist_*_dir" ?
$vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; $vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
$vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir'];
// Dont just copy over the virtualhost template but add some custom settings // Dont just copy over the virtualhost template but add some custom settings
$content = rf("tpl/apache_ispconfig.vhost.master"); $content = rf("tpl/apache_ispconfig.vhost.master");
$content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content); $content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content);
// comment out the listen directive if port is 80 or 443
if($conf['apache']['vhost_port'] == 80 or $conf['apache']['vhost_port'] == 443) {
$content = str_replace('{vhost_port_listen}', '#', $content);
} else {
$content = str_replace('{vhost_port_listen}', '', $content);
}
// comment out the listen directive if port is 80 or 443 if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) {
if($conf['apache']['vhost_port'] == 80 or $conf['apache']['vhost_port'] == 443) { $content = str_replace('{ssl_comment}', '', $content);
$content = str_replace('{vhost_port_listen}', '#', $content); } else {
} else { $content = str_replace('{ssl_comment}', '#', $content);
$content = str_replace('{vhost_port_listen}', '', $content); }
}
if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) { wf("$vhost_conf_dir/ispconfig.vhost", $content);
$content = str_replace('{ssl_comment}', '', $content);
} else {
$content = str_replace('{ssl_comment}', '#', $content);
}
wf("$vhost_conf_dir/ispconfig.vhost", $content); //copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");
//* and create the symlink
if($this->install_ispconfig_interface == true && $this->is_update == false) {
if(@is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) unlink("$vhost_conf_enabled_dir/ispconfig.vhost");
if(!@is_link("$vhost_conf_enabled_dir/000-ispconfig.vhost")) {
exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/000-ispconfig.vhost");
}
exec('mkdir -p /var/www/php-fcgi-scripts/ispconfig');
exec('cp tpl/apache_ispconfig_fcgi_starter.master /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
exec('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
exec('ln -s /usr/local/ispconfig/interface/web /var/www/ispconfig');
exec('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig');
replaceLine('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter','PHPRC=','PHPRC=/etc/',0,0);
}
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost"); //copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");
//* and create the symlink //* and create the symlink
if($this->install_ispconfig_interface == true && $this->is_update == false) { if($this->install_ispconfig_interface == true && $this->is_update == false) {
if(@is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) unlink("$vhost_conf_enabled_dir/ispconfig.vhost"); if(@is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) unlink("$vhost_conf_enabled_dir/ispconfig.vhost");
if(!@is_link("$vhost_conf_enabled_dir/000-ispconfig.vhost")) { if(!@is_link("$vhost_conf_enabled_dir/000-ispconfig.vhost")) {
exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/000-ispconfig.vhost"); exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/000-ispconfig.vhost");
}
}
}
if($conf['nginx']['installed'] == true){
//* Copy the ISPConfig vhost for the controlpanel
$vhost_conf_dir = $conf['nginx']['vhost_conf_dir'];
$vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enabled_dir'];
// Dont just copy over the virtualhost template but add some custom settings
$content = rf('tpl/nginx_ispconfig.vhost.master');
$content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content);
if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) {
$content = str_replace('{ssl_on}', ' ssl', $content);
$content = str_replace('{ssl_comment}', '', $content);
$content = str_replace('{fastcgi_ssl}', 'on', $content);
} else {
$content = str_replace('{ssl_on}', '', $content);
$content = str_replace('{ssl_comment}', '#', $content);
$content = str_replace('{fastcgi_ssl}', 'off', $content);
} }
exec('mkdir -p /var/www/php-fcgi-scripts/ispconfig'); $content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content);
exec('cp tpl/apache_ispconfig_fcgi_starter.master /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
exec('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter'); wf($vhost_conf_dir.'/ispconfig.vhost', $content);
exec('ln -s /usr/local/ispconfig/interface/web /var/www/ispconfig');
exec('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig');
replaceLine('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter','PHPRC=','PHPRC=/etc/',0,0); unset($content);
} // PHP-FPM
// Dont just copy over the php-fpm pool template but add some custom settings
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost"); $content = rf('tpl/php_fpm_pool.conf.master');
//* and create the symlink $content = str_replace('{fpm_pool}', 'ispconfig', $content);
if($this->install_ispconfig_interface == true && $this->is_update == false) { $content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content);
if(@is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) unlink("$vhost_conf_enabled_dir/ispconfig.vhost"); $content = str_replace('{fpm_user}', 'ispconfig', $content);
if(!@is_link("$vhost_conf_enabled_dir/000-ispconfig.vhost")) { $content = str_replace('{fpm_group}', 'ispconfig', $content);
exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/000-ispconfig.vhost"); wf($conf['nginx']['php_fpm_pool_dir'].'/ispconfig.conf', $content);
//copy('tpl/nginx_ispconfig.vhost.master', $vhost_conf_dir.'/ispconfig.vhost');
//* and create the symlink
if($this->install_ispconfig_interface == true && $this->is_update == false) {
if(@is_link($vhost_conf_enabled_dir.'/ispconfig.vhost')) unlink($vhost_conf_enabled_dir.'/ispconfig.vhost');
if(!@is_link($vhost_conf_enabled_dir.'/000-ispconfig.vhost')) {
symlink($vhost_conf_dir.'/ispconfig.vhost',$vhost_conf_enabled_dir.'/000-ispconfig.vhost');
}
} }
} }
......
...@@ -510,6 +510,7 @@ class installer_dist extends installer_base { ...@@ -510,6 +510,7 @@ class installer_dist extends installer_base {
{ {
global $conf; global $conf;
if($conf['apache']['installed'] == false) return;
//* Create the logging directory for the vhost logfiles //* Create the logging directory for the vhost logfiles
exec('mkdir -p /var/log/ispconfig/httpd'); exec('mkdir -p /var/log/ispconfig/httpd');
...@@ -754,6 +755,8 @@ class installer_dist extends installer_base { ...@@ -754,6 +755,8 @@ class installer_dist extends installer_base {
if (is_dir($dir)) { if (is_dir($dir)) {
if ($dh = opendir($dir)) { if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) { while (($file = readdir($dh)) !== false) {
if($conf['apache']['installed'] == true && $file == 'nginx_plugin.inc.php') continue;
if($conf['nginx']['installed'] == true && $file == 'apache2_plugin.inc.php') continue;
if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') { if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') {
include_once($install_dir.'/server/plugins-available/'.$file); include_once($install_dir.'/server/plugins-available/'.$file);
$plugin_name = substr($file,0,-8); $plugin_name = substr($file,0,-8);
...@@ -835,57 +838,103 @@ class installer_dist extends installer_base { ...@@ -835,57 +838,103 @@ class installer_dist extends installer_base {
$command = "chmod +x $install_dir/server/scripts/*.sh"; $command = "chmod +x $install_dir/server/scripts/*.sh";
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
//* Copy the ISPConfig vhost for the controlpanel
// TODO: These are missing! should they be "vhost_dist_*_dir" ? if($conf['apache']['installed'] == true){
$vhost_conf_dir = $conf['apache']['vhost_conf_dir']; //* Copy the ISPConfig vhost for the controlpanel
$vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; // TODO: These are missing! should they be "vhost_dist_*_dir" ?
$vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
$vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir'];
// Dont just copy over the virtualhost template but add some custom settings // Dont just copy over the virtualhost template but add some custom settings
$content = rf("tpl/apache_ispconfig.vhost.master"); $content = rf("tpl/apache_ispconfig.vhost.master");
$content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content); $content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content);
// comment out the listen directive if port is 80 or 443
if($conf['apache']['vhost_port'] == 80 or $conf['apache']['vhost_port'] == 443) {
$content = str_replace('{vhost_port_listen}', '#', $content);
} else {
$content = str_replace('{vhost_port_listen}', '', $content);
}
// comment out the listen directive if port is 80 or 443 if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) {
if($conf['apache']['vhost_port'] == 80 or $conf['apache']['vhost_port'] == 443) { $content = str_replace('{ssl_comment}', '', $content);
$content = str_replace('{vhost_port_listen}', '#', $content); } else {
} else { $content = str_replace('{ssl_comment}', '#', $content);
$content = str_replace('{vhost_port_listen}', '', $content); }
}
if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) { $content = str_replace('/var/www/', '/srv/www/', $content);
$content = str_replace('{ssl_comment}', '', $content);
} else {
$content = str_replace('{ssl_comment}', '#', $content);
}
$content = str_replace('/var/www/', '/srv/www/', $content); wf("$vhost_conf_dir/ispconfig.vhost", $content);
wf("$vhost_conf_dir/ispconfig.vhost", $content); if(!is_file('/srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) {
exec('mkdir -p /srv/www/php-fcgi-scripts/ispconfig');
exec('cp tpl/apache_ispconfig_fcgi_starter.master /srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
exec('chmod +x /srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
exec('ln -s /usr/local/ispconfig/interface/web /srv/www/ispconfig');
exec('chown -R ispconfig:ispconfig /srv/www/php-fcgi-scripts/ispconfig');
}
if(!is_file('/srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) { //copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");
exec('mkdir -p /srv/www/php-fcgi-scripts/ispconfig'); //* and create the symlink
exec('cp tpl/apache_ispconfig_fcgi_starter.master /srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter'); if($this->install_ispconfig_interface == true && $this->is_update == false) {
exec('chmod +x /srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter'); if(@is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) unlink("$vhost_conf_enabled_dir/ispconfig.vhost");
exec('ln -s /usr/local/ispconfig/interface/web /srv/www/ispconfig'); if(!@is_link("$vhost_conf_enabled_dir/000-ispconfig.vhost")) {
exec('chown -R ispconfig:ispconfig /srv/www/php-fcgi-scripts/ispconfig'); exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/000-ispconfig.vhost");
}
} }
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost"); // Fix a setting in vhost master file for suse
//* and create the symlink replaceLine('/usr/local/ispconfig/server/conf/vhost.conf.master',"suPHP_UserGroup"," suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>",0);
if($this->install_ispconfig_interface == true && $this->is_update == false) { }
if(@is_link("$vhost_conf_enabled_dir/ispconfig.vhost")) unlink("$vhost_conf_enabled_dir/ispconfig.vhost");
if(!@is_link("$vhost_conf_enabled_dir/000-ispconfig.vhost")) { if($conf['nginx']['installed'] == true){
exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/000-ispconfig.vhost"); //* Copy the ISPConfig vhost for the controlpanel
$vhost_conf_dir = $conf['nginx']['vhost_conf_dir'];
$vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enabled_dir'];
// Dont just copy over the virtualhost template but add some custom settings
$content = rf('tpl/nginx_ispconfig.vhost.master');
$content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content);
if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) {
$content = str_replace('{ssl_on}', ' ssl', $content);
$content = str_replace('{ssl_comment}', '', $content);
$content = str_replace('{fastcgi_ssl}', 'on', $content);
} else {
$content = str_replace('{ssl_on}', '', $content);
$content = str_replace('{ssl_comment}', '#', $content);
$content = str_replace('{fastcgi_ssl}', 'off', $content);
} }
$content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content);
wf($vhost_conf_dir.'/ispconfig.vhost', $content);
unset($content);
// PHP-FPM
// Dont just copy over the php-fpm pool template but add some custom settings
$content = rf('tpl/php_fpm_pool.conf.master');
$content = str_replace('{fpm_pool}', 'ispconfig', $content);
$content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content);
$content = str_replace('{fpm_user}', 'ispconfig', $content);
$content = str_replace('{fpm_group}', 'ispconfig', $content);
wf($conf['nginx']['php_fpm_pool_dir'].'/ispconfig.conf', $content);
//copy('tpl/nginx_ispconfig.vhost.master', $vhost_conf_dir.'/ispconfig.vhost');
//* and create the symlink
if($this->install_ispconfig_interface == true && $this->is_update == false) {
if(@is_link($vhost_conf_enabled_dir.'/ispconfig.vhost')) unlink($vhost_conf_enabled_dir.'/ispconfig.vhost');
if(!@is_link($vhost_conf_enabled_dir.'/000-ispconfig.vhost')) {
symlink($vhost_conf_dir.'/ispconfig.vhost',$vhost_conf_enabled_dir.'/000-ispconfig.vhost');
}
}
} }
// Fix a setting in vhost master file for suse
replaceLine('/usr/local/ispconfig/server/conf/vhost.conf.master',"suPHP_UserGroup"," suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>",0);
// Make the Clamav log files readable by ISPConfig // Make the Clamav log files readable by ISPConfig
//exec('chmod +r /var/log/clamav/clamav.log'); //exec('chmod +r /var/log/clamav/clamav.log');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment