Multi-site configuration for Apache under Mac

Source: Internet
Author: User

The following operations are based on the PHP environment already configured

Search from the Internet, and then the configuration of the next or relatively simple!

My environment directory is in/library/webserver/documents

The test can be created directly here a folder, which write a index.php random output of what

In the Finder ctrl+shift+g input/private/etc Enter find Apache2-"Find httpd.conf Open

  

#Virtual hosts
Include/private/etc/apache2/extra/httpd-vhosts.conf

Find this line of code and get rid of the # in front of include

Next:

Apache2/extra/httpd-vhosts.conf

<virtualhost *:80>
DocumentRoot "/library/webserver/documents/zend/test"
ServerName www.test.com
</VirtualHost>

Divert add the code as above.   The catalogue is replaced by your own project directory! ServerName is the domain name you want to use to access the project.

Next:

Under the/private/etc directory, find the hosts this file, open Add on point to 127.0.0.1 www.test.com These places is best to copy, do not own hand knocking! ~ Free of Mistakes! Get upset with yourself!

After configuration, go to open terminal, enter sudo apachectl restart or sudo apachectl stop after sudo apachectl start

Multi-site configuration for Apache under Mac

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.