Hi, I have an issue with Apache Virtual hosts. I installed a web server and mail server. Apache, PHP, MySQL and Postfix Dovecot ClamAV Amadis Spamassasin a RoundCube for Webmail on a Centos 6 box. Now, my issue is that I have my DNS like this: @ x.x.x.x A record www domain.com CNAME webmail domain.com CNAME Now, I can access my email via web using roundcube like this: http://www.domain.com/webmail However, when I try to access http://webmail.domain.com it redirects me to the default page when an index is not found. My Virtual host configuration is like this: NameVirtualHost *:80 <VirtualHost *:80> ServerName www.domain.com ServerAlias www.domain.com DocumentRoot /srv/www/domain.com/public_html/ ErrorLog /srv/www/domain.com/logs/error.log CustomLog /srv/www/domain.com/logs/access.log combined </VirtualHost> <VirtualHost *:80> DocumentRoot /usr/share/roundcubemail ServerName webmail.domain.com </VirtualHost> I believe there is something with my vhost configuartion above, however, can figure it out, since I have read a lot and all the vhost files seems to be exactly like mine. So, I can't get webmail.domain.com to go to my roundcube webmail and I ahve been fighting with this all day long. Can someone help me with this, if you need further information, please let me know. Also, even if I use http, it changes it to https... I generated self signed certificates for my email access. For apache SSL conf I have these lines: <VirtualHost _default_:443> # General setup for the virtual host, inherited from global configuration DocumentRoot "/var/www/html" ServerName www.domain.com:443 # Use separate log files for the SSL virtual host; note that LogLevel # is not inherited from httpd.conf. ErrorLog logs/ssl_error_log TransferLog logs/ssl_access_log LogLevel warn Of course there is more, but I believe that info may be enough. Please, can someone help me with this?
Hello, Try changing the DNS record for webmail. Delete the CNAME and configure an A record(To the same IP address of your domain). That should work.
In addition to whrsstech's comment, I'd like to add that having www subdomain as CNAME is not the best idea. Set it up as an A record as well and let Apache handle things here. You can set up redirections to/from www. addresses via httpd.conf if you want.