Apache 虛擬目錄和默認(rèn)首頁的設(shè)置
更新時(shí)間:2009年11月09日 00:07:33 作者:
Apache虛擬目錄和默認(rèn)首頁的設(shè)置,用apache做服務(wù)器的朋友必須要懂的。
虛擬目錄
1.找到"conf/httpd.conf" 文件
2.在節(jié)點(diǎn):<IfModule alias_module>里增加
Alias /aidd2008 "D:/php/web/aidd2008"
其中 aidd2008 是你想要訪問的虛擬目錄; D:/php/web/aidd2008 為物理路徑,以[/]代替[\]"
我們就在</IfModule>后面接著加:
<Directory "D:/php/web/aidd2008">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
(*)aidd2008 為虛擬目錄名稱,一般不用在名稱后加"/",若加入,每次都要在虛擬目錄后輸入"/"才能訪問網(wǎng)站
Alias /gt "D:/PHP/gt"
<Directory "D:/PHP/gt">
<IfModule php5_module>
<Files "index.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
3.重啟Apache
設(shè)置默認(rèn)頁面
方法1 設(shè)置全局的:
<IfModule dir_module>
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml default.php
</IfModule>
方法2 針對(duì)某一目錄可以這么設(shè)置:
Alias /aidd2008 "D:/php/web/aidd2008"
<Directory "D:/php/web/aidd2008">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex default.php
</Directory>
1.找到"conf/httpd.conf" 文件
2.在節(jié)點(diǎn):<IfModule alias_module>里增加
Alias /aidd2008 "D:/php/web/aidd2008"
其中 aidd2008 是你想要訪問的虛擬目錄; D:/php/web/aidd2008 為物理路徑,以[/]代替[\]"
我們就在</IfModule>后面接著加:
復(fù)制代碼 代碼如下:
<Directory "D:/php/web/aidd2008">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
(*)aidd2008 為虛擬目錄名稱,一般不用在名稱后加"/",若加入,每次都要在虛擬目錄后輸入"/"才能訪問網(wǎng)站
復(fù)制代碼 代碼如下:
Alias /gt "D:/PHP/gt"
<Directory "D:/PHP/gt">
<IfModule php5_module>
<Files "index.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
3.重啟Apache
設(shè)置默認(rèn)頁面
方法1 設(shè)置全局的:
復(fù)制代碼 代碼如下:
<IfModule dir_module>
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml default.php
</IfModule>
方法2 針對(duì)某一目錄可以這么設(shè)置:
復(fù)制代碼 代碼如下:
Alias /aidd2008 "D:/php/web/aidd2008"
<Directory "D:/php/web/aidd2008">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex default.php
</Directory>
相關(guān)文章
Apache下通過shell腳本提交網(wǎng)站404死鏈的方法
這篇文章主要介紹了Apache下通過shell腳本提交網(wǎng)站404死鏈,需要的朋友可以參考下2017-09-09
Shell中的單中括號(hào)和雙中括號(hào)的用法詳解
shell中的中括號(hào)在條件測(cè)試中是使用最頻繁的,無論是中括號(hào)還是雙中括號(hào),可用于一些條件的測(cè)試:算術(shù)比較、文件屬性測(cè)試、字符串比較。這篇文章主要介紹了Shell中的單中括號(hào)和雙中括號(hào)的用法詳解,需要的朋友可以參考下2022-12-12
Linux 文件系統(tǒng)的操作實(shí)現(xiàn)
這篇文章主要介紹了Linux 文件系統(tǒng)的操作實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-12-12
linux服務(wù)器ubuntu定時(shí)任務(wù)cron設(shè)置每秒執(zhí)行
這篇文章主要介紹了linux服務(wù)器ubuntu定時(shí)任務(wù)cron設(shè)置每秒執(zhí)行,使用 cron 時(shí),有一些注意事項(xiàng)可以幫助你確保任務(wù)按預(yù)期執(zhí)行,并減少潛在的問題,本文給大家介紹的非常詳細(xì),需要的朋友參考下吧2024-02-02
解決Ubuntu 18.04安裝VMwareTools錯(cuò)誤問題
這篇文章主要介紹了Ubuntu 18.04安裝VMwareTools錯(cuò)誤的解決方法,需要的朋友可以參考下2019-11-11

