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)