Webmail issues after setting up new server using the auto-script

Discussion in 'ISPConfig 3 Priority Support' started by DylanPedro, Jan 19, 2021.

  1. DylanPedro

    DylanPedro Member HowtoForge Supporter

    I used the ISPConfig official installer on a new Debian server.

    I've setup a mail account but cannot access webmail when using the mail icon in the admin panel. It goes to the following:
    https://server2.serverdomain.co.uk:8080/webmail
    and gives the following error:
    Code:
    404 Not Found
    nginx/1.14.2
    I've tried the following:
    https://server2.serverdomain.co.uk:8081/webmail
    and it redirects to:
    https://server2.sitsuk.co.uk:8081/squirrelmail/

    I didnt choose to install squirrelmail in the auto script so it should be going to roundcube?
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You can change the URL that it goes to under System -> Main Config -> Mail
     
  3. DylanPedro

    DylanPedro Member HowtoForge Supporter

  4. DylanPedro

    DylanPedro Member HowtoForge Supporter

    Like I said I used the official auto installer and only changed the option to install nginx instead of apache. The /etc/nginx/sites-available/apps.vhost file (attached) shows no entries for Roundcube?
     

    Attached Files:

  5. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    What you experienced is basically what you set up in the apps.vhost (by not modifying it). The relevant part of your posted apps.vhost read as follows:
    Code:
            location /squirrelmail {
                   root /usr/share/;
                   index index.php index.html index.htm;
                   location ~ ^/squirrelmail/(.+\.php)$ {
                           try_files $uri =404;
                           root /usr/share/;
                           fastcgi_param   QUERY_STRING            $query_string;
                           fastcgi_param   REQUEST_METHOD          $request_method;
                           fastcgi_param   CONTENT_TYPE            $content_type;
                           fastcgi_param   CONTENT_LENGTH          $content_length;
    
                           fastcgi_param   SCRIPT_FILENAME         $request_filename;
                           fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
                           fastcgi_param   REQUEST_URI             $request_uri;
                           fastcgi_param   DOCUMENT_URI            $document_uri;
                           fastcgi_param   DOCUMENT_ROOT           $document_root;
                           fastcgi_param   SERVER_PROTOCOL         $server_protocol;
    
                           fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
                           fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;
    
                           fastcgi_param   REMOTE_ADDR             $remote_addr;
                           fastcgi_param   REMOTE_PORT             $remote_port;
                           fastcgi_param   SERVER_ADDR             $server_addr;
                           fastcgi_param   SERVER_PORT             $server_port;
                           fastcgi_param   SERVER_NAME             $server_name;
    
                           fastcgi_param   HTTPS                   $https;
    
                           # PHP only, required if PHP was built with --enable-force-cgi-redirect
                           fastcgi_param   REDIRECT_STATUS         200;
                           # To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
                           #fastcgi_pass 127.0.0.1:9000;
                           fastcgi_pass unix:/var/lib/php7.3-fpm/apps.sock;
                           fastcgi_index index.php;
                           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                           fastcgi_buffer_size 128k;
                           fastcgi_buffers 256 4k;
                           fastcgi_busy_buffers_size 256k;
                           fastcgi_temp_file_write_size 256k;
                   }
                   location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                           root /usr/share/;
                   }
            }
            location /webmail {
                   rewrite ^/* /squirrelmail last;
            }
    
    This part of apps.vhost code shows that if you type your.domain.tld:8081/webmail it will definitely be rewritten to your.domain.tld:8081/squirrelmail.

    If you want something different like webmail in the browser, you will have to modify the apps.vhost accordingly, and do some proper symlink too, because what is shown in the PST for Debian 10 Nginx is a mere example only.

    There are mistakes in there of course, between what are shown in there, the command run and the real directory being used in the apps.vhost.

    So, if you really want to use /webmail, for example, the correct command will be "ln -s /usr/share/roundcube /usr/share/webmail" or run another command "ln -s /usr/share/squirrelmail /usr/share/webmail" (either or, not both), while in the apps.vhost, you will need to change all occurrences of squirrelmail word to webmail and one occurence of webmail to squirrelmail.

    Of course, as advised various times in various posts and threads, to customize, you will need to copy nginx_apps.vhost.master to conf-custom and conf-custom/install and modify it in there.

    To note, auto installer follow the code in the tutorial, that is why I have to explain based on the PST and the apps.vhost master (nginx_apps.vhost.master) as it really need some clean ups, if not fixes.
     
    Last edited: Jan 20, 2021
  6. DylanPedro

    DylanPedro Member HowtoForge Supporter

    So I'm trying to fix this myself using different posts around the forum...
    1. First error I received was:
      Code:
      CONFIGURATION ERROR
      config.inc.php was not found.
      Please read the INSTALL instructions!
      Got rid of this by changing:
      /etc/roundcube/config.inc.php from 0640 to 0644
    2. Now there is the following error in: /var/log/nginx/error.log
      Code:
      2021/01/19 17:52:05 [error] 811#811: *2610 FastCGI sent in stderr: "PHP message: PHP Warning:  include_once(/etc/roundcube/debian-db.php): failed to open stream: Permission denied in /etc/roundcube/debian-db-roundcube.php on line 2PHP message: PHP Warning:  include_once(): Failed opening '/etc/roundcube/debian-db.php' for inclusion (include_path='/var/lib/roundcube/program/lib:.:/usr/share/php:/usr/share/roundcube/program/lib') in /etc/roundcube/debian-db-roundcube.php on line 2PHP 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 1259PHP message: PHP Warning:  Configuration error. Unsupported database driver:  in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1364" while reading response header from upstream, client: 85.136.167.208, server: _, request: "GET /squirrelmail/ HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.3-fpm/apps.sock:", host: "server2.serverdomain.co.uk:8081"
    3. Seeing the following in the roundcube log:
      Code:
      [19-Jan-2021 18:50:22 +0000]: DB Error: Configuration error. Unsupported database driver:  in /usr/share/roundcube/program/lib/Roundcube/rcube_db.php on line 84 (GET /squirrelmail/)
     
    Last edited: Jan 19, 2021
  7. DylanPedro

    DylanPedro Member HowtoForge Supporter

  8. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Probably; the autoinstaller already goes beyond the perfect server guides in adding php versions, so it seems reasonable that if it installed roundcube as the webmail that it would function when done, even if the perfect server guides have some deficiencies in that regard. Feel free to create issues in the tracker under that project for things that are left out or need corrected. I don't know the best place to file issues with corrections for the guides, maybe comments there, or right here in the forums?
     
  9. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Me too. It seems the forum is best and not the git, unless tutorial contents are also in the git and can be MR or fix in there too, well, is the last suggestion workable?
     
  10. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    They are not, currently. There's been discussion of what format/platform to post documentation for exactly this reason (user contributions), but I don't believe there's any course set yet for what that will be.
     

Share This Page