默認首頁(yè)的配置:
第一種:直接修改apache服務(wù)器的配置文件./conf/httpd.conf中的DirectoryIndex,如:(項目web以index.php為首頁(yè))
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
第二種:apache服務(wù)器的配置文件./conf/httpd.conf中DirectoryIndex默認不變?yōu)閕ndex.html,此時(shí)需要當前項目下增加一個(gè)index.html文件,文件的內容如下編輯:(項目web以index.php為首頁(yè))
index.html文件的內容如下:
<meta http-equiv="refresh" content="0; url=index.php">
以上兩種方式,在地址欄中輸入http://localhost/web就可以直接訪(fǎng)問(wèn)到index.php的頁(yè)面。
默認網(wǎng)站的配置:(項目以web為例)
第一種:直接修改apache服務(wù)器的配置文件./conf/httpd.conf中的DocumentRoot和Directory,如:
DocumentRoot "/usr/local/apache/htdocs/web"
<Directory "/usr/local/apache/htdocs/web">
第二種:不修改apache服務(wù)器的默認配置文件httpd.conf,而是,修改./htdocs/目錄下的index.html文件:
index.html文件的內容如下:
<meta http-equiv="refresh" content="0; url=/web">
以上兩種方式,在地址欄中輸入http://localhost就可以直接訪(fǎng)問(wèn)到web項目的網(wǎng)站。
轉載請注明原文地址:http://www.server110.com/apache/201404/9487.html
聯(lián)系客服