| | |
| | | exec('mkdir -p /var/log/ispconfig/httpd'); |
| | | |
| | | //if(is_file('/etc/suphp.conf')) { |
| | | replaceLine('/etc/suphp.conf','php=php','x-httpd-suphp=php:/srv/www/cgi-bin/php5',0,0); |
| | | replaceLine('/etc/suphp.conf','php=php','x-httpd-suphp="php:/srv/www/cgi-bin/php5"',0,0); |
| | | replaceLine('/etc/suphp.conf','php="php','x-httpd-suphp="php:/srv/www/cgi-bin/php5"',0,0); |
| | | replaceLine('/etc/suphp.conf','docroot=','docroot=/srv/www',0,0); |
| | | replaceLine('/etc/suphp.conf','umask=0077','umask=0022',0); |
| | | //} |
| | |
| | | //copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf'); |
| | | $content = rf("tpl/apache_ispconfig.conf.master"); |
| | | $records = $this->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ".$conf["server_id"]." AND virtualhost = 'y'"); |
| | | if(count($records) > 0) { |
| | | if(is_array($records) && count($records) > 0) { |
| | | foreach($records as $rec) { |
| | | $content .= "NameVirtualHost ".$rec["ip_address"].":80\n"; |
| | | $content .= "NameVirtualHost ".$rec["ip_address"].":443\n"; |
| | |
| | | $tcp_public_services = ''; |
| | | $udp_public_services = ''; |
| | | |
| | | $row = $this->db->queryOneRecord("SELECT * FROM firewall WHERE server_id = ".intval($conf['server_id'])); |
| | | $row = $this->db->queryOneRecord('SELECT * FROM '.$conf["mysql"]["database"].'.firewall WHERE server_id = '.intval($conf['server_id'])); |
| | | |
| | | if(trim($row["tcp_port"]) != '' || trim($row["udp_port"]) != ''){ |
| | | $tcp_public_services = trim(str_replace(',',' ',$row["tcp_port"])); |
| | |
| | | unset($iptables_location); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public function install_ispconfig() |
| | | { |
| | | global $conf; |
| | |
| | | |
| | | wf("$install_dir/server/lib/$configfile", $content); |
| | | |
| | | //* Create the config file for remote-actions (but only, if it does not exist, because |
| | | // the value is a autoinc-value and so changed by the remoteaction_core_module |
| | | if (!file_exists($install_dir.'/server/lib/remote_action.inc.php')) { |
| | | $content = '<?php' . "\n" . '$maxid_remote_action = 0;' . "\n" . '?>'; |
| | | wf($install_dir.'/server/lib/remote_action.inc.php', $content); |
| | | } |
| | | |
| | | //* Enable the server modules and plugins. |
| | | // TODO: Implement a selector which modules and plugins shall be enabled. |
| | |
| | | $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('{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); |
| | |
| | | exec('chmod a+rx /usr/local/ispconfig/interface/web'); |
| | | |
| | | //* Create the ispconfig log directory |
| | | if(!is_dir('/var/log/ispconfig')) mkdir('/var/log/ispconfig'); |
| | | if(!is_file('/var/log/ispconfig/ispconfig.log')) exec('touch /var/log/ispconfig/ispconfig.log'); |
| | | if(!is_dir($conf['ispconfig_log_dir'])) mkdir($conf['ispconfig_log_dir']); |
| | | if(!is_file($conf['ispconfig_log_dir'].'/ispconfig.log')) exec('touch '.$conf['ispconfig_log_dir'].'/ispconfig.log'); |
| | | |
| | | exec('mv /usr/local/ispconfig/server/scripts/run-getmail.sh /usr/local/bin/run-getmail.sh'); |
| | | exec('chown getmail /usr/local/bin/run-getmail.sh'); |
| | |
| | | |
| | | } |
| | | |
| | | ?> |
| | | ?> |