XAMPP on MAC configuration virual Host

Source: Internet
Author: User

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

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.