Go Back   PCMech Forums > Help & Discussion > Internet, Web Applications, & The Cloud

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 05-12-2008, 09:53 PM   #1
Member (5 bit)
 
Join Date: Aug 2004
Posts: 25
Question Apache vhost setup

I've been searching everywhere (and continue to do so) but figured I might post in the meantime in case anyone can help.

I'm running AMP on Windows XP (Apache 2.2.8, MySQL 5.0 and PHP 5.2.6). Everything is up and running fine, but I am having trouble getting this vhost to work. I've searched out numerous setup tutorials, but they pretty much say the same thing. I am setting up multiple domains on one IP.

First, I uncommented "Include conf/extra/httpd-vhosts.conf" in my httpd.conf.

Then I added two of my sites to my hosts file in C:\WINDOWS\system32\drivers\etc. I added under
127.0.0.1 localhost:

127.0.0.1 sv.site1
127.0.0.1 sv.site2

I then went to my httpd-vhosts.conf file. I made sure my "NameVirtualHost *:80" was uncommented and added:

HTML Code:
<Directory />
    Order Deny,Allow
    Allow from all
</Directory>
and then modifed my vhosts to:

HTML Code:
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot C:/SERV/www
</VirtualHost>

<VirtualHost *:80>
    ServerName sv.site1
    DocumentRoot C:/SERV/vhosts/site1
</VirtualHost>

<VirtualHost *:80>
    ServerName sv.site2
    DocumentRoot C:/SERV/vhosts/site2
</VirtualHost>
My directory structure is:
C:\SERV
C:\SERV\www (localhost directory)
C:\SERV\vhosts (my site directories)
C:\SERV\vhosts\site1
C:\SERV\vhosts\site2

I have tried with my vhosts directory in my www as well as out. I have tried changing my vhosts to include the entire path and truncated paths. I have tried this and variations of this configuration as shown on one tutorial:

HTML Code:
<VirtualHost *:80>
    ServerName sv.site1
    DocumentRoot C:/SERV/vhosts/site1
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>
<Directory C:/SERV/vhosts/site1>
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
I have also tried adding a NameVirtualHost for each vhost entry.

My problem is that when I access any of my sites locally or via domain url, it defaults to the first virtual host entry in the vhost file. Site1 and Site 2 both show my index page in my localhost directory. If I comment out my localhost, they both default to site1, etc.

Thanks in advance.

--
Well, I found the answer quick enough to disregard this post entirely, but I guess someone might find it useful as I've seen others with the same issue.

I figured out that I was missing my ServerAlias, i.e.:

HTML Code:
<VirtualHost *:80>
    ServerName sv.site1
    DocumentRoot C:/SERV/vhosts/site1
    ServerAlias site1.com
</VirtualHost>
It helps Apache designate which virtualhost it should point to.

I guess this just turned into another tutorial.

Last edited by dektek11; 05-12-2008 at 10:13 PM. Reason: Issue resolved
dektek11 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
XP Setup Problems. FabianH Windows Legacy Support (XP and earlier) 8 12-02-2006 06:13 PM
A problem in BIOS setup? ITlover Windows Legacy Support (XP and earlier) 10 10-04-2006 09:28 AM
re installing "my comp" or "win explorer" stuartey Windows Legacy Support (XP and earlier) 8 04-27-2003 02:18 PM
New Build Setup Problems Manofmusic Computer Hardware 4 12-11-2002 09:05 AM
W2K install Setup Prob. Frederick Windows Legacy Support (XP and earlier) 2 03-06-2002 12:47 PM


All times are GMT -5. The time now is 07:06 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2