For CentOS 6.3 what i have done, is when a user types in mail.domain.com (or mail.domain1.com, mail.domain2.com etc) it goes to roundcube, but can be the same for squirrelmail.
Create a DNS mail CNAME record for each domain you want to redirect the subdomain mail to squirrelmail. I think ispconfig automatically makes an A record for mail, but if you are going to the same IP address i prefer the CNAME as if i change the IP address i dont need to change every subdomains records IP address, just the main domain A record..
SO in DNS create the CNAME record.
Code:
CNAME mail domain.com.
then create a file as below:
/etc/httpd/conf/sites-available/_default.vhost
Code:
<VirtualHost *:80>
ServerName mail.domain.com
ServerAlias mail.*
DocumentRoot /usr/lib/squirrelmail
ServerAdmin webmaster@domain.com
# put the below 3 lines if you require SSL connectiom
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^mail(.*) https://mail.{HTTP_HOST}
</VirtualHost>
# the below section is only need if you have above 3 lines and want SSL
<VirtualHost *:443>
ServerName mail.domain.com
ServerAlias mail.*
ServerAdmin webmaster@domain.com
DocumentRoot /usr/lib/squirrelmail
SSLEngine On
SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
</VirtualHost>
then i create a link to the /etc/httpd/conf/sites-enabled/ directory:
Code:
ln -s /etc/httpd/conf/sites-available/_default.vhost /etc/httpd/conf/sites-enabled/000-default.vhost
this way it doesnt matter what domain is used, if the put in the mail subdomain they will all go to the same place, and any new domains you add with the mail subdomain will also be sent to squirrelmail without any extra configuring.
Recent comments
2 days 19 hours ago
3 days 4 hours ago
3 days 7 hours ago
3 days 8 hours ago
3 days 9 hours ago
3 days 11 hours ago
3 days 12 hours ago
3 days 14 hours ago
4 days 5 hours ago
4 days 6 hours ago