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: working virtual host?
Author
Clintonb



Joined: 29 Sep 2010
Posts: 2

PostPosted: Wed 29 Sep '10 22:41    Post subject: working virtual host? Reply with quote

I have been trying for a few days to create a virtual host with apache but i cannot get it to work despite reading all the config files on the internet. I have correctly edited my hosts file and my hosts file has been confirmed as working using ping www.test.com in the command line. I have removed the comment to include the vhosts config file and i have tried setting up the virtual hsot information but nothing i seem to try is working. Has anyone gotten virtual hosts to work on localhost? Could you please save my sanity and send me a copy of a working config files so i can see where i'm going wrong.
Back to top
wm003



Joined: 24 Mar 2006
Posts: 88

PostPosted: Thu 30 Sep '10 10:03    Post subject: Reply with quote

This works fine for me

Code:
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "c:/programme/Apache Group/Apache2/htdocs/wwwroot"
</VirtualHost>

<VirtualHost *:80>
    ServerName yourcomputername

# set ajax1-yourcomputername to 127.0.0.1 into your local hosts-file
    ServerAlias ajax1-yourcomputername
    DocumentRoot "c:/programme/Apache Group/Apache2/htdocs/wwwroot/anothervhost"
    ErrorLog "logs/anothervhost/error.log"
    CustomLog "logs/anothervhost/access_%Y-%m-%d.log" common

</VirtualHost>
Back to top
Clintonb



Joined: 29 Sep 2010
Posts: 2

PostPosted: Thu 30 Sep '10 23:42    Post subject: Operating system. Reply with quote

I've used the exact same config settings for my virtual host and when i try and load from that domain, it just opens up the bing.com page. What operating system are you running because i'm using windows 7 and i'm starting to think that windows is preventing this from working for some or other reason. I thought it strange becaues i backed up all the config files i used on windows xp and those config files worked fine back then but now all of a sudden it's no good.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 01 Oct '10 1:10    Post subject: Reply with quote

Does http://localhost work?
What is in your hosts file
are you using an editor run as administrator?
Back to top
wm003



Joined: 24 Mar 2006
Posts: 88

PostPosted: Fri 01 Oct '10 11:20    Post subject: Reply with quote

- localhost works fine

host:

Code:
127.0.0.1       localhost
127.0.0.1       ajax1-yourcomputername


Yes, you should open that file with admin privileges
Back to top


Reply to topic   Topic: working virtual host? View previous topic :: View next topic
Post new topic   Forum Index -> Apache