linux/Tip

apache 에서 인증

efrit 2007. 3. 15. 22:03
'인증이 필요한 Directory 에서

vi .htacess

AuthName \\"인증이 필요한 페이지입니다

AuthUserFile /~/.htaccess\r\n&
AuthType Basic

require valid-user



htpasswd -c /tmp/.htpasswd       -c 는 처음 생성할때 이후에 사용시 덮어쓰기(즉 사용안함)



vi /~/httpd.conf



Alias /test/ /tmp/test/                 /tmp/test 를 a.com/test/ 로

<Directory /tmp/test>

AllowOverride AuthConfig

Order allow,deny

Allow from all

</Directory>

/~/httpd restart