사이트 내 전체검색
[ajax] 아파치 특정디렉토리 암호인증 사용하기
로빈아빠
https://cmd.kr/server/129 URL이 복사되었습니다.

본문

#vi /usr/local/apache2/conf/httpd.conf
-------------------------------------------------------
<VirtualHost 211.xxx.xxx.xxx>
       
        ServerName
www.virhac.com
        DocumentRoot /home/mrtg/www
        ErrorLog logs/mrtg-error_log
        CustomLog logs/mrtg-access_log common
   
    <Directory /home/mrtg/www>
     AllowOverride AuthConfig                       <=====  AuthConfig 또는 All  
     Options IncludesNoExec
    </Directory>
 
 </VirtualHost>
---------------------------------------------------------
그리고 AccessFileName .htaccess    로 설정되어있나 확인한다.
 
그리고 나서 /home/mrtg/www 폴더에 아래와같은 파일을 생성한다..
#vi .htaccess 
--------------------------------------------------
AuthType  Basic
AuthName  " virhac.com "    

AuthUserFile  /home/mrtg/.htid
Require  valid-user 

---------------------------------------------------
 
그리고 나서 아이디 패스워드가 저장된 .htid 파일을 생성한다..
 
#cd /home/mrtg/
#/usr/local/apache2/bin/htpasswd -c /home/mrtg/.htid  nforce(아이디)
패스워드입력 2번
 
이제 웹브라우져로 확인한다....\

댓글목록

등록된 댓글이 없습니다.

1,139 (8/23P)

Search

Copyright © Cmd 명령어 3.138.123.40