I sorted it out doing the steps below:
Edit /etc/apache2/httpd.conf uncomment the vhost file like:
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
Then edit the file /private/etc/apache2/extra/httpd-vhosts.conf adding your virtual hosts:
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
<Directory /Users/<youruser>/Sites/vhOne>
AllowOverride All
</Directory>
DocumentRoot "/Users/<youruser>/Sites/vhOne"
ServerName vhOne.local
</VirtualHost>
and be sure that you add to your /etc/hosts file as below:
127.0.0.1 vhOne.local
I hope it is userful. See ya around!
No comments:
Post a Comment