From 386676a6ae702f5fbbd707fed7afbc65bfd89a3d Mon Sep 17 00:00:00 2001
From: redray <redray@ispconfig3>
Date: Mon, 01 Dec 2008 05:40:22 -0500
Subject: [PATCH] last change didn't work: undo
---
install/lib/installer_base.lib.php | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 42ce9cc..4c9c20c 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -119,7 +119,7 @@
$cf = $conf['mysql']; // make $conf['mysql'] more accessible
//** Create the database
- if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$cf['database'])) {
+ if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$cf['database'].' DEFAULT CHARACTER SET '.$cf['charset'])) {
$this->error('Unable to create MySQL database: '.$cf['database'].'.');
}
@@ -132,10 +132,10 @@
$this->error('Stopped: Database already contains some tables.');
} else {
if($cf['admin_password'] == '') {
- caselog("mysql -h '".$cf['host']."' -u '".$cf['admin_user']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
+ caselog("mysql --default-character-set=".$cf['charset']." -h '".$cf['host']."' -u '".$cf['admin_user']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
__FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql');
} else {
- caselog("mysql -h '".$cf['host']."' -u '".$cf['admin_user']."' -p'".$cf['admin_password']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
+ caselog("mysql --default-character-set=".$cf['charset']." -h '".$cf['host']."' -u '".$cf['admin_user']."' -p'".$cf['admin_password']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
__FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql');
}
$db_tables = $this->db->getTables();
@@ -832,12 +832,20 @@
$content = rf("tpl/apache_ispconfig.vhost.master");
$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);
+ }
+
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) {
- 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")) {
exec("ln -s $vhost_conf_dir/ispconfig.vhost $vhost_conf_enabled_dir/000-ispconfig.vhost");
}
@@ -863,6 +871,7 @@
//* 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');
}
--
Gitblit v1.9.1