2007年10月26日 星期五

Apache 部份參數說明 I

轉載自http://redhat.ecenter.idv.tw/bbs/showthread.php?s=&threadid=24929
作者 Eric

apache 部份參數說明 I

Part I

AllowOverride 的屬性功能

AllowOverride Limit 允許蓋掉原聯結屬性得範圍
AllowOverride Authconfig 可做密碼設定:如:藏密
AllowOverride Options 可將該目錄之Options 功能覆蓋
AllowOverride FileInfo 可將該目錄之任何文件型態覆蓋,如:DefaultType,ErrorType
AllowOverride Indexs 可將該目錄之顯式列印功能覆蓋,如:AddIcon,HeaderName.ReadName

Options的屬性功能

Indexs 當無index.html可用列印目錄方式顯式,如:center3 homepage 若用 -Indexs 則看不見 listing
FollowSymLinks 加一屬性如+FollowSymLinks可允許使用symbol link 時,依舊可瀏覽
ExecCGI 當為 +ExecCGI可執行 CGI SCRIPT
Includes 可執行Server site include,若為 +Includes
IncludesNOEXEC 可執行Server site include,若為 +Includes,但不可執行CGI
None 沒有任何功能可用
All 均可
總之,以 +, - 符號可加或刪減其功能,若未給符號,則只有初步功能

Limit的屬性功能

GET 限定取得文件法,如:
POST 限定cgi post方法,如:
order 限定拒絕或允許的次序
deny 限定拒絕範圍,如:deny from all 或 deny from .mycompany.com
allow 限定允許範圍,如:allow from all 或 allow from 192.153.22

AuthConfig 之方法 & .htaccess 範例


#與Directory同,但在 .htaccess 只能用他 AuthName Members-only 設定僅 Member 才可入,僅為名稱 AuthType Basic 解碼方法 AuthUserFile /home1/users/center/center21/public_html/wwwclass/bau
#密碼表位置(絕對位置) AuthGroupFile /home1/users/center/center21/public_html/wwwclass/group
#同群表位置

#限制取件
require user center21
#bau的密碼表有很多user,但....
order allow,deny
#先允許在拒絕
allow from all
#允許全部



密碼表之產生方法

找到及取得htpasswd程式
執行htpasswd -c filename username (第一次,以後僅htpasswd filename username)
修改需要的 user (在 require 後)

require用法

require user center21 center3
require group cc cv ee

相關連結:Apache 部份參數說明 II ; Apache 部份參數說明 III






沒有留言:

Google