How to Set Up Apache Virtual Host on MacOS
Setting up Apache Virtual Host on Your Mac. Basic commands and where directories are found.
Open and edit the httpd file found at
/private/etc/apache2/httd.conf
or
/etc/apache2/httpd.conf
Open the file and uncomment the Virtual Host include
Open and edit httpd-vhosts.conf file found at
/private/etc/apache2/extra/httpd-vhosts.conf
or
/etc/apache2/extra/httdp-vhosts.conf
Add
VirtualHost *:80
DocumentRoot “/Users/username/Sites/foldername”
ServerName test.local
/VirtualHost
Open and edit the hosts file locate at
/etc/hosts
Add
127.0.0.1. test.local
Comments are closed.