Blog

ambiente de desarrollo leopard apache2

1) Editar arhivo /private/etc/hosts
agregar por ejemplo:
127.0.0.1 sitio.local
127.0.0.1 subd1.sitio.local
127.0.0.1 subd2.sitio.local

2) Editar /private/etc/apache2/httpd.conf
descomentar la linea:
# Virtual hosts
# Include /private/etc/apache2/extra/httpd-vhosts.conf

3) Editar /private/etc/apache2/extra/httpd-vhosts.conf

IMPORTANTE
Tiene que estar la directiva

NameVirtualHost *:80
Si no apache no le da bola a los nombres de los vhosts

agregar algo como esto:
#Este primer virtual host sirve para que el localhost siga apuntando al root del apache
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
ServerAdmin [email protected]

DocumentRoot “/Library/WebServer/Documents”
</VirtualHost>

#Este otro sirve para que un subdominio
<VirtualHost *:80>
ServerName wtfeed.local
ServerAlias spa.wtfeed.local
ServerAdmin [email protected]

DocumentRoot “/Users/gonzo/Documents/workspace/wtfeed/site/app/webroot/”
<Directory “/Users/gonzo/Documents/workspace/wtfeed/site/app/webroot/”>
Options FollowSymLinks MultiViews Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

#Este es para otro subdominio
<VirtualHost *:80>
ServerName wtfeed.local
ServerAlias www.wtfeed.local
ServerAdmin [email protected]

DocumentRoot “/Users/gonzo/Documents/workspace/wtfeed/site/app/webroot/”
<Directory “/Users/gonzo/Documents/workspace/wtfeed/site/app/webroot/”>
Options FollowSymLinks MultiViews Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

4) reiniciar apache
sudo apachectl graceful