Skip to content

Commit 6eef0af

Browse files
committed
Move install.log into the ispconfig_log_dir
1 parent d53109a commit 6eef0af

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

install/install.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@
8585
chdir( realpath(dirname(__FILE__)) );
8686
}
8787

88-
//** Install logfile
89-
define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log');
9088
define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../'));
9189

9290
//** Include the templating lib
@@ -155,9 +153,9 @@
155153
swriteln($inst->lng(' Default values are in [brackets] and can be accepted with <ENTER>.'));
156154
swriteln($inst->lng(' Tap in "quit" (without the quotes) to stop the installer.'."\n\n"));
157155

158-
//** Check log file is writable (probably not root or sudo)
159-
if(!is_writable(dirname(ISPC_LOG_FILE))){
160-
die("ERROR: Cannot write to the ".dirname(ISPC_LOG_FILE)." directory. Are you root or sudo ?\n\n");
156+
//** Check install dir is writable (probably not root or sudo)
157+
if(!is_writable(dirname('/usr/local/ispconfig'))){
158+
die("ERROR: Cannot write to the /usr/local/ispconfig directory. Are you root or sudo ?\n\n");
161159
}
162160

163161
//** Check for ISPConfig 2.x versions
@@ -304,6 +302,11 @@
304302
$inst->dbmaster = $inst->db;
305303
}
306304

305+
if(!is_dir($conf['ispconfig_log_dir'])) {
306+
mkdir($conf['ispconfig_log_dir'], 0755, true);
307+
}
308+
define('ISPC_LOG_FILE', $conf['ispconfig_log_dir'] . '/install.log');
309+
307310
//* Create the mysql database
308311
$inst->configure_database();
309312

install/lib/installer_base.lib.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2982,9 +2982,6 @@ public function make_ispconfig_ssl_cert() {
29822982
}
29832983
swriteln('Using certificate path ' . $acme_cert_dir);
29842984

2985-
if(!is_dir($conf['ispconfig_log_dir'])) {
2986-
mkdir($conf['ispconfig_log_dir'], 0755, true);
2987-
}
29882985
$acme_log = $conf['ispconfig_log_dir'] . '/acme.log';
29892986

29902987
$ip_address_match = false;

install/update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
if(realpath(dirname(__FILE__)) != $cur_dir) die("Please run installation/update from _inside_ the install directory!\n");
8989

9090
//** Install logfile
91-
define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log');
9291
define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../'));
9392

9493
//** Include the templating lib
@@ -112,6 +111,7 @@
112111
include_once "/usr/local/ispconfig/server/lib/config.inc.php";
113112
$conf_old = $conf;
114113
unset($conf);
114+
define('ISPC_LOG_FILE', $old_conf['ispconfig_log_dir'] . '/update.log');
115115

116116
if($dist['id'] == '') die('Linux distribution or version not recognized.');
117117

0 commit comments

Comments
 (0)