[SOLVED] - [db error] ISPConfig - RoundCube in multiserver

Discussion in 'Plugins/Modules/Addons' started by MikySal78, Jun 10, 2016.

  1. MikySal78

    MikySal78 New Member

    i have been following this howto for installing ISPCOnfig in multi server
    https://www.howtoforge.com/multiser...servers-on-debian-squeeze-with-ispconfig-3-p6

    and this howto for roundcube
    https://www.howtoforge.com/tutorial/roundcube-installation-on-debian-8-jessie/

    in my webmail.domain.tld am this "messages"

    DATABASE ERROR: CONNECTION FAILED!
    Unable to connect to the database!
    Please contact your server-administrator.

    in my config of roundcube am cheked 2 tests:

    $config['db_dsnw'] = 'mysql://roundcube:[email protected]/roundcubemail';
    or
    $config['db_dsnw'] = 'mysql://roundcube:[email protected]/roundcubemail';

    no working!
    because?

    thanks!
     
  2. Jesse Norell

    Jesse Norell Active Member

    I followed that first tutorial, and mixed in https://www.howtoforge.com/tutorial...8-4-jessie-apache-bind-dovecot-ispconfig-3-1/, then finished with that rouncube tutorial as well, so pretty close setup I'm guessing. I installed roundcube from jessie-backports though, which took care of the database setup via:

    Code:
    # cat /etc/roundcube/debian-db-roundcube.php
    <?php
    include_once("/etc/roundcube/debian-db.php");
    
    switch ($dbtype) {
    case "sqlite":
    case "sqlite3":
       $config['db_dsnw'] = "sqlite:///$basepath/$dbname?mode=0640";
       break;
    default:
       if ($dbport != '') $dbport=":$dbport";
       if ($dbserver == '') $dbserver="localhost";
       $config['db_dsnw'] = "$dbtype://$dbuser:$dbpass@$dbserver$dbport/$dbname";
       break;
    }
    ?>
    Code:
    # cat /etc/roundcube/debian-db.php
    <?php
    ##
    ## database access settings in php format
    ## automatically generated from /etc/dbconfig-common/roundcube.conf
    ## by /usr/sbin/dbconfig-generate-include
    ## Fri, 20 May 2016 11:25:22 -0400
    ##
    ## by default this file is managed via ucf, so you shouldn't have to
    ## worry about manual changes being silently discarded.  *however*,
    ## you'll probably also want to edit the configuration file mentioned
    ## above too.
    ##
    $dbuser='roundcube';
    $dbpass='blahblahblah';
    $basepath='';
    $dbname='roundcube';
    $dbserver='';
    $dbport='';
    $dbtype='mysql';
    
    Which should result in:
    Code:
    $config['db_dsnw'] = "mysql://roundcube:[email protected]/roundcube";
     
  3. MikySal78

    MikySal78 New Member

    CUT

    roundcube work your multserver?

    I testing this comand on server db.domain.tld
    UPDATE mysql.user SET Host='%' WHERE Host='localhost' AND User='roundcube';
    FLUSH PRIVILEGES;

    but no working!
     
  4. MikySal78

    MikySal78 New Member

    in my server mail, i dont'installed dovecot-mysql. after install...it's ok!
    I'm defined variables:
    $config['default_host'] = 'mail.mydomain.tld';
    $config['smtp_server'] = 'mail.mydomain.tld';
     
  5. Samo_slo

    Samo_slo Member

    I have the same problem... only i installed on Ubuntu 14.04 server. One question where did you install RoundCube, on the master web server that runs the ISPConfig interface or on the mail server? And on which server did you install the ISPConfig plugin?
    I can get roundcube working on single server setup but not on multiserver.
     
  6. Jesse Norell

    Jesse Norell Active Member

    Roundcube is a web app, so it must run on a web server. The ISPConfig plugin for roundcube would be installed everywhere roundcube is. In a multi-server setup, the mail server probably doesn't have a web server, so you won't normally install roundcube there. Any, or all, webserver nodes are candidates to run it, as is the ispconfig control panel node itself.

    You could run it on a dedicated subdomain so that it always redirects to SSL (don't want your passwords sent in the clear). You could also setup access to it from each client domain at /roundcube/ or /webmail/ or even webmail.clientdomain.com - just make sure it redirects to an SSL url, either at the same domain if it has a certificate (eg. letsencrypt), or at your dedicated subdomain if not.
     
    Samo_slo likes this.
  7. Thaddeus

    Thaddeus New Member HowtoForge Supporter

    A related issue, I have setup client webmail access as https://domain.com/webmail. It works fine if the client has php as fastcgi but with php-fpm it shows an error, 'File not found'. Is this a permission issue?
     
  8. Jesse Norell

    Jesse Norell Active Member

    How/where is your /webmail alias defined, @Thaddeus? I just tested and fastcgi, php-fpm and hhvm all work (on https url) for me. I installed roundcube as described above, and created this alias for /webmail:
    Code:
    # cat /etc/apache2/conf-enabled/local.conf
    
    Alias /webmail /var/lib/roundcube
    
     
  9. Thaddeus

    Thaddeus New Member HowtoForge Supporter

    Hi here is my /etc/httpd/conf.d/roundcube.conf

    Centos 7 apache 2.4
    Code:
    Alias /roundcubemail /usr/share/roundcubemail
    Alias /webmail /usr/share/roundcubemail
    <Directory /usr/share/roundcubemail/>
            Options none
            AllowOverride Limit
            Require all granted
    </Directory>
    # Define who can access the installer
    # keep this secured once configured
    
    <Directory /usr/share/roundcubemail/installer/>
        <IfModule mod_authz_core.c>
            # Apache 2.4
            Require local
        </IfModule>
        <IfModule !mod_authz_core.c>
            # Apache 2.2
           Order Deny,Allow
            Deny from all
            Allow from 127.0.0.1
            Allow from ::1
        </IfModule>
    </Directory>
    <Directory /usr/share/roundcubemail/installer/>
        <IfModule mod_authz_core.c>
            # Apache 2.4
           Require local
       </IfModule>
    <IfModule !mod_authz_core.c>
            # Apache 2.2
            Order Deny,Allow
            Deny from all
           Allow from 127.0.0.1
            Allow from ::1
        </IfModule>
    </Directory>
    
     

Share This Page