wakka .hdaccess 設定備忘

Published on 06/15,2004

wakka 在 apache 2 安裝好後須改 .hdaccess 這個檔,將預設的檔案改為

 

RewriteEngine on
RewriteRule ^(wakka.php?.*)$ - [S=1]
RewriteRule ^(.*)$ /wakka/wakka.php?wakka=$1 [QSA,PT,L]
 


再修改 /etc/httpd/conf/httpd.conf 加入
 

Alias /wakka/ /var/www/wakka/

AllowOverride All

重新啟動 apache

資料來源  http://j433463.idv.tw/forum/viewtopic.php?t=14

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 限定取得文件法,如:<Limit GET>

POST 限定cgi post方法,如:<Limit POST>

order 限定拒絕或允許的次序

deny 限定拒絕範圍,如:deny from all 或 deny from xxx.mycompany.com

allow 限定允許範圍,如:allow from all 或 allow from 192.153.22


AuthConfig 之方法 & .htaccess 範例:

代碼:

<Files index.html>

#與Directory同,但在 .htaccess 只能用它:

設定僅 Member 才可入
AuthName Members-only

僅為名稱
AuthType Basic ,

解碼方法
AuthUserFile /home1/users/center/center21/public_html/wwwclass/bau

#密碼表位置(絕對位置)
AuthGroupFile /home1/users/center/center21/public_html/wwwclass/group

#同群表位置
<Limit GET>

#限制取件
require user center21

#bau的密碼表有很多user,但....
order allow,deny

#先允許在拒絕
allow from all

#允許全部
</Limit>

<Files>


密碼表之產生方法:

代碼:
找到及取得htpasswd程式

執行 htpasswd -c filename username (第一次, 以後僅 htpasswd filename username)

修改需要的 user (在 require 後)


require用法:

代碼:
require user center21 center3

require group cc cv ee


Comments

Leave a Reply

 authimage