栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > 服务器

Apache 文件根目录设置修改方法 (Document Root)

服务器 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Apache 文件根目录设置修改方法 (Document Root)

在网上查找到的关于修改Apache服务器根目录的资料,对比学习,再此记录
在安装 Apache 时,系统会给定一个缺省的文件根目录。
如果你觉得将网页存在这个缺省目录不方便,觉得应该另外设个目录作为 Apache 文件根目录,你可以修改 Apache 的配置文件 httpd.conf 里有关文件根目录的设置。
假设Apache HTTP Server 的缺省文件根目录 (documentRoot) 是:
documentRoot "C:Program FilesApache Software FoundationApache2.2htdocs"
修改 Apache 文件根目录 (documentRoot) 的操作如下:

1. 为避免修改失误,请先备份你的 Apache 配置文件 httpd.conf,该配置文件的路径是:
C:Program FilesApache Software FoundationApache2.2confhttpd.conf

2. 打开 http.conf 文件,找到 documentRoot 为开头的那一行,将
documentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
改成新的 documentRoot 路径,比如你新的路径为 C:htdocs,就改成
documentRoot "C:/htdocs"

3. 然后找到 http.conf 文件中的如下内容
# This should be changed to whatever you set documentRoot to.
#

将 Diectory 中的路径改成你新设的文件根目录,比如:


4. 保存配置文件http.conf 。

5. 修改了配置文件以后,应重新启动 Apache Service。(Start --> All Programs --> Apache HTTP Server 2.2 --> Monitor Apache Servers --> Restart)
修改了文件根目录之后,你就可以将你的网页存放在新设的目录下了。
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/184786.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号