Mac configuration Apache Virtual home directory

Source: Internet
Author: User
This article takes Apache as an example to describe how to configure the virtual home directory. What does he do, configure him, access the marked domain name, you can access a specific directory level, such as direct access to a folder under/www. Steps: 1. Open the related configuration; 2. Configure the Vhost configuration file, copy 3. Restart Apache

1. Sudo vim/etc/apache2/httpd.conf to open the PHP module, remove the preceding semicolon 2. Open the import vhost file.
sudo vi/etc/apache2/extra/httpd-vhosts.conf

Enter the following code:
<virtualhost *:80>
     ServerName www.mall.com  [here needs to be changed to your]
     documentroot "/library/webserver/ Documents/mall "[here needs to be modified to your]
    <directory"/library/webserver/documents/mall ">[here needs to be modified to your
         Options FollowSymLinks includesnoexec Indexes
         directoryindex index.html
         index.htm-index.php All Order Deny,allow
         Allow to
         Require all granted
    </Directory>
</VirtualHost>

<virtualhost *:80>
     ServerName localhost
     documentroot "/library/webserver/documents" [here needs to be modified to your]
    <directory "/library/webserver/documents/mall" >[here need to be modified to your]
         Options followsymlinks includesnoexec Indexes
         directoryindex index.html index.htm index.php
         allowoverride All order
         Deny,allow
         Allow out of
         Require all granted
    </Directory>
</ Virtualhost>

3. Restart Apache
sudo apachectl restart


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.