Technology/Operating Systems
Linux / 홈페이지에 Apache(아파치) 인증 설정하기
Yonglae Cho
2011. 7. 14. 08:29
홈페이지에 Apache 인증 설정하기
1. httpd.conf 설정
<Directory "/home/avatar"> Options Includes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>인증하고자 하는 디렉토리가 "home/avatar" 라고 할 때 위에 처럼 설정
2. /home/avatar 에 .htaccess 파일 생성
AuthName 인증시보여줄안내(공백없이) AuthType Basic AuthUserFile /인증할 디렉토리의 절대경로/.htpasswd AuthGroupFile /dev/null <Limit GET POST> require valid-user </Limit>
3. .htpasswd 파일 생성
/usr/local/apache2/bin/htpasswd -c .htpasswd ID(처음 만들 때) htpasswd .htpasswd ID(사용자 추가) 비밀번호를 입력하면 됩니다.