First in the Hosts file to add virtual host domain name, point to 127.0.0.1 I generally use the naming rules are dev-domainname.com
sudo nano/private/etc/hosts
# virtualhosts Mapping127.0.0.1 dev-domainname.com
Next configure Apache to open the Apache configuration file/applications/xampp/etc/httpd.conf
Search for "Virtual hosts"
# Virtual hosts# include/applications/xampp/etc/extra/httpd-vhosts.conf
Open the second line of comments and let Apache read the configuration file for the virtual host
# Virtual Hostsinclude/applications/xampp/etc/extra/httpd-vhosts.conf
Add virtual host configuration to the above httpd-vhosts.conf
# localhost<virtualhost *:80> ServerName localhost documentroot "/applications/xampp/xamppfiles/ Htdocs " <directory"/applications/xampp/xamppfiles/htdocs "> Options Indexes followsymlinks includes execcgi allowoverride All Require all granted </Directory></VirtualHost>
# My Custom Host<virtualhost *:80> ServerName mysite.local documentroot "/users/yourusername/path/to/ Your/site " <directory"/users/yourusername/path/to/your/site "> Options Indexes followsymlinks Includes execcgi allowoverride all Require all granted </Directory> errorlog "logs/ Mysite.local-error_log "</VirtualHost>
Restart Apache, Access dev-domainname.com 403 error, in the httpd.conf search user Deamon, the Deamon to the OS user name, restart Apache, you can.
XAMPP on MAC configuration virual Host