»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 12-05-2003, 11:37 PM   #1 (permalink)
Registered User
 
Join Date: Oct 2003
Posts: 4
laowensjr is on a distinguished road
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 12-06-2003, 12:07 AM   #2 (permalink)
Registered User
 
davidamarkley's Avatar
 
Join Date: May 2002
Location: Joplin, MO
Posts: 2,208
davidamarkley is on a distinguished road
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
__________________
-David
davidamarkley is offline   Reply With Quote
Old 12-06-2003, 12:39 AM   #3 (permalink)
Registered User
 
davidamarkley's Avatar
 
Join Date: May 2002
Location: Joplin, MO
Posts: 2,208
davidamarkley is on a distinguished road
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 ( / )
__________________
-David

Last edited by davidamarkley; 12-06-2003 at 12:41 AM.
davidamarkley is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 10:23 AM.