Eu estou tentando criar um host virtual para o desenvolvimento de PHP, então eu não vou para http://localhost/new_website
, mas para new_website.dev
e obter o site.
Eu criei o diretório na pasta / Sites e editei o arquivo /etc/apache2/extra/httpd-vhosts.conf
e o arquivo /private/etc/hosts
.
O conteúdo do meu arquivo vhosts:
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
DocumentRoot "/Users/Rob/Sites"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/Rob/Sites/new_website"
ServerName new_website.dev
</VirtualHost>
E o conteúdo do meu arquivo de hosts:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 new_website.dev
E pelo que encontrei na internet, isso deve ser uma manobra, mas de alguma forma, não obtenho o index.php do diretório new_website
, mas recebo o index.php do diretório Sites
. Então a raiz do servidor, por assim dizer.
O que estou fazendo errado?