Apache/Tips


.htaccess Ѥ Basic ǧ(ǧ)

Basic ǧڤäơ

Basic ǧ(ǧ) Apache ˸ŤƤǧǤɸǧڵǽ apache ˼꤬˼ڤʤȤ鹭ȤƤޤ

ǤǶ Apache 2.x ʹߤ Digest ǧɸǼ褦ˤʤޤ̤ͳ̵¤ Digest ǧѤۤƥŪ˾ޤȸǤ礦

ȤϤBasic ǧڤ֤μڤ顢ȤꤢڤǧڤˡȤƺǤ礦

Ȥˤ Basic ǧڤȤäƤߤ

ǧڤե֤ "/home/ayaka/.htpasswd" Ȥޤ.htpasswd Τ褦ʥե apache ǸʤƤȤϤ*1 public_html ۲֤ΤϹޤʤȤޤʥФˤäƤȤƤޤ뤿Ǥˡ

ǧڤɽ̾ "Warehouse" Ȥޤ

ǧڤ桼̾ "admin" ȤޤѥɤŬǤ

Ǥϡޤ htpasswd ޥɤˤäƥ桼ɲäޤ

$ htpasswd -c /home/ayaka/.htpasswd admin
New password:
Re-type new password:
Adding password for user admin

ʣΥ桼ɲäȤ -c ʤơƱͤ˥ޥɤϤޤȤ admin2 ɲäȤˤϡ

$ htpasswd /home/ayaka/.htpasswd admin2
New password:
Re-type new password:
Adding password for user admin2

Τ褦ˤʤޤcat ǥѥɥեƤߤȡadmin admin2 ɲäƤʬޤ

$ cat /home/ayaka/.htpasswd
admin:A.JT/17eUdFYs
admin2:iUWCSusG1geEo

⤷ѥɤ桼 -D ץĤޤʤ Apache 2.0.46 ʹߤ htpasswd Ǥ Apache Ǥ vi ǥʤɤǥե򳫤桼ιԤʤƤϤޤˡ

$ htpasswd -D /home/ayaka/.htpasswd admin2
Deleting password for user admin2

Τ褦 admin2 Υѥɾ󤬺줿ɽޤ

.htaccess ֤Ǥ

$ vi /home/ayaka/public_html/auth/.htaccess

vi ǥʤɤǥե򳫤 FTP ǥեžޤҤϼΤ褦ʤΤǤ

AuthType Basic
AuthName "Warehouse"
AuthUserFile /home/ayaka/.htpasswd
Require user admin
  • AuthType? = ǧ = Basic ǧڡʴǧڡˤȤ̣Ǥ
  • AuthName? = ǧڻ˥֥饦ɽ̾Ǥ
  • AuthUserFile? = ǧڻ˻ȤǧѤΥ桼̾ȥѥɤΥեǤhtpasswd ޥɤǺޤ
  • Require = AuthUserFile? ǻꤵƤ桼ФǧڵĤͿޤʬΥ桼Τߤˤʤ褦ˤ뤳ȤޤʤȤ AuthUserFile? ǻꤵ줿ե̾Τʤ˾󤬤äƤˡȤ admin system Ȥ桼Τǧڤʤ "Require user" θ˥桼̾ޤʣΥ桼Ȥ "," Ƕڤޤ
    Require user admin,system

Ȥϥ֥饦饢ǧڲ̤ɽǧޤ(ʤǶ apache 2.x Ǥ valid-user Ȥʤʤޤ.htaccess ˵ҤƤreason: unknown require directive:"valiid-user"פȥ顼ФΤǥƥΥС󥢥å׻ˤդǤ)

apache_basic.gif

ʾ Basic ǧڤˤĤƤβϽǤ

ۤȤȤˤ褦ʼǡꥻƥ⤤ Digest ǧ ȤȤǤޤΤǡ֤ƤߤƤ


*1 ɸ .ht դ̾Υեϸʤ褦 httpd.conf ǻꤵƤޤ

ȥå   Խ ʬ Хåå ź ʣ ̾ѹ   ñ측 ǽ   إ   ǽRSS
Last-modified: Wed, 20 Jul 2005 14:53:58 JST (6842d)