Apache Configure user-level directory

Source: Internet
Author: User

If you only need to use Apache in the user directory, there is also the simplest way to direct the httpd.conf file under the

DocumentRoot "/library/webserver/documents" <directory "/library/webserver/documents" >

Change to the Sites path in your user directory is OK, as follows:

DocumentRoot "/users/username/sites" <directory "/users/username/sites" >

Once this is set up, the previous/library/webserver/documents cannot be accessed.

If you want to keep both, and even want to have a virtual hosting configuration, then the next article will be useful to you.

Configuring User-level Catalogs

1, in username (the agreement this article appears username for the user name) under the new folder called Sites (can only call this name, can not be other, pay attention to the case)

2. Open the/etc/apache2/httpd.conf file and remove the # number in front of the string below.

# Turn on user-level directory LoadModule userdir_module libexec/apache2/mod_userdir.so# turn on user-level directory configuration file include/private/etc/apache2/extra/ Httpd-userdir.conf

  

3. Open the/etc/apache2/extra/httpd-userdir.conf file and remove the #号 in front of the string below.

# Introduction of User Directory-level profile include/private/etc/apache2/users/*.conf

  

4, configure the user-level directory of the. conf, the address of the file is/etc/apache2/users/username.conf, if the file does not exist, then create one. Then open the Username.conf file and add the following configuration to the file:

<directory "/users/username/sites/" >    Options Indexes multiviews    allowoverride None    Require All Granted</directory>

  

5, save all the changed files, and restart Apache, and then open 127.0.0.1/~username/in the browser, the link is opened by default in the user directory of the Sites directory inside the index file. If the following prompt appears, there is a problem with the username.conf configuration file.

Not foundthe requested the URL/~username/was not found on the this server.

  

Apache Configure user-level directory

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.