1

Topic: Change domain.com/mail to mail.domain.com

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Linux/BSD distribution name and version: CentOS 7
- Related log if you're reporting an issue:
====

Hi,
I have searched for an answer to this question but I cannot find it.

I would like to change the location used to access the web mail.  Currently it is www.domain.com/mail  (default settings)
I would like to change this to either mail.domain.com or webmail.domain.com

I have my DNS set up correctly.  When I put a new <VirtualHost> in my appache config it does not work correctly.

This is my current (not working) appache config

<VirtualHost *:80>
  ServerName mail.domain.com
  DocumentRoot /var/www/roundcubemail
</VirtualHost>

<VirtualHost *:443>
  ServerName mail.domain.com
  DocumentRoot /var/www/roundcubemail
</VirtualHost>

----

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

2

Re: Change domain.com/mail to mail.domain.com

Could you give a little bit more detail than it is not working?

3

Re: Change domain.com/mail to mail.domain.com

7t3chguy wrote:

Could you give a little bit more detail than it is not working?

Yes, please let me know if you need more than what I provide below.  Thanks!


I have added an apache configuration file /etc/httpd/conf.d/webmail.domain.conf
It contains
<VirtualHost *:80>
  DocumentRoot /var/www/roundcubemail/
  ServerName webmail.domain.com
</VirtualHost>

<VirtualHost *:443>
  DocumentRoot /var/www/roundcubemail/
  ServerName webmail.domain.com
</VirtualHost>


After I restart apache I attempt to go to either http://webmail.domain.com or httpS://webmail.domain.com in firefox and I am met with this error:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.


Logs from the server side
/var/log/httpd/access_log
1.1.1.1 - - [23/Feb/2015:11:27:03 -0500] "GET / HTTP/1.1" 302 - "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0"

The line above is repeated 10 times, I'm not sure but it looks like it is stuck in a redirect loop?


I do not see an entry in any other logs in /var/log/httpd when I try and access webmail.domain.com only access_log.

Please let me know if you need any other information. Thanks!

4

Re: Change domain.com/mail to mail.domain.com

Can you show the content of all the configuration files within /etc/httpd/

5

Re: Change domain.com/mail to mail.domain.com

Btw, Apache might have issues with your config as in the :443 [SSL] segment you're not specifying SSL Details

6

Re: Change domain.com/mail to mail.domain.com

I've no idea without playing with it myself, I've switched to NGinx lately and while trivial to configure I find it better

7 (edited by syntaxerorr 2015-02-24 02:18:17)

Re: Change domain.com/mail to mail.domain.com

I would love to hear form anyone else that might know how to set the web mail access location to http://webmail.domain.com  and not use http://domain.com/mail

I'm not sure what I am doing wrong.  I want to have website(s) hosted on this server along with it being an email server.

8

Re: Change domain.com/mail to mail.domain.com

OK. I have figured some of my problem.  I have added a virtual host for a website I would like to host on this server by doing:
<VirtualHost *:80>
  DocumentRoot /var/www/domain.com
  ServerName www.domain.com
</VirtualHost>

Everything works fine at this point.  When I add a virtual host for a httpS connection it breaks my /mail alias.
<VirtualHost *:443>
  DocumentRoot /var/www/domain.com
  ServerName www.domain.com
</VirtualHost>

Now my question is how can I add a virtual httpS host and not break my web mail at domain.com/mail ?

9

Re: Change domain.com/mail to mail.domain.com

I have fixed my issue.

I was missing my SSL options for my virtual hosts on port 443.

Thanks for you input 7t3chguy you led me down the correct path to fix!