보안이 중요한 서버에는 특정 IP만 접근을 허용하도록 설정할 수 있다.

사이트 접근(http)시 특정 IP만 허용하도록 설정해보자.

※ Centos 7 / Apache 2.4 / Tomcat 8.5 기준 

 

1. 아파치 설정

vi /etc/httpd/conf/httpd.conf

<Directory "/">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    #Allow from all
    Deny from all
    Allow from xxx.xxx.xxx.xxx
</Directory>

설정을 변경하였으면 아파치를 재실행해준다.

systemctl restart httpd

 

 

 

2. 톰캣 설정

 

톰캣 폴더의 server.xml 하단 부분을 수정해준다.

vi /톰캣폴더/conf/server.xml

<!-- Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true" -->
<Host name="localhost"  appBase=""  unpackWARs="true" autoDeploy="true">
      ...
     Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="xxx\.xxx\.xxx\.xxx" />   --> 추가
      ...

이후 톰캣을 재시작해준다.

 

'서버관리 > 기타 관리' 카테고리의 다른 글

RedHat Enterprise Linux 8.4 (RHEL) 로컬 저장소 설정  (0) 2022.05.13
UMASK와 퍼미션  (0) 2021.06.27
하드디스크 추가시 설정  (0) 2021.05.28
복사했습니다!