在网上查找到的关于修改Apache服务器根目录的资料,对比学习,再此记录
在安装 Apache 时,系统会给定一个缺省的文件根目录。
如果你觉得将网页存在这个缺省目录不方便,觉得应该另外设个目录作为 Apache 文件根目录,你可以修改 Apache 的配置文件 httpd.conf 里有关文件根目录的设置。
假设Apache HTTP Server 的缺省文件根目录 (DocumentRoot) 是:
DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs"
修改 Apache 文件根目录 (DocumentRoot) 的操作如下:
1. 为避免修改失误,请先备份你的 Apache 配置文件 httpd.conf,该配置文件的路径是:
C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.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.
#
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
将 Diectory 中的路径改成你新设的文件根目录,比如:
<Directory "C:/htdocs">
4. 保存配置文件http.conf 。
5. 修改了配置文件以后,应重新启动 Apache Service。(Start --> All Programs --> Apache HTTP Server 2.2 --> Monitor Apache Servers --> Restart)
修改了文件根目录之后,你就可以将你的网页存放在新设的目录下了。
在安装 Apache 时,系统会给定一个缺省的文件根目录。
如果你觉得将网页存在这个缺省目录不方便,觉得应该另外设个目录作为 Apache 文件根目录,你可以修改 Apache 的配置文件 httpd.conf 里有关文件根目录的设置。
假设Apache HTTP Server 的缺省文件根目录 (DocumentRoot) 是:
DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs"
修改 Apache 文件根目录 (DocumentRoot) 的操作如下:
1. 为避免修改失误,请先备份你的 Apache 配置文件 httpd.conf,该配置文件的路径是:
C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.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.
#
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
将 Diectory 中的路径改成你新设的文件根目录,比如:
<Directory "C:/htdocs">
4. 保存配置文件http.conf 。
5. 修改了配置文件以后,应重新启动 Apache Service。(Start --> All Programs --> Apache HTTP Server 2.2 --> Monitor Apache Servers --> Restart)
修改了文件根目录之后,你就可以将你的网页存放在新设的目录下了。
标签:
Apache,文件根目录
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
暂无“Apache 文件根目录设置修改方法 (Document Root)”评论...
更新动态
2024年05月13日
2024年05月13日
- 杨培安《杨培安歌曲合集》[320K/MP3][257.1MB]
- [In-AkustikINAK7803]VA-ThePinnacleOfCheskyVoiceChesky非凡女声2017[SACD-ISO]
- 王之炅薛颖佳-中国小提琴名曲(2.8MHzDSD)DSF
- 群星-重力加速度·蓝白经华连串曲蓝与白-1991-WAV+CUE
- 群星-将爱情进行到底电视剧原声音乐中唱-1999-WAV+CUE
- [ABC唱片]徐刚-独步外滩WalkingOntheBundPerryShi(SACD).iso
- [ABC唱片]-《西电之声—类比之声》[HD-162b][德国版HD]WAV+CUE
- 央金兰泽《央金兰泽歌曲合集》[320K/MP3][218.8MB]
- 杨宗纬《杨宗纬歌曲合集》[320K/MP3][489.4MB]
- 陈楚生《陈楚生歌曲合集》[320K/MP3][138.9MB]
- 群星-中国轻音乐-经典情歌2CD【APE整轨】
- SacredSpaMusicSeries-LettingTheWorldGoBy[蓝色假期]FLA+CUE
- 赵传1996-黑暗英雄[台湾首版][WAV]
- 迟志强《迟志强歌曲合集》[320K/MP3][105.7MB]
- 《KKBOX西洋新歌日榜》[FLAC/分轨][1.1G]