?
Solved

Virtual host Configuration

Posted on 2010-03-30
6
Medium Priority
?
591 Views
Last Modified: 2012-05-09
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!!!
0
Comment
Question by:Atouray
6 Comments
 
LVL 13

Expert Comment

by:themrrobert
ID: 29129070
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
 
LVL 13

Expert Comment

by:themrrobert
ID: 29129169
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
 
LVL 13

Expert Comment

by:themrrobert
ID: 29129348
dont forget you HAVE to restart your web server or these changes wont take effect
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Atouray
ID: 29134446
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
 
LVL 3

Expert Comment

by:pete-mcpetey
ID: 29586990
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
 
LVL 26

Accepted Solution

by:
arober11 earned 1000 total points
ID: 32043412
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

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Is your organization moving toward a cloud and mobile-first environment? In this transition, your IT department will encounter many challenges, such as navigating how to: Deploy new applications and services to a growing team Accommodate employee…
Suggested Courses
Course of the Month5 days, 10 hours left to enroll

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question