.htaccess 설정 메모
.htaccess 만들기
액세스 제한을 적용하려는 디렉토리로 이동
vim .htaccess
다음 설명
AuthType Basic
AuthName "Input your ID and Password."
AuthUserFile /home/ubuntu/.htpasswd "#.htpasswdを好きな場所に置き指定"
require valid-user
.htpasswd 만들기
다음과 같은 htpasswd 작성 도구를 사용하면
.htpasswd 파일 생성 (작성)
h tp // w w.ぅft. 이. jp / c 기 / ht 파 swd. php


.htpasswd 부분을 복사합니다.
방금 지정한 htpasswd를 설치할 디렉토리로 이동합니다.
vim .htpasswd
복사한 비밀번호를 붙여넣기
test:t7m7HYtyrrr/g
VirtualHost 설정
AllowOverride를 All로 설정
<Directory /var/www/html/>
AllowOverride All
</Directory>
Apache 재부팅
/etc/init.d/apache2 restart
동작 확인할 수 있었다.

IP 제한을 걸는 방법
.htaccess에 다음을 추가한다.
order deny,allow
deny from all #全てのホストを拒否する
allow from 許可したいIP1 #許可するホストだけ指定
allow from 許可したいIP2 #追加する分は追記
이상.
Reference
이 문제에 관하여(.htaccess 설정 메모), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/kozimon/items/3ca6cf6eb87243099ce9텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)