Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Trying to set up Virtual Server |
|
Author |
|
Asher
Joined: 28 Sep 2011 Posts: 1 Location: South Australia
|
Posted: Wed 28 Sep '11 8:15 Post subject: Trying to set up Virtual Server |
|
|
I'm trying to set up Apache on my Windows XP PC so that I can start learning PHP.
I've downloaded and installed Apache... at the install screen when prompted for Network Domain and Server Name I put 'localhost' for both.
I then went and tried to set up virtual hosting using instructions from this tutorial:
http://foundationphp.com/tutorials/apache22_vhosts.php
So, basically I've done this:
{
Created folder 'C:\vhosts'
Created folder 'C:\vhosts\site' containing file index.htm
}
{
Opened 'C:\WINDOWS\system32\drivers\etc\hosts'
Made entry '127.0.0.1 site' underneath '127.0.0.1 localhost'
}
{
Opened 'C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf'
Removed the '#' from the '#Include conf/extra/httpd-vhosts.conf'
At DirectoryIndex also inserted 'index.htm index.php'
}
{
Opened 'C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf'
On line 15 added:
Code: |
<Directory C:/vhosts>
Order Deny,Allow
Allow from all
</Directory>
|
Then at the bottom of the document, replaced the dummy <virtualhosts> stuff and added:
Code: |
<VirtualHost *:80>
DocumentRoot c:/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot C:/vhosts/site
ServerName site
</VirtualHost>
|
}
Problem...
'http://localhost/' says it works ... only from the default htcdocs from the Apache folder.
'http://localhost/site' or 'http://site/' doesn't work .. says can not find.
So, basically, I have no idea what else to do... I've tried to follow that tutorial as much as I can and been over and over it to check if I missed anything... searched other tutorials and tried to find something... but it escapes me what I've missed out.
I'd much appreciate it of people could give me some pointers as to what I should do and why.
Thank you,
Asher |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Thu 29 Sep '11 2:30 Post subject: |
|
|
What "says can not find," cannot find httpd://site or just does not find the proper documents? If the latter did you restart Apache?
Since it just came to me, many a antivirus software protect the hosts file so, did your change to it actually take affect?
It looks like you've configured Apache correctly being that the first vhost is a duplicate of the main host, and you have given access to c:\vhosts as well. |
|
Back to top |
|
|
|
|
|
|