XAMPP on MAC configuration virual Host

Source: Internet
Author: User
Tags naming convention

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

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.