Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was working with localhost:81 during a long time with vhost and all was right. Right now I need to work over the 80 port and i change the http.conf and http-vhost for used the 80 port but right now into the browser localhost works ok, and the vhost not find the server.

my configurations are: * My local machine is lion osx * mamp * HTTP.conf:

 ServerName localhost:80

* http-vhost NameVirtualHost localhost

 <VirtualHost localhost>
   DocumentRoot "/Users/chalien/projects/ownProjects/PHP"

* /private/etc/hosts  localhost    broadcasthost
 ::1             localhost
 fe80::1%lo0    localhost

* /private/etc/services

  http             80/udp     www www-http # World Wide Web HTTP
  http             80/tcp     www www-http # World Wide Web HTTP
share|improve this question

migrated from Sep 22 '12 at 20:04

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

up vote 2 down vote accepted

The whole point of virtual hosts is that they're used when multiple names point to the same address. So it won't be used when someone connects to the address directly. You need to add:


Also, in /etc/hosts you shouldn't have multiple lines with the same IP, you should combine them:   localhost
share|improve this answer
i did it and works in part. right no with the vhost in the same line in hosts file my vhost show the serverroot but not the defined into the virtualhost tag – Charly Palencia Sep 22 '12 at 2:18
ThAKS SO MUCH YOU HELP ME!! THANKS!! – Charly Palencia Sep 22 '12 at 2:28

You must log in to answer this question.