Apache Problem - Virtual Name Hosting

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Apache Problem - Virtual Name Hosting

Post by Steveo31 »

Don't really know which forum to use, but here it is. I tried posting at apachefreaks.com but with their layout, its gonna take months before I get a reply.

I followed the tutorial there, but to no avail. Here's my httpd.conf file (not all of it... just the relevant):

Code: Select all

NameVirtualHost *

#commentary removd

<VirtualHost *>
    ServerName www.steveo6500.com
    ServerAlias steveo6500.com
    DocumentRoot "C:/Program Files/EasyPHP1-7/www/steveo6500.com/public_html"
    ServerAdmin you@admin.com
    CustomLog "C:/Program Files/EasyPHP1-7/www/steveo6500.com/access.log" combined
    ErrorLog "C:/Program Files/EasyPHP1-7/www/steveo6500.com/error.log"
</VirtualHost>
But I can't get to it from my browser. I have a feeling that this is not all of what I need to do to host a page on my computer. Has anyone had any luck with this?

I'm running WAMP on XP Home
phait
Forum Commoner
Posts: 46
Joined: Wed Apr 07, 2004 4:41 am
Location: watford / leicester, UK

Post by phait »

are you looking to actually have this available on the internet or just as a dev site that mirrors your live environment? I only ask as I think you may need to add a entry for the site into your hosts file found at somewhere similar to:
C:\WINDOWS\system32\drivers\etc\ and is called hosts.

There should be a entry in there for your localhost

127.0.0.1 localhost

I think you might need to add the domain after localhost e.g.
127.0.0.1 localhost yourdomain

and then reboot. I *think* the whole point of the star after NameVirtualHost is that it assumes the domain to be on the local machine unless a specific IP or named host is mentioned. I caveat all this by saying I am no expert and am still figuring these things out for myself, but I have had similar problems and I run WinXP Pro.

hth
dave420
Forum Contributor
Posts: 106
Joined: Tue Feb 17, 2004 8:03 am

Post by dave420 »

You don't need to reboot - hosts changes come into effect immediately.

The line is, simply:

127.0.0.1 http://www.steveo6500.com

Your host name must match the IP the server is sitting on, so change either the host or IP address in the above line (127.0.0.1 almost always works)
Post Reply