Page 1 of 1

Apache Problem - Virtual Name Hosting

Posted: Sat Mar 27, 2004 3:15 pm
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

Posted: Thu Apr 15, 2004 7:15 am
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

Posted: Mon May 17, 2004 9:00 am
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)