Apache file Root Settings Modify method (document root)

Source: Internet
Author: User
Tags php development environment

Recently learning WordPress, using Appserv to build a PHP development environment on Windows

Find information on the Web to modify the root directory of the Apache server, compare learning, and then this record
When you install Apache, the system is given a default file root directory.
If you think it is inconvenient to have this default directory, you should set up a different directory as the Apache file root directory, you can modify the configuration file of Apache httpd.conf about the file root directory.
Assume that the default file root directory (documentroot) for Apache HTTP Server is:
DocumentRoot "C:\Program Files\apache software Foundation\apache2.2\htdocs"
The operation to modify the Apache file root directory (DocumentRoot) is as follows:

1. To avoid modification errors, first back up your Apache profile httpd.conf, the path to the configuration file is:
C:\Program Files\apache Software foundation\apache2.2\conf\httpd.conf

2. Open the http.conf file, locate the line that begins with DocumentRoot, and
DocumentRoot "C:/Program Files/apache software Foundation/apache2.2/htdocs"
Change to a new documentroot path, such as your new path to C:\htdocs, and change it to
DocumentRoot "C:/htdocs"

3. Then find the following in the http.conf file
# This should is changed to whatever your set DocumentRoot to.
#
<directory "C:/Program Files/apache software Foundation/apache2.2/htdocs" >
Change the path in the diectory to your new file root directory, such as:
<directory "C:/htdocs" >

4. Save the configuration file http.conf.

5. After modifying the configuration file, you should restart the Apache Service. (Start-to-all Programs-Apache HTTP Server 2.2-to-Monitor Apache Servers-Restart)
Once you have modified the file root directory, you will be able to store your Web page in a new directory.

Apache file Root Settings Modify method (document root)

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.