First, add the virtual host domain name to the hosts file. Direction 127.0.0.1 I generally use the naming convention dev-domainname.com
sudo nano/private/etc/hosts
# virtualhosts Mapping127.0.0.1 dev-domainname.com
Next configure Apache. Open the Apache configuration file/applications/xampp/etc/httpd.conf
Search for "Virtual hosts"
# Virtual hosts# include/applications/xampp/etc/extra/httpd-vhosts.conf
Put the second line staring open 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>
To restart Apache, visit dev-domainname.com 403 error, httpd.conf inside the user Deamon, the Deamon becomes the username of the OS. Start Apache again. On top.
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
XAMPP on MAC configuration virual Host