Apache file Root Settings modification method (document root) _win server

Source: Internet
Author: User
Found on the internet about the changes to the Apache server root directory of information, comparative study, and then this record
When Apache is installed, the system is given a default file root directory.
If you think it is inconvenient to have a Web page in this default directory, think that you should set up another directory as the Apache file root directory, you can modify the Apache configuration file httpd.conf about the file root directory settings.
Suppose the default file root directory (documentroot) for Apache HTTP Server is:
DocumentRoot "C:\Program files\apache Software Foundation\apache2.2\htdocs"
The operations for modifying the Apache file root (documentroot) are as follows:

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

2. Open the http.conf file and find the line that starts with DocumentRoot, which will
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 content 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 diectory to your new file root directory, for example:
<directory "C:/htdocs" >

4. Save the configuration file http.conf.

5. After the configuration file has been modified, the Apache Service should be restarted. (Start--> all Programs--> Apache HTTP Server 2.2--> Monitor Apache Servers--> restart)
After you have modified the file root directory, you can store your Web page in the new 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.