logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Trying to set up Virtual Server
Author
Asher



Joined: 28 Sep 2011
Posts: 1
Location: South Australia

PostPosted: Wed 28 Sep '11 8:15    Post subject: Trying to set up Virtual Server Reply with quote

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

PostPosted: Thu 29 Sep '11 2:30    Post subject: Reply with quote

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


Reply to topic   Topic: Trying to set up Virtual Server View previous topic :: View next topic
Post new topic   Forum Index -> Apache