1

Topic: RoundCube at mail.example.com instead of mail.example.com/mail

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.6
- Linux/BSD distribution name and version: Debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
====

Hello

I have a question regarding whether it is possible to have RoundCube at mail.example.com instead of mail.example.com/mail, and, as I have now, still redirect people to another site if they go to example.com.

Best regards,
Frederik

----

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

2

Re: RoundCube at mail.example.com instead of mail.example.com/mail

Add a new web host for "mail.example.com", set its document root to Roundcube directory.

3

Re: RoundCube at mail.example.com instead of mail.example.com/mail

Thank you for the fast answer.

I understand how to set it up now, however, I am not able to find the document root for RoundCube. I used the standard installer, and I am not able to find any guidance on the default document root for RoundCube.

Do you know where I should be looking for it, because there isn't one in /var/www/html.

Best regards,
Frederik

4 (edited by fdj 2017-02-16 05:50:07)

Re: RoundCube at mail.example.com instead of mail.example.com/mail

Hello

I found the document root, however, I still can't get it to work. I have the following nginx file which should lead example.com to /var/www/html and mail.example.com to /opt/www/roundcubemail. Can anyone tell why my mail still is on mail.example.com/mail instead of mail.example.com?

# Default server configuration
#
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name example.com;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    include snippets/fastcgi-php.conf;
    #
    #    # With php5-cgi alone:
    #    fastcgi_pass 127.0.0.1:9000;
    #    # With php5-fpm:
    #    fastcgi_pass unix:/var/run/php5-fpm.sock;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny all;
    #}
}


# The above were for example.com, this is for mail.example.com
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /opt/www/roundcubemail;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name mail.example.com;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    include snippets/fastcgi-php.conf;
    #
    #    # With php5-cgi alone:
    #    fastcgi_pass 127.0.0.1:9000;
    #    # With php5-fpm:
    #    fastcgi_pass unix:/var/run/php5-fpm.sock;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny all;
    #}
}

5

Re: RoundCube at mail.example.com instead of mail.example.com/mail

Note: iRedMail generates /var/www/html/index.html with a page redirection, please open this file and check whether this is the one generated by iRedMail. You may want to rename/remove this file for testing.