Results 1 to 4 of 4
Hi,
Well, here we go:
My system: CentOS Linux 5.4
As my VPS provider filters port 53 I use free dns.afraid.org dns's service.
For testing purposes I'm using co.cc free ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-17-2010 #1Just Joined!
- Join Date
- Mar 2010
- Posts
- 6
[SOLVED]httpd virtualserver doesn't show proper page
Hi,
Well, here we go:
My system: CentOS Linux 5.4
As my VPS provider filters port 53 I use freedns.afraid.org dns's service.
For testing purposes I'm using co.cc free domain names. (I like the word "free")
And here are the configurations:
On co.cc:
Code:Domain : gassgassnet.Co.CC Service Type : Name server (DNS) Name server : ns1.afraid.org ns2.afraid.org ns3.afraid.org ns4.afraid.org
On freedns.afraid.org:Code:Domain : oremosjuntos.Co.CC Service Type : Name server (DNS) Name server : ns1.afraid.org ns2.afraid.org ns3.afraid.org ns4.afraid.org
The coma (,) that you see after "www" is because I can not post urls in this forum. On dns server is actualy a dot (.)Code:gassgassnet.co.cc: gassgassnet.co.cc (G) A 190.120.229.160 www,gassgassnet.co.cc (G) CNAME gassgassnet.co.cc oremosjuntos.co.cc: oremosjuntos.co.cc (G) A 190.120.229.160 www,oremosjuntos.co.cc (G) CNAME oremosjuntos.co.cc
And now my server configurations:
httpd.conf:
(I can't post the complete file due to I'm not 11 post old in this forum)Code:<VirtualHost gassgassnet.co.cc:80> DocumentRoot "/var/www/html/gassgassnet.co.cc/html" <Directory "/var/www/html/gassgassnet.co.cc/html"> allow from all Options +Indexes </Directory> </VirtualHost> <VirtualHost oremosjuntos.co.cc:80> DocumentRoot "/var/www/html/oremosjuntos.co.cc/html" <Directory "/var/www/html/oremosjuntos.co.cc/html"> allow from all Options +Indexes </Directory> </VirtualHost>
The prolem I have is that wen I browse gassgassnet,co,cc it shows me the index file on /var/www/html/gassgassnet.co.cc/html (It's correct).
When I browse oremosjuntos,co,cc it shows me the index file on /var/www/html/oremosjuntos.co.cc/html (It's correct).
Wen I browse www,gassgassnet,co,cc it shows me the index file on /var/www/html/gassgassnet.co.cc/html (It's correct).
But...
When I browse www,oremosjuntos,co,cc it shows me the index file on /var/www/html/gassgassnet.co.cc/html (WRONG)
¿Why?
I will apreciatte any help.
Thanks to all.Last edited by gassganso; 03-17-2010 at 05:24 PM. Reason: [SOLVED]
- 03-17-2010 #2
normally when apache cannot find a match it will default to either the global document root or the first available virtual host. So when you say oremosjuntos.co.cc of course it will find a match. When you say www.oremosjuntos.co.cc, that is a completely different host all together.
There are a couple of ways to handle it. One way, and probably the best way imo is to use the rewrite engine to remove or add 'www' to all incoming requests. Then change the name appropriately, in the case of you choosing to add www to the hostname.
You should able to google it and find a cornucopia of examples. apache rewrite tutorials or something should guide you in the write direction.linux user # 503963
- 03-17-2010 #3
Because apache defaults to the first virtual host, if the servername is not matched.
Have a look at the ServerAlias statememt and add what you need.
You can also use globbing with ServerAliasYou must always face the curtain with a bow.
- 03-17-2010 #4Just Joined!
- Join Date
- Mar 2010
- Posts
- 6
Right, solved.
Thanks to both. I used ServerAlias and everything works peferctly
Thx again


Reply With Quote
