i have a linux mail+http server located throguh Internet at www.mydomain.com. Domain was bought at GoDaddy so after configuring the server and getting the public ip address i went at GoDaddy's profile to modify the A and MXentries for my dns zone in order to point them to my server's public ip address. In the MX entry i did not placed the ip address but an alias called mail.mydomain.com.
Everything works fine but, as www.mydomain.com and mail.mydomain.com both are pointing to x.y.w.z where i have apache running, when you write www.mydomain.com or either mail.mydomain.com in the Internet Browser my default web page is shown. I would like to tell apache to only show the page if www.mydomain.com is written in the url and deny the access if mail.mydomain.com is written. Does anyone knows how sould i do it? Thanks :)
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin admin@mydomain.com
DocumentRoot /var/www/html/mydomain.com/
ServerName www.mydomain.com
ErrorLog logs/mydomain_com-error_log
CustomLog logs/mydomain_com-access_log common
</VirtualHost>
