国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Apache > 正文

Apache 文件根目錄設置修改方法 (Document Root)

2024-08-27 18:24:12
字體:
來源:轉載
供稿:網友
最近在學習WordPress,使用appServ 在windows上搭建Php開發環境 在網上查找到的關于修改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)
修改了文件根目錄之后,你就可以將你的網頁存放在新設的目錄下了。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 无棣县| 白银市| 阿克陶县| 黄龙县| 西峡县| 古丈县| 海安县| 河曲县| 吉林市| 通道| 广安市| 兴文县| 锦屏县| 阿瓦提县| 沛县| 南昌县| 辉县市| 连平县| 云南省| 天长市| 徐州市| 封开县| 黄山市| 尉氏县| 曲周县| 荆门市| 新邵县| 手游| 吕梁市| 绥棱县| 许昌市| 黔江区| 南岸区| 平江县| 阳原县| 织金县| 白沙| 黔东| 康平县| 灌南县| 沙田区|