Apache 虛擬目錄和默認(rèn)首頁的設(shè)置
更新時間:2009年11月09日 00:07:33 作者:
Apache虛擬目錄和默認(rèn)首頁的設(shè)置,用apache做服務(wù)器的朋友必須要懂的。
虛擬目錄
1.找到"conf/httpd.conf" 文件
2.在節(jié)點:<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 針對某一目錄可以這么設(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é)點:<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 針對某一目錄可以這么設(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
linux服務(wù)器ubuntu定時任務(wù)cron設(shè)置每秒執(zhí)行
這篇文章主要介紹了linux服務(wù)器ubuntu定時任務(wù)cron設(shè)置每秒執(zhí)行,使用 cron 時,有一些注意事項可以幫助你確保任務(wù)按預(yù)期執(zhí)行,并減少潛在的問題,本文給大家介紹的非常詳細(xì),需要的朋友參考下吧2024-02-02
解決Ubuntu 18.04安裝VMwareTools錯誤問題
這篇文章主要介紹了Ubuntu 18.04安裝VMwareTools錯誤的解決方法,需要的朋友可以參考下2019-11-11

