View Single Post
  #5  
Old 6th January 2013, 00:41
tahunasky tahunasky is offline
Member
 
Join Date: Jul 2012
Location: Buenos Aires
Posts: 84
Thanks: 1
Thanked 9 Times in 9 Posts
Default

I create my own apache webmail redirection - which uses the default created subdomain mail.

Quote:
#/etc/httpd/conf/sites-available/_default.conf
<VirtualHost *:80>
ServerName mail.mydomain.com
ServerAlias mail.*
DocumentRoot /opt/squirrelmail.devel

<Directory /opt/squirrelmail.devel>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>
</VirtualHost>

<VirtualHost *:443>
ServerName mail.mydomain.com
ServerAlias mail.*
DocumentRoot /opt/squirrelmail.devel
ServerAdmin me@mydomain.com

SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/server.crt
SSLCertificateKeyFile /etc/pki/tls/private/server.key
ErrorLog /var/log/httpd/squirrelmail-error_log
CustomLog /var/log/httpd/squirrelmail-access_log common

<Directory /opt/squirrelmail.devel>
Options +FollowSymLinks
Order allow,deny
allow from all
</Directory>

</VirtualHost>
Then i create a symbolic link in /etc/httpd/conf/sites-enabled to the _default.conf

What it does - for any sub-domain (i host a few virtual domains) of mail it gets redirected to my squirrelmail ( i have used roundcube too but its slow compared to sqm) and ssl used. I prefer this to mydomain.com/squirrelmail.


OR you can just create a roundcube.conf like this:

Quote:
#/etc/httpd/conf.d/roundcube.conf

Alias /roundcube /opt/roundcubemail-0.8.0
Alias /rc /opt/roundcubemail-0.8.0

<Directory /opt/roundcubemail-0.8.0>
Options +FollowSymLinks
Order allow,deny
allow from all

RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>
This will work when someone users youdomain.com/roundcube or youdomain.com/rc. Change /opt/roundcubemail-0.8.0 to the directory where you have installed it.

Remember to restart httpd to make changes take effect.

Last edited by tahunasky; 6th January 2013 at 04:52.
Reply With Quote