Home > Article > Backend Development > Modify and add Apache's default site directory apache installation apache 2.4 apache ant
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 the index.html file of this 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 this problem. question.
Modification method:
1. Find the conf folder in the installation directory of Apache. There will be a text document such as httpd.conf in this folder. It is the configuration file of Apache and 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 character 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 httpd yet. conf file, continue to search, search for "
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 new modifications to take effect.
The above introduces how to modify and add Apache's default site directory, including Apache content. I hope it will be helpful to friends who are interested in PHP tutorials.