Page 1 of 2

https://domain.com/webmail gives http 500 error

Posted: Sun Jun 21, 2020 5:16 am
by SanTi
I can not enter to roundcube mail server on my VPS. I could not solve the problem. It looks like a database related problem but I dont know exactly what

Log error

Code: Select all

PHP message: PHP Warning:  file_put_contents(/usr/share/errors.log): failed to open stream: Permission denied in /usr/share/roundcubemail/program/lib/Roundcube/rcube.php on line 1308 PHP message: PHP Warning:  Configuration error. Unsupported database driver:  in /usr/share/roundcubemail/program/lib/Roundcube/rcube.php on line 1419

This is my /etc/roundcubemail/config.inc.php file

Code: Select all

<?php

$config = array();
$config['db_dsnw'] = 'mysql://roundcube:OPsv4......@localhost/roundcube';
$config['default_host'] = 'localhost';

$config['smtp_server'] = '';
$config['smtp_port'] = 25;
$config['smtp_user'] = '';
$config['smtp_pass'] = '';
$config['support_url'] = '';

$rcmail_config['log_dir'] = '/var/log/roundcubemail/';
$rcmail_config['temp_dir'] = '/tmp';
$rcmail_config['force_https'] = false;
$rcmail_config['use_https'] = false;
$rcmail_config['login_autocomplete'] = 0;
$rcmail_config['drafts_mbox'] = 'Drafts';
$rcmail_config['junk_mbox'] = 'Spam';
$rcmail_config['sent_mbox'] = 'Sent';
$rcmail_config['trash_mbox'] = 'Trash';
$rcmail_config['default_folders'] = array('INBOX', 'Drafts', 'Sent', 'Spam', 'Trash');
$rcmail_config['create_default_folders'] = true;
$rcmail_config['protect_default_folders'] = true;
$rcmail_config['enable_spellcheck'] = true;
$rcmail_config['spellcheck_dictionary'] = false;
$rcmail_config['spellcheck_engine'] = 'googie';
$rcmail_config['default_charset'] = 'UTF-8';
$rcmail_config['delete_junk'] = true;

$config['product_name'] = 'Roundcube Webmail';
$config['des_key'] = 'rcmail-!24ByteDESkey*Str';

$config['plugins'] = array(
    'archive',
    'zipdownload',
    'password',
);

$config['skin'] = 'larry';

Re: https://domain.com/webmail gives http 500 error

Posted: Sun Jun 21, 2020 3:39 pm
by peters
This seems like a file permission problem as you can read from the error message. Check your file permissions within /usr/share/roundcubemail (all files should be owned by root and file permissions should be 644)

Re: https://domain.com/webmail gives http 500 error

Posted: Sun Jun 21, 2020 4:15 pm
by SanTi
All of them has that permission. Folder has 755 and files 644. I have created errors.log by manual inside of /usr/share and now it gives database error now.

I can use webmail before upgrade. Now it gives me DB error.

Code: Select all

/usr/share/roundcubemail/program/lib/Roundcube/rcube_db.php
84 line gives error.

Code: Select all

    public static function factory($db_dsnw, $db_dsnr = '', $pconn = false)
    {
        $driver     = strtolower(substr($db_dsnw, 0, strpos($db_dsnw, ':')));
        $driver_map = array(
            'sqlite2' => 'sqlite',
            'sybase'  => 'mssql',
            'dblib'   => 'mssql',
            'mysqli'  => 'mysql',
            'oci'     => 'oracle',
            'oci8'    => 'oracle',
        );

        $driver = isset($driver_map[$driver]) ? $driver_map[$driver] : $driver;
        $class  = "rcube_db_$driver";

        if (!$driver || !class_exists($class)) {
            rcube::raise_error(array('code' => 600, 'type' => 'db',
                'line' => __LINE__, 'file' => __FILE__,
                'message' => "Configuration error. Unsupported database driver: $driver"),
                true, true);
        }

        return new $class($db_dsnw, $db_dsnr, $pconn);
    }
line 84 gives error.

Code: Select all

'line' => __LINE__, 'file' => __FILE__,
                'message' => "Configuration error. Unsupported database driver: $driver"),

Re: https://domain.com/webmail gives http 500 error

Posted: Sun Jun 21, 2020 4:37 pm
by peters
Could you verify that php-sql is installed properly?

Re: https://domain.com/webmail gives http 500 error

Posted: Sun Jun 21, 2020 7:55 pm
by SanTi
My Mariadb version 10.4.13-MariaDB

Image


My php version 7.4.7

Image


webmail installer check status

Image

Re: https://domain.com/webmail gives http 500 error

Posted: Sun Jun 21, 2020 9:04 pm
by peters
Could also be a problem with suexec. Is there something in /var/log/httpd/suexec.log ? Are you able to connect to the roundcube database from the command line through mysql console?

Slightly I'm running out of ideas and suggest to reinstall the VPS from scratch and give it a try if thats possible.

Re: https://domain.com/webmail gives http 500 error

Posted: Sun Jun 21, 2020 9:21 pm
by SanTi
I don't use Apache. I use nginx and the problem is not about it. Also changes on my config.inc.php file at /etc/roundcube/ does not effect anything. Is it active of inactive? I don't know. Reisntallinh and carrying all files etc. is very boring solve.

Re: https://domain.com/webmail gives http 500 error

Posted: Sun Jun 21, 2020 9:26 pm
by peters
SELinux disabled?

Re: https://domain.com/webmail gives http 500 error

Posted: Sun Jun 21, 2020 9:50 pm
by SanTi
How can I learn it?

I used "getenforce" and it says permissive.

Re: https://domain.com/webmail gives http 500 error

Posted: Sun Jun 21, 2020 9:52 pm
by peters
Log in to your server

Check the current SELinux status, run: sestatus

To disable SELinux on CentOS 7 temporarily, run: sudo setenforce 0

Edit the /etc/selinux/config file and set the SELINUX to disabled

Reboot the Linux server
Verify it by running the sestatus and getenforce again