Virtual host Configuration

I thought my problem was solved but i am still having the same issue
This is my configuration below

NameVirtualHost 192.168.11.144

<VirtualHost 192.168.11.144>
   DocumentRoot "C:\xampplite\htdocs\gambis"
   ServerName gambis.pstn
</VirtualHost>

<VirtualHost 192.168.11.144>
   DocumentRoot "C:\xampplite\htdocs\cfco"
   ServerName cfco.pstn
</VirtualHost>

in my windows server 2008 DNS server i set up a domain called .pstn and a host called              
   www.gambis.pstn
   www.cfco.pstn
and map them to 192.168.11.144
but when i type www.gambis.pstn in my browser or www.cfco.pstn in the browser I got only the page for www.gambis.pstn

Please help me!!!
AtourayAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

themrrobertCommented:
Did you restart your web server?

Try

NameVirtualHost 192.168.11.144

<VirtualHost 192.168.11.144>
   ServerAdmin admin@gambis.pstn
   DocumentRoot C:/xampplite/htdocs/gambis
   ServerName gambis.pstn
</VirtualHost>

<VirtualHost 192.168.11.144>
   ServerAdmin admin@cfco.pstn
   DocumentRoot C:/xampplite/htdocs/cfco
   ServerName cfco.pstn
</VirtualHost>

Open in new window

0
themrrobertCommented:
Another thing, I've noticed that sometimes web servers are sensitive with host-name based virtual hosts while using ip addresses, so maybe try:



NameVirtualHost *

<VirtualHost *>
ServerAdmin admin@gambis.pstn
DocumentRoot C:/xampplite/htdocs/gambis
ServerName gambis.pstn
</VirtualHost>

<VirtualHost *>
ServerAdmin admin@cfco.pstn
DocumentRoot C:/xampplite/htdocs/cfco
ServerName cfco.pstn
</VirtualHost>

Open in new window

0
themrrobertCommented:
dont forget you HAVE to restart your web server or these changes wont take effect
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

AtourayAuthor Commented:
if i type www.gambis.pstn or www.cfco.pstn it goes the same page i.e. www.gambis.pstn This is not working for me any other suggesting.
0
pete-mcpeteyCommented:
1) props to above. restarting Apache is the 1st thing to check
2) The original code is correct. If you are going to the same page, your code probably isn't getting picked up.

Check for httpd.conf syntax above your code, which might force the dedicated IP to resolve to C:\xampplite\htdocs\gambis. For example, if you have NameVirtualHost *:80 or _default_ above the code, your code will be useless.

And, of course, verify that the file you are editing, is included within the Include of httpd.conf.
0
arober11Commented:
Hi

If your using "www.gambis.pstn" and "www.cfco.pstn" you should have the 'www.' variant in your virtual host defenition e.g.

ServerName www.gambis.pstn
and:
ServerName www.cfco.pstn 

If you want to access the sites by both: http://www.gambis.pstn/ and http://gambis.pstn/ you will also need a ServerAlias statement in each virtual host defenition e.g.

ServerAlias gambis.pstn www.gambis.pstn

If that still dosen't solve you problems have a look at the apache access log, to see what name is comming in on the header.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.