System/OS
2003.04.23 10:28
[linux] 아파치설치/설정 - 사용인증
조회 수 15129 댓글 0
1. 아파치 환경 설정 파일의 편집
$ vi /usr/local/apache/conf/http.conf
#AllowOverride None
#AllowOverride AuthConfig # 일단 이렇게
AllowOverride All # 안되면 이렇게
2. 암호를 걸고 싶은 디렉토리 내에다 암호파일을 생성
$ /usr/local/apache/bin/htpasswd -c .htpasswd admin # 암호파일 처음 생성시
New password: admin123
Re-type new password: admin123
$ /usr/local/apache/bin/htpasswd .htpasswd root # 암호파일에 두번째 사용자 추가시
3. 암호를 걸고 싶은 디렉토리 내에다 처리파일을 생성
$ vi .htaccess
AuthName "staff area” # 보호 디렉토리 대표이름
AuthType Basic # 인증 방법
AuthUserFile /usr/local/etc/httpd/.htpasswd # 암호 파일 위치
require valid-user # 특정 사용자만 허용
예)
AuthName "사용자 인증..."
AuthType Basic
AuthUserFile /usr/local/apache/htdocs/User/Member/Administrator/.htpasswd
AuthGroupFile /dev/null # 사용자가 많을 경우의 그룹 관리(안함)
<Limit GET POST>
require valid-user
</Limit>
ErrorDocument 401 ./error.htm # 에러시의 출력 문서
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
202 | System/OS |
[apache2] Redirect HTTP to HTTPS
![]() |
hooni | 2022.02.03 | 807 |
201 | System/OS |
[macos] How to Fix ‘You Shut Down Your Computer Because of a Problem’
![]() |
hooni | 2022.06.01 | 900 |
200 | System/OS | [linux] The Ultimate Wget Download Guide With 15 Awesome Examples | hooni | 2020.05.26 | 945 |
199 | System/OS | 개인적으로 쓰고 있는 zshrc 파일 | hooni | 2022.02.25 | 952 |
198 | System/OS | 개인적으로 쓰고 있는 bash_profile | hooni | 2015.01.16 | 953 |
197 | System/OS | [mac] How to uninstall MySQL on Mac OS. | hooni | 2017.11.08 | 1000 |
196 | System/OS |
[virtualbox] VirtualBox에 Ubuntu 설치하기
![]() |
hooni | 2019.11.22 | 1023 |
195 | System/OS |
[펌] 마이크로서비스, 모노리포, SRE, ... 덮어놓고 구글 따라하면 안 되는 기술들
![]() |
hooni | 2020.10.15 | 1067 |
194 | System/OS | 콘솔에서 패스워드 걸린 zip 압축하는 명령 | hooni | 2018.03.02 | 1073 |
193 | System/OS | [mac] 패키지 매니저, MacPort | hooni | 2015.01.03 | 1096 |
192 | System/OS | [mac] Homebrew/rvm/cocoapod setting | hooni | 2017.07.29 | 1123 |
191 | System/OS | [svn] Can't convert string from native encoding to 'UTF-8' 메시지가 나오는 경우 | hooni | 2014.12.18 | 1123 |