XAMPP on Mac configuration Virual Host, xamppvirual

Source: Internet
Author: User

XAMPP on Mac configuration Virual Host, xamppvirual
First add the virtual host domain name in the hosts file, pointing to 127.0.0.1 I generally use the naming rules is dev-domainname.com

sudo nano /private/etc/hosts

# VirtualHosts Mapping127.0.0.1 dev-domainname.com

Configure Apache and open the configuration file/Applications/XAMPP/etc/httpd. conf of Apache.
Search for "Virtual hosts"
# Virtual hosts# Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf

Open the comment on the second line, And let Apache Read the configuration file of the virtual host.
# Virtual hostsInclude /Applications/XAMPP/etc/extra/httpd-vhosts.conf

Add Virtual Host configuration in the httpd-vhosts.conf above
# 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 error 403, in httpd. conf Search User Deamon, change deamon to OS User name, restart Apache, you can.


Related Article

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.