MAC XAMPP Configuring a local virtual domain name

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.