Login url not redirected automatically

Discussion in 'Installation/Configuration' started by neoartur35, Jan 13, 2025 at 1:12 PM.

  1. neoartur35

    neoartur35 New Member

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Check your web server error.log to see what#s wrong with your base installation.
     
  3. neoartur35

    neoartur35 New Member

    Here are the logs from the moment of login:

    [Mon Jan 13 12:21:26.960934 2025] [fcgid:warn] [pid 347142:tid 281472601485600] [remote 192.168.31.222:38018] mod_fcgid: stderr: PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, false given in /usr/local/ispconfig/interface/lib/app.inc.php:217, referer: https://my-domain:8080/login/
    [Mon Jan 13 12:21:26.961071 2025] [fcgid:warn] [pid 347142:tid 281472601485600] [remote 192.168.31.222:38018] mod_fcgid: stderr: Stack trace:, referer: https://my-domain:8080/login/
    [Mon Jan 13 12:21:26.961089 2025] [fcgid:warn] [pid 347142:tid 281472601485600] [remote 192.168.31.222:38018] mod_fcgid: stderr: #0 /usr/local/ispconfig/interface/lib/app.inc.php(217): fwrite(), referer: https://my-domain:8080/login/
    [Mon Jan 13 12:21:26.961155 2025] [fcgid:warn] [pid 347142:tid 281472601485600] [remote 192.168.31.222:38018] mod_fcgid: stderr: #1 /usr/local/ispconfig/interface/web/login/index.php(160): app->auth_log(), referer: https://my-domain:8080/login/
    [Mon Jan 13 12:21:26.961171 2025] [fcgid:warn] [pid 347142:tid 281472601485600] [remote 192.168.31.222:38018] mod_fcgid: stderr: #2 /usr/local/ispconfig/interface/web/login/index.php(459): process_login_request(), referer: https://my-domain:8080/login/
    [Mon Jan 13 12:21:26.961186 2025] [fcgid:warn] [pid 347142:tid 281472601485600] [remote 192.168.31.222:38018] mod_fcgid: stderr: #3 {main}, referer: https://my-domain:8080/login/
    [Mon Jan 13 12:21:26.961229 2025] [fcgid:warn] [pid 347142:tid 281472601485600] [remote 192.168.31.222:38018] mod_fcgid: stderr: thrown in /usr/local/ispconfig/interface/lib/app.inc.php on line 217, referer: https://my-domain:8080/login/
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    There seems to be an issue when ISPConfig tries to write its log file. How did you install ISPConfig? Seems as if it is installed in a non-standard way or you altered folder permissions or paths in config files.

    That#s the file ISPConfig typically logs auth attempts

    Code:
    root@server1:~# ls -la /var/log/ispconfig/auth.log
    -rw-rw---- 1 ispconfig ispconfig 0 Jan 13 00:03 /var/log/ispconfig/auth.log
    
    and that#s how the log dir is set by default:

    Code:
    root@server1:~# grep ispconfig_log_dir /usr/local/ispconfig/interface/lib/config.inc.php
    $conf['ispconfig_log_dir'] = '/var/log/ispconfig';
    define('ISPC_LOG_PATH', $conf['ispconfig_log_dir']);
    $conf['logpath'] = ISPC_LOG_PATH; // Actually just a copy of $conf['ispconfig_log_dir'], might be removed in a later version
    $conf['log_file'] = $conf['ispconfig_log_dir'].$conf['fs_div'].'ispconfig.log';
    
     
  5. neoartur35

    neoartur35 New Member

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Please change that back, you opened a security hole by doing that and nothing in ISPConfig uses www-data user anyway. root user is fine. What you can try is to create the auth log file:

    Code:
    touch /var/log/ispconfig/auth.log
    chown ispconfig:ispconfig /var/log/ispconfig/auth.log
     
  7. neoartur35

    neoartur35 New Member

    Same 500 error.
    Here's my directory after changes:


    total 88K
    -rw-r--r-- 1 ispconfig ispconfig 0 Jan 13 13:08 auth.log
    -rw-r--r-- 1 root root 62K Jan 13 13:09 cron.log
    -rw-r--r-- 1 root root 4.0K Jan 13 00:00 cron.log.1.gz
    -rw-r--r-- 1 root root 350 Jan 12 10:41 cron.log.2.gz
    drwxr-xr-x 6 root root 4.0K Jan 12 15:56 httpd
    -rw-r--r-- 1 root root 112 Jan 13 12:29 ispconfig.log
    -rw-r--r-- 1 root root 125 Jan 13 00:00 ispconfig.log.1.gz
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Have you verified that the config is correct? See second code blog in #4
     
  9. neoartur35

    neoartur35 New Member

    Yes, it's the same:

    $conf['ispconfig_log_dir'] = '/var/log/ispconfig';
    define('ISPC_LOG_PATH', $conf['ispconfig_log_dir']);
    $conf['logpath'] = ISPC_LOG_PATH; // Actually just a copy of $conf['ispconfig_log_dir'], might be removed in a later version
    $conf['log_file'] = $conf['ispconfig_log_dir'].$conf['fs_div'].'ispconfig.log';
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    I have no idea why this happens on your system, I have not seen that on other systems, nor is it reproducible. Edit the file /usr/local/ispconfig/interface/lib/app.inc.php and change the function to write the auth.log around line 215 like this:

    Code:
    public function auth_log($msg) {
            $authlog_handle = fopen($this->_conf['ispconfig_log_dir'].'/auth.log', 'a');
            if($authlog_handle) {
                fwrite($authlog_handle, $msg . PHP_EOL);
                fclose($authlog_handle);
            }
        }
    This at least prevents the 500 error if it can not open the log file.
     
  11. neoartur35

    neoartur35 New Member

    Cool, it works! So maybe this change needs to be kept for next release?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, I will add it in the next release. But as mentioned, it does not solve the underlying issue which I don't know, it just prevents PHP from issuing a 500 error.
     

Share This Page