Page 1 of 1

Roundcube (webmail) under ssl subdomain

Posted: Tue Jul 25, 2017 8:44 am
by dborowski
Hi guys!

Great work on VestaCP - to say first! It's a great little control panel.

I stumbled upon setting Roundcube under a subdomain with ssl. To picture this:

- I have a domain example.com
- the webmail is accessed by http://example.com/webmail
- I would like it to be accessed through https://webmail.example.com
- this should also work for any other domain

I have searched and read a couple of things:

- viewtopic.php?f=12&t=5832&p=36629&hilit ... ain#p36629
- viewtopic.php?f=12&t=8925&p=36627#p36627

But nothing seems to work, I guess these posts are just too old for a recent version of VestaCP.

- I have also tried to setup an nginx reverse proxy to /webmail

Code: Select all

server {
  listen  45.55.84.251:80;
  server_name webmail.*;

  return 301 https://$host/webmail;
}

server {
  listen      45.55.84.251:443;
  server_name webmail.*;

  location / {
    proxy_pass http://$host/webmail/;
  }
}
But that creates too many redirects issue

The documentation does not explain in detail how the whole vhost/web configuration is setup, and so it is difficult to understand where to go to change stuff. I've read something on the templates, but as said - it didn't seem to work.

My Vesta setup:
- Ubuntu 16.04
- VestaCP 0.9.8

Thanks in advance for an help with this.

Re: Roundcube (webmail) under ssl subdomain

Posted: Fri Jul 28, 2017 6:11 am
by gecube_ru
Hello!

You need no proxy_pass :-)

I have idea to make it in some way. I'm not sure that it is best though

Open Web management in Vesta and create domain for roundcube domain (webmail.example.com).
You may create also DNS record under main domain or order to Vesta to make separate record for subdomain in DNS panel. The main idea is that webmail.example.com must point to IP of the server.
Then - go to httpd configuration of webmail.example.com
Unfortunately it won't be in separate file. Usually it will be located in /home/<username>/conf/web/httpd.conf
Find the section for RC. Cut it off (don't touch other domains sections!) and paste the /etc/httpd/conf.d/roundcubemail.conf there. Restart the httpd.
If you like what you got, you may make new template for RC to save the changes (because if somebody changes the parameters for this users, the httpd.cong will be rewritten from templates).

The next step is to set up nginx in Web panel with SSL connection (just check necessary checkboxes).

I have installed on the VestaCP server another two great web-panels for WebMail: squirellmail and rainloop