First, configure Apache
1. Open httpd-vhosts.conf file, directory/applications/xampp/xamppfiles/etc/extra/httpd-vhosts.conf
Add VirtualHost in httpd-vhosts.conf and save exit
<virtualhost *:80> documentroot "/applications/xampp/xamppfiles/htdocs/zerg/public" ServerName Www.hello. COM </VirtualHost> documentroot project directory ServiceName for virtual domain 2, open Apache config file httpd.conf, enable virtual domain name configuration, directory/app lications/xampp/xamppfiles/apache2/conf/httpd.conf Add the following command in httpd.conf: Include/applications/xampp/xamppfiles/et C/extra/httpd-vhosts.conf Save exit
Second, configure browser access (should say) open Terminal Open profile directive: sudo nano/etc/hosts Enter password: add: 127.0.0.1 www.hello.com Save command: A, CTRL + X; B, ask if you are insured Save, select Y, enter to exit, and then use sudo nano/etc/hosts to enter the file to see if it was saved successfully; third, restart Apache server four, browser input: www.hello.com, this time to visit the public/index.php, Normal access to the situation indicates that the configuration is successful six, after the configuration is complete, we have direct access to localhost in the browser, error, access is not available. Workaround:
Add VirtualHost in httpd-vhosts.conf and save exit
<virtualhost *:80> documentroot "/applications/xampp/xamppfiles/htdocs/" ServerName localhost </vir Tualhost>
This is to be noticed.
MAC XAMPP Configuring a local virtual domain name