Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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).

share|improve this question

migrated from stackoverflow.com Aug 11 '11 at 8:55

This question came from our site for professional and enthusiast programmers.

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 7:42
    
@Pekka: The .local pseudo-TLD is supplied by Avahi/Zeroconf, which is configured by default on OS X. –  cdhowie Aug 11 '11 at 7:43

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.