Author Topic: https://domain.com/webmail gives http 500 error  (Read 5973 times)

Offline aliooo

  • Newbie
  • *
  • Posts: 5
https://domain.com/webmail gives http 500 error
« on: June 21, 2020, 03:22:26 AM »
I can not enter to roundcube mail server on my VPS. I use VestaCP Web Panel.  I could not solve the problem. It looks like a database related problem but I dont know exactly what it.

VPS:  CENTOS 7 + VestaCP +NGINX + PHP-FPM + PHP 7.4.7 + 10.4.13-MariaDB

Log error
Code: [Select]
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]
<?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';
« Last Edit: June 21, 2020, 05:02:08 AM by aliooo »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: https://domain.com/webmail gives http 500 error
« Reply #1 on: June 21, 2020, 06:18:20 AM »
Are sure that /etc/roundcubemail/config.inc.php is really the config file? the error message suggests may be its not.

I guess you have upgraded from an earlier version of Roundcube and that is why you are mixing $config and $rcmail_config in your config file. just use $config. Did everything go ok during the upgrade?

If you are using a packaged version of Roundcube provided by VestaCP then you should try their community for support as they could have customised it. By default the config file will be in <roundcube root>/config/config.inc.php

Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline aliooo

  • Newbie
  • *
  • Posts: 5
Re: https://domain.com/webmail gives http 500 error
« Reply #2 on: June 21, 2020, 07:02:40 AM »
I can use webmail before upgrade. Now it gives me DB error.

rcube_db.php 84 line gives error.

Code: [Select]
    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]
'line' => __LINE__, 'file' => __FILE__,
                'message' => "Configuration error. Unsupported database driver: $driver"),
« Last Edit: June 21, 2020, 12:13:41 PM by aliooo »

Offline aliooo

  • Newbie
  • *
  • Posts: 5
Re: https://domain.com/webmail gives http 500 error
« Reply #3 on: June 21, 2020, 06:23:20 PM »
I have solved problem. I am happy. The problem has caused of file permissions. I tink file permissions was changed after upgrade or another reason that I dont know.

I chandeg file permissions of /etc/roundcube/config.inc.php , /etc/roundcube/defaults.inc.php and /etc/roundcube/mimetypes.php from 640 to 644 and now it is working. Yes you were right. config.inc.php was not seen webserver etc. because of file permissions. Thus it was giving error.

I have solved the problem now by changing file permissions.