search
Homephp教程php手册分享如何修改和添加Apache的默认站点目录

本篇文章是对修改和添加Apache的默认站点目录方法进行了详细的分析介绍,需要的朋友参考下

一、修改Apache的默认站点目录

Apache HTTP Server安装好后,默认的站点目录位于其安装目录下的htdocs文件夹内,默认首页是该文件夹的index.html文件。比如,我的Apache是安装在C:/wamp/bin/apache/Apache2.2.21内,那么我的Apache的完整的默认站点目录地址就是C:/wamp/bin/apache/Apache2.2.21/htdocs/,默认首页就是C:/wamp/bin/apache/Apache2.2.21/htdocs/index.html。

很多时候,服务器空间,不管是学习、测试,还是想真正的搭建自己的站点,我们可能并不想把自己的网站放在Apache默认的站点目录下,这时,网站空间,本节的知识将会帮助你解决这个问题。

修改方法:

1、到Apache的安装目录下找到conf文件夹,该文件夹内会httpd.conf这样一个文本文档,它是Apache的配置文件,负责指挥Apache的运行。

2、双击打开httpd.conf这个文本文档,按下键盘上的Ctrl+F组合键查找“DocumentRoot "”(带英文双引号",香港虚拟主机,见图),查找出来之后(仅有一处),将字符串“DocumentRoot”后面双引号内的字符串修改为自己想要设定的网站目录。

如:默认为DocumentRoot "C:/wamp/bin/apache/Apache2.2.21/htdocs",现修改成DocumentRoot "D:/Apache"

3、完成上述第2步之后,暂不要关闭httpd.conf文件,继续查找,查找“

4、同时按下键盘上的Ctrl+S组合键保存上述修改,一定记得要停止(STOP)一次Apache服务然后再启动(START),使刚刚的修改生效。

【相关教程推荐】

1. php编程从入门到精通全套视频教程
2. php从入门到精通 
3. bootstrap教程

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor