0

The problem:

On my local machine only, I want to enter the URL homepage.local and I want it to open my local webpage index.html found in my local directory /Users/prime/Homepage/. I thought I could achieve this by using the below vhost configuration but it doesn't seem to work.

Added the following to my httpd.conf file

<VirtualHost *:80>
    ServerName homepage.local
    ServerAlias *.homepage.local
    DocumentRoot "/Users/prime/Homepage/"
</VirtualHost>

and when I go to my web-browser and enter the URL homepage.local it does not resolve to my webpage /Users/prime/Homepage/index.html

Any ideas? I can't see anything in the apache error logs.

$ apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   homepage.local (/private/etc/apache2/httpd.conf:533)

I am on OSX (Snow Leopard).

Coderama
  • 101
  • 3
  • 2
    Is `homepage.local` actually pointing to your local machine? Did you set up the DNS or hosts entries? Does it show the local IP (127.0.0.1) when you do `ping homepage.local`? – Pekka Aug 11 '11 at 07:42
  • @Pekka: The `.local` pseudo-TLD is supplied by Avahi/Zeroconf, which is configured by default on OS X. – cdhowie Aug 11 '11 at 07:43

1 Answers1

1

Did you set up your host file? Server name directive does nothing unless the network resolves to the server properly.

You can edit your hosts file by following these directions here. Except you want to keep the ip address the same and just change the name to homepage.local.