home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Apache2 and Virtual Hosts

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1613
Discussions: 200,957, Posts: 2,379,495, Members: 246,327
Old December 6th, 2003, 02:37 AM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Oct 2003
Posts: 4
Apache2 and Virtual Hosts

Hello Everyone

I have set up Apache2 in Windows XP. It was working fine until I recently added a second domain name in the virtual hosts section of the httpd.conf file.

Now only second.com shows and not first.com

Here is part of what's in my httpd.conf
-----------------------------------------------------------
ServerRoot "C:/Apache2"
Listen *:80
###Section 2: 'Main' server configuration

ServerAdmin admin@first.com
ServerName www.first.com
UseCanonicalName Off
DocumentRoot "C:/www/host/first"

NameVirtualHost *:80

#
# VirtualHost

<VirtualHost *:80>
ServerAdmin admin@first.com
ServerName www.first.com
ServerAlias first.com *.first.com
DocumentRoot "C:/www/host/first"


</VirtualHost>

<VirtualHost *:80>
ServerAdmin admin@second.com
ServerName www.second.com
ServerAlias second.com *.second.com
DocumentRoot "C:/www/host/second"
</VirtualHost>

------------------------------------------------------------

The above is listed in order scrolling down the httpd.conf file.
I have tried replacing the * wildcard with my actual IP Address but nothing works.
I do have a static IP Address. I use zoneeditDOTcom for resolving DNS

Please advise as to what may be the cause of me not seeing first.com anymore but instead seeing second.com

Thanks in Advance for your help.
laowensjr is offline   Reply With Quote
Old December 6th, 2003, 03:07 AM     #2 (permalink)
Ultimate Member
 
davidamarkley's Avatar
 
Join Date: May 2002
Location: Joplin, MO
Posts: 2,353
Send a message via ICQ to davidamarkley Send a message via AIM to davidamarkley
I believe you need to replave the lines <VirtualHost *:80> for both the first and second virtual hosts to

<VirtualHost first.com:80>

<VirtualHost second.com:80>

Not sure if you need the WWW or not, but it's worth a shot...

David
davidamarkley is offline   Reply With Quote
Old December 6th, 2003, 03:39 AM     #3 (permalink)
Ultimate Member
 
davidamarkley's Avatar
 
Join Date: May 2002
Location: Joplin, MO
Posts: 2,353
Send a message via ICQ to davidamarkley Send a message via AIM to davidamarkley
Well, according to http://httpd.apache.org/docs-2.0/vhosts/

Here is an example on how to set it up...

NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin admin@first.com
ServerName www.first.com
ServerAlias first.com *.first.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/first"
</VirtualHost>

<VirtualHost *:80>
ServerAdmin admin@second.com
ServerName www.second.com
ServerAlias second.com *.second.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/second"
</VirtualHost>

Just make changes to change the domain names, and then remember to restart the Apache server. If you don't restart, the changes won't make any difference.

Also, make sure both domains are pointed to that same IP address.

David

EDIT: BTW, I tested the above out on my server at home, and it works perfectly.

I think you just needed to change the slashes to these kind ( \ ) instead of these ( / )

Last edited by davidamarkley : December 6th, 2003 at 03:41 AM.
davidamarkley is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2947)
The disrespect of Obama by Russian .. (41)
Making Health Care Worse (178)
Wireless Televisions. (12)
CPU fan stops spinning randomly (9)
Regular Build (11)
windows 7 problem (7)
Laptop with wireless problem. (5)
Is the PSU I received dead? (12)
Print spooler problem (15)
windows vista security holes (11)
radeon x850xt platinum & shader.. (6)
HIS HD5770 graphic card question (15)
Install XP pro and a Vista laptop ?.. (11)
Recent Discussions
Open With ..... Win7 (1)
Kingston Bluetooth Dongle Driver (0)
webcam (0)
upgrade for hp a6101 (0)
windows vista security holes (11)
Laptop with wireless problem. (5)
Modern Warfare 2: Who Bought It? (64)
tv not turn on-makes clicking sound (2)
CPU fan stops spinning randomly (9)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Internet Lost (3)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)
Point and Shoot Camera Suggestions. (4)
Multiple Restarts Required at Boot (2)
Ideal cheap graph card for PC-Gaming? (18)
radeon x850xt platinum & shader 3 (6)
Graphics Card Upgrade Question (4)
For Sale BFG GTX285 OC2 with 10 year .. (3)
How to convert MP3's (4)
Wireless Televisions. (12)
Hp Artist Edition + Matching Bag (0)


All times are GMT -4. The time now is 07:11 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28