ftimme
2011-09-27 f19eb67c3e74798677fc1ccd36b3db564c09d198
install/lib/installer_base.lib.php
@@ -118,7 +118,7 @@
      if(is_installed('mysql') || is_installed('mysqld')) $conf['mysql']['installed'] = true;
      if(is_installed('postfix')) $conf['postfix']['installed'] = true;
      if(is_installed('mailman')) $conf['mailman']['installed'] = true;
      if(is_installed('apache') || is_installed('apache2') || is_installed('httpd')) $conf['apache']['installed'] = true;
      if(is_installed('apache') || is_installed('apache2') || is_installed('httpd') || is_installed('httpd2')) $conf['apache']['installed'] = true;
      if(is_installed('getmail')) $conf['getmail']['installed'] = true;
      if(is_installed('courierlogger')) $conf['courier']['installed'] = true;
      if(is_installed('dovecot')) $conf['dovecot']['installed'] = true;
@@ -132,12 +132,12 @@
      if(is_installed('named') || is_installed('bind') || is_installed('bind9')) $conf['bind']['installed'] = true;
      if(is_installed('squid')) $conf['squid']['installed'] = true;
      if(is_installed('nginx')) $conf['nginx']['installed'] = true;
      if(is_installed('iptables') && is_installed('ufw')) $conf['ufw']['installed'] = true;
      // if(is_installed('iptables') && is_installed('ufw')) $conf['ufw']['installed'] = true;
      if(is_installed('fail2ban-server')) $conf['fail2ban']['installed'] = true;
      if(is_installed('vzctl')) $conf['openvz']['installed'] = true;
      if(is_dir("/etc/Bastille")) $conf['bastille']['installed'] = true;
      
      if ($conf['services']['web'] && $conf['apache']['installed'] && is_file($conf['apache']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost")) $this->ispconfig_interface_installed = true;
      if ($conf['services']['web'] && (($conf['apache']['installed'] && is_file($conf['apache']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost")) || ($conf['nginx']['installed'] && is_file($conf['nginx']["vhost_conf_enabled_dir"]."/000-ispconfig.vhost")))) $this->ispconfig_interface_installed = true;
   }
   /** Create the database for ISPConfig */
@@ -265,8 +265,8 @@
      $file_server_enabled = ($conf['services']['file'])?1:0;
      $db_server_enabled = ($conf['services']['db'])?1:0;
      $vserver_server_enabled = ($conf['openvz']['installed'])?1:0;
      $proxy_server_enabled = ($conf['services']['proxy'])?1:0;
      $firewall_server_enabled = ($conf['services']['firewall'])?1:0;
      $proxy_server_enabled = (isset($conf['services']['proxy']) && $conf['services']['proxy'])?1:0;
      $firewall_server_enabled = (isset($conf['services']['firewall']) && $conf['services']['firewall'])?1:0;
      
      //** Get the database version number based on the patchfiles
      $found = true;
@@ -671,9 +671,9 @@
      
      //* Create the mailman files
      exec('mkdir -p /var/lib/mailman/data');
      touch('/var/lib/mailman/data/aliases');
      exec('postmap /var/lib/mailman/data/aliases');
      touch('/var/lib/mailman/data/virtual-mailman');
      if(!is_file('/var/lib/mailman/data/aliases')) touch('/var/lib/mailman/data/aliases');
      exec('postalias /var/lib/mailman/data/aliases');
      if(!is_file('/var/lib/mailman/data/virtual-mailman')) touch('/var/lib/mailman/data/virtual-mailman');
      exec('postmap /var/lib/mailman/data/virtual-mailman');
      //* Make a backup copy of the main.cf file
@@ -1256,6 +1256,10 @@
      */
   }
   
   public function configure_fail2ban() {
        // To Do
    }
   public function configure_squid()
   {
      global $conf;
@@ -1275,6 +1279,7 @@
      exec('chown root:root '.$conf["squid"]["config_dir"].'/'.$configfile);
   }
   
   /*
   public function configure_ufw_firewall()
   {
      $configfile = 'ufw.conf';
@@ -1284,6 +1289,7 @@
      exec('chmod 600 /etc/ufw/ufw.conf');
      exec('chown root:root /etc/ufw/ufw.conf');   
   }
   */
   public function configure_firewall() {
      global $conf;
@@ -1477,7 +1483,7 @@
         
         // 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 = rf('tpl/apps_php_fpm_pool.conf.master');
         $content = str_replace('{fpm_pool}', 'apps', $content);
         $content = str_replace('{fpm_port}', ($conf['nginx']['php_fpm_start_port']+1), $content);
         $content = str_replace('{fpm_user}', $apps_vhost_user, $content);
@@ -1728,8 +1734,14 @@
      // TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing
      // and must be fixed as this will allow the apache user to read the ispconfig files.
      // Later this must run as own apache server or via suexec!
      $command = 'adduser www-data ispconfig';
      caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
      if($conf['apache']['installed'] == true){
         $command = 'adduser '.$conf['apache']['user'].' ispconfig';
         caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
      }
      if($conf['nginx']['installed'] == true){
         $command = 'adduser '.$conf['nginx']['user'].' ispconfig';
         caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
      }
      //* Make the shell scripts executable
      $command = "chmod +x $install_dir/server/scripts/*.sh";