Roundcube-Configuration Error - config.inc.php was not found.

Discussion in 'Installation/Configuration' started by George321, Jan 26, 2017.

  1. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    hmm chmod 644 to a file containing a password is generally a bad idea, everyone can access it to read now.
    Better check the user/group the php-process is running at and give proper ownership to the file.

    You might also check wether all features are working if you use zip-download for example or save attachements on server
     
  2. Sion.Savior

    Sion.Savior New Member

    OK i Changed everthing back to the old permissions (because now i know whats the problem is) and changed the group id.. i dont know why but the debian db file had only root:root. i changed it to (group)www-data:root(owner) and it works with the old permissions.
     
  3. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    heh, to take it a step further, check who else is in the group of www-data and check wether they need access to that file ... but yeah

    you could aswell setup a domain with the name of your hostname, this would give you php-fpm running with its own webx clienty and you could give critical files ownership to webx and chmod them 400 so only the user can read it. But that may be another story and if you're happy it works now, that's perfectly fine for me :)

    adding an own vhost/domain would include putting the special nginx-config for roundcube ect. to the nginx extra directives in the website configuration to make it work then
     
    Last edited: Jul 20, 2018
  4. luigi mangili

    luigi mangili New Member

    chmod 0644 /etc/roundcube/config.inc.php
    o better:
    root@debian:/etc/roundcube# ls -la
    totale 108
    drwxr-xr-x 3 root root 4096 ott 24 15:22 .
    drwxr-xr-x 150 root root 12288 ott 24 14:44 ..
    -rw-r--r-- 1 root root 1240 mag 1 23:37 apache.conf
    -rw-r--r-- 1 root root 3582 ott 24 13:29 config.inc.php
    -rw-r--r-- 1 root root 12288 ott 24 15:22 .config.inc.php.swp
    -rw-r--r-- 1 root root 546 ott 24 13:27 debian-db.php
    -rw-r--r-- 1 root root 373 mag 1 23:37 debian-db-roundcube.php
    -rw-r--r-- 1 root root 49062 mag 2 08:53 defaults.inc.php
    -rw-r--r-- 1 root root 1743 mag 2 08:54 htaccess
    -rw-r--r-- 1 root root 491 mag 1 23:37 lighttpd.conf
    -rw-r--r-- 1 root root 2815 apr 17 2016 mimetypes.php
    drwxr-xr-x 15 root root 4096 ott 24 13:27 plugins
    root@debian:/etc/roundcube#

    ....
     
  5. bestia

    bestia New Member

    Thank you SO much ztk.me
    etc. You made my day ! I had the same Roundcube not-sending problem. But after copying tinymce -directory, my installation worked again.
    Cheers
     
  6. fefu

    fefu New Member

    Hi. Thank you ztk.me for the clues. I changed the options in Edit Server config -> Web -> PHP Setings -> PHP open_basedir, but that didn't make any difference, the error[1] persisted.

    I checked the permissions of the php-fpm processes[2] and found user ispapps (number 5002) responsible for php-fpm: pool apps-{fpm_domain}.

    I changed the permissions of roundcube's configuration directory

    Code:
    chgrp ispapps /etc/roundcube/config.inc.php /etc/roundcube/debian-db.php /etc/roundcube/debian-db-roundcube.php /var/lib/roundcube/temp
    chmod 770 /var/lib/roundcube/temp
    
    # ls -l  /etc/roundcube/
    total 84
    -rw-r--r--  1 root root     1269 Dec  8 12:34 apache.conf
    -rw-r-----  1 root ispapps  3828 Dec  7 20:59 config.inc.php
    -rw-r-----  1 root ispapps   524 Dec  7 20:59 debian-db.php
    -rw-r-----  1 root ispapps   373 Nov  9 02:45 debian-db-roundcube.php
    -rw-r--r--  1 root root    51999 Nov  9 02:45 defaults.inc.php
    -rw-r--r--  1 root root     1940 Nov  9 02:45 htaccess
    -rw-r--r--  1 root root      491 Nov  9 02:45 lighttpd.conf
    -rw-r--r--  1 root root     2815 Nov 27  2016 mimetypes.php
    drwxr-xr-x 16 root root     4096 Dec  7 20:59 plugins
    and solved the error

    Code:
    PHP message: PHP Warning:  include_once(): Failed opening '/etc/roundcube/debian-db-roundcube.php' for inclusion (include_path='/var/lib/roundcube/program/lib:.:/usr/share/php:/usr/share/roundcube/program/lib') in /etc/roundcube/config.inc.php on line 23
    I accessed again to htt ps://srv7.server.com:8081/squirrelmail/ with the web-browser and now we see some progress with this message:

    Code:
    DATABASE ERROR: CONNECTION FAILED!
    Unable to connect to the database!
    Please contact your server-administrator.
    It seemed that the user ispapps needed write permissions to /var/log/roundcube, which I granted with:
    Code:
    chown ispapps /var/log/roundcube
    chmod 664 /var/log/roundcube/errors /var/log/roundcube/sendmail
    chgrp ispapps /var/log/roundcube/errors /var/log/roundcube/sendmail
    Now Roundcube seems to be working 'paradoxically' on ht tps://srv7.server.com:8081/squirrelmail/ :)

    Thank you for your attention to detain and this awesome software.


    Server specs: Debian GNU/Linux stretch v9.2 with ISPConfig 3.1.9, MariaDB, postfix, dovecot and nginx

    [1]
    Code:
    tail /var/log/nginx.err
    2017/12/09 00:01:56 [error] 12497#12497: *24 FastCGI sent in stderr: "PHP message: PHP Warning:  include_once(/etc/roundcube/debian-db-roundcube.php): failed to open stream: Permission denied in /etc/roundcube/config.inc.php on line 23
    PHP message: PHP Warning:  include_once(): Failed opening '/etc/roundcube/debian-db-roundcube.php' for inclusion (include_path='/var/lib/roundcube/program/lib:.:/usr/share/php:/usr/share/roundcube/program/lib') in /etc/roundcube/config.inc.php on line 23
    PHP message: PHP Warning:  file_put_contents(/var/log/roundcube/errors): failed to open stream: Permission denied in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1242
    PHP message: PHP Warning:  SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: NO) in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1347
    PHP message: PHP Warning:  file_put_contents(/var/log/roundcube/errors): failed to open stream: Permission denied in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1242
    PHP message: PHP Warning:  SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: NO) in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1347" while reading response header from upstream, client: 130.11.212.22, server: srv7.server.com, request: "GET /squirrelmail/ HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.0-fpm/apps.sock:", host: "srv7.server.com:8081"
    [2]
    Code:
    root@srv7:/etc# ps axjf | grep php
        1 12437 12437 12437 ?           -1 Ss       0   0:00 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
    12437 12438 12437 12437 ?           -1 S     5002   0:00  \_ php-fpm: pool apps-{fpm_domain}
    12437 12439 12437 12437 ?           -1 S     5002   0:00  \_ php-fpm: pool apps-{fpm_domain}
    12437 12440 12437 12437 ?           -1 S     5003   0:00  \_ php-fpm: pool ispconfig
    12437 12441 12437 12437 ?           -1 S     5003   0:00  \_ php-fpm: pool ispconfig
    12437 12442 12437 12437 ?           -1 S     5004   0:00  \_ php-fpm: pool web1
    12437 12443 12437 12437 ?           -1 S     5004   0:00  \_ php-fpm: pool web1
    12437 12444 12437 12437 ?           -1 S       33   0:00  \_ php-fpm: pool www
    12437 12445 12437 12437 ?           -1 S       33   0:00  \_ php-fpm: pool www
    root@srv7:/etc# cat /etc/passwd /etc/group | grep www-
    www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
    www-data:x:33:
    ispapps:x:5003:www-data
    ispconfig:x:5004:www-data
    client1:x:5005:www-data
     
    Last edited: Dec 9, 2017
  7. fefu

    fefu New Member

    I forgot to mention that since www-data is member of group ispapps, this change shouldn't restrict www-data's permissions.

    I also changed roundcube-core logrotate job to create new empty log files with the required permissions.

    Hope this will help.

    Code:
    # cat /etc/logrotate.d/roundcube-core 
    /var/log/roundcube/errors
    /var/log/roundcube/sendmail
    /var/log/roundcube/session
    /var/log/roundcube/userlogins
    {
      create 0640 ispapps adm
      compress
      delaycompress
      missingok
      notifempty
      rotate 52
      weekly
    }
    
     
  8. fefu

    fefu New Member

    This post is related to an issue[1] I've found after solving this problem.

    [1] h ttps://git.ispconfig.org/ispconfig/ispconfig3/issues/4628
     

Share This Page