Home  >  Article  >  Backend Development  >  How to modify and add Apache’s default site directory_PHP tutorial

How to modify and add Apache’s default site directory_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:01:34811browse

1. Modify the default site directory of Apache
After the Apache HTTP Server is installed, the default site directory is located in the htdocs folder under its installation directory, and the default homepage is is the index.html file of the folder. For example, if my Apache is installed in C:/wamp/bin/apache/Apache2.2.21, then the complete default site directory address of my Apache is C:/wamp/bin/apache/Apache2.2.21/htdocs/. The default homepage is C:/wamp/bin/apache/Apache2.2.21/htdocs/index.html.

Many times, whether we are studying, testing, or actually building our own site, we may not want to put our website in Apache’s default site directory. In this case, the knowledge in this section will help you solve the problem. This question.

Modification method:
1.
Go to the Apache installation directory and find the conf folder. There will be a text document such as httpd.conf in the folder, which is Apache The configuration file is responsible for directing the operation of Apache.

2. Double-click to open the text document httpd.conf, press the Ctrl+F key combination on the keyboard to search for "DocumentRoot "" (with English double quotes", see picture), after finding it ( Only one place), change the string in double quotes after the string "DocumentRoot" to the website directory you want to set.

For example: The default is DocumentRoot "C:/wamp/bin/apache/Apache2.2.21/htdocs", now it is changed to DocumentRoot "D:/Apache"

3. After completing the above step 2, do not close the httpd.conf file yet, continue to search, search for ".

For example: The default is , now it is changed to

4. Press the Ctrl+S key combination on the keyboard at the same time to save the above modifications. Be sure to stop (STOP) the Apache service once and then start (START) the changes just now to take effect.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327994.htmlTechArticle1. Modify Apache’s default site directory. After Apache HTTP Server is installed, the default site directory is located in its installation directory. In the htdocs folder, the default homepage is the index.ht of the folder...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn