1 (edited by LuizC 2021-05-14 01:40:06)

Topic: iRedMail, Ngix and Tomcat

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2
- Deployed with iRedMail Easy or the downloadable installer? iRedMailEasy
- Linux/BSD distribution name and version: Ubuntu 18.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGsql
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Friends,

I had a fully functional install of iRedMail on Nginx running flawlesslly. But for some reasons, some days ago, I had to start using Apache Tomcat to serve the pages and apps, leaving Nginx as a load balancer.

Now, I can reach https://myserver/iredadmin but I can't reach https://myserver/mail.

Where can I start to dig into make a diagnostic and fix this issue?

Thanks a lot!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2 (edited by schnappi 2021-05-19 10:24:46)

Re: iRedMail, Ngix and Tomcat

Nginx config files can be found here (same as you would expect, /etc/nginx):
https://docs.iredmail.org/file.locations.html#nginx

Roundcube files are found here:
https://docs.iredmail.org/file.locations.html#roundcube

Knowing this you should be able to manually setup Apache to serve the Roundcube files (be careful with permissions when setting up a webserver with Roundcube).

3 (edited by LuizC 2021-05-24 01:09:31)

Re: iRedMail, Ngix and Tomcat

schnappi wrote:

Nginx config files can be found here (same as you would expect, /etc/nginx):
https://docs.iredmail.org/file.locations.html#nginx

Roundcube files are found here:
https://docs.iredmail.org/file.locations.html#roundcube

Knowing this you should be able to manually setup Apache to serve the Roundcube files (be careful with permissions when setting up a webserver with Roundcube).

Thanks for your kind response, but I already had take a look at this info but and it didn't help.

I tried to make my own setup, I renamed roundcube files at /etc/nginx/templates to avoid it be loaded and write this in /etc/nginx/sites-available/00-default-ssl.conf:


  location /mail {
          root /opt/www/roundcubemail-1.4.6/;
           index index.php index.html index.htm;
           location ~ ^/mail/(.+\.php)$ {
                   try_files $uri =404;
                   root /opt/www/roundcubemail-1.4.6/;
                   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;

                   fastcgi_param   REDIRECT_STATUS         200;

                   fastcgi_pass unix:/var/run/php5-fpm.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 ~* ^/mail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                   root /opt/www/roundcubemail-1.4.6/;
           }
           location ~* /.svn/ {
                   deny all;
           }
           location ~* /README|INSTALL|LICENSE|SQL|bin|CHANGELOG$ {
                   deny all;
           }

    }

---------------------------------------------------------------------------

But it didn't work. As "mydomain.com/iredmail" is still reachable, I tried to mimic it's configuration file, but it obviously failed.

If you have a clue, it will be highly appreciated :-)

Thanks again,

LuizC

4 (edited by schnappi 2021-05-25 11:15:58)

Re: iRedMail, Ngix and Tomcat

Don't know anything about Tomcat config files. However, in order for Tomcat to listen on port 80 and 443 Nginx has to be listening on other ports. Have you disabled Nginx or set Nginx to listen on other ports?