1

Topic: Can't get to roundcube login after installing letsencrypt

I installed  0.9.9 on centos7, with nginix, mysql  no problems and then ran the letsencypt with iredmail procedure and I got the certificate error to go away and now I can't get to roundcube since it is pointing to the wrong place now.  What should the root be set to?

root         /opt/www/roundcubemail/index.php;

I get this error message

2019/03/14 23:10:26 [error] 1929#0: *30 "/opt/www/roundcubemail/index.php/index.html" is not found (20: Not a directory), client: 96.86.87.206, server: mail.livesentinel.io, request: "GET / HTTP/1.1", host: "mail.livesentinel.io"
2019/03/14 23:10:26 [error] 1929#0: *30 open() "/opt/www/roundcubemail/index.php/404.html" failed (20: Not a directory), client: 96.86.87.206, server: mail.livesentinel.io, request: "GET / HTTP/1.1", host: "mail.livesentinel.io"

nginx.conf follows

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        server_name  mail.livesentinel.io;
        root         /opt/www/roundcubemail/index.php;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/mail.livesentinel.io/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mail.livesentinel.io/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
# Settings for a TLS enabled server.
#
#    server {
#        listen       443 ssl http2 default_server;
#        listen       [::]:443 ssl http2 default_server;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        ssl_certificate "/etc/pki/nginx/server.crt";
#        ssl_certificate_key "/etc/pki/nginx/private/server.key";
#        ssl_session_cache shared:SSL:1m;
#        ssl_session_timeout  10m;
#        ssl_ciphers HIGH:!aNULL:!MD5;
#        ssl_prefer_server_ciphers on;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        location / {
#        }
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }



    server {
    if ($host = mail.livesentinel.io) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  mail.livesentinel.io;
    return 404; # managed by Certbot


}}

--More--(29%)


[root@vpn roundcubemail]# cat /etc/iredmail-release
0.9.9 MARIADB edition.

downloaded installer
centos 7

mariadb

nginx

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

Thanks,

Kevin

2

Re: Can't get to roundcube login after installing letsencrypt

I don't understand why there's such mess by following our tutorial sad
Our tutorial uses command `certbot certonly ...` to just get the cert without modify any Nginx config files.

- your /etc/nginx/nginx.conf is totally messed, this is not what iRedMail generated.
- Did you backup old nginx config files? any chance to restore them?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: Can't get to roundcube login after installing letsencrypt

I will have to nuke it and start over.  I didn't back it up.  I thought it would be an  easy fix in the nginx.conf file.  Thanks, Kevin




ZhangHuangbin wrote:

I don't understand why there's such mess by following our tutorial sad
Our tutorial uses command `certbot certonly ...` to just get the cert without modify any Nginx config files.

- your /etc/nginx/nginx.conf is totally messed, this is not what iRedMail generated.
- Did you backup old nginx config files? any chance to restore them?