problem with multiple domains in apache server
in my dns server i have a domain example.com . i have subdomains under it , like server.example.com , login.example.com etc . the zone file is like this :
IN NS example.com. server IN A 192.168.1.2 mail IN A 192.168.1.2 when i dig them there appears to be no problem. in the web server conf file i used two different document roots for the subdomains.the sample code is like this : <VirtualHost server.example.com> ServerName server.example.com DocumentRoot /var/www/ </VirtualHost> <VirtualHost mail.example.com> ServerName mail.example.com DocumentRoot /xyz/ </VirtualHost> if i browse for server.example.com iam getting the desired html file , but if i browse for mail.example.com the http test page is being displayed .Please help me solve the problem. |
This works for me
This is how I do it on my server:
I use Dynamic DNS, but that won't matter if dig works fine. ServerName 155.143.61.52 NameVirtualHost *:80 <VirtualHost *:80> ServerName prestigespas.homeip.net ServerAlias homeip.net *.prestigespas.homeip.net DocumentRoot /var/www/prestige </VirtualHost> <VirtualHost *:80> ServerName australianile.homeip.net ServerAlias homeip.net *.australianile.homeip.net DocumentRoot /var/www/ane </VirtualHost> |
All times are GMT -5. The time now is 11:41 AM. |