Redis 레디스 명령어
Remark : Redis command 명령어를 알아보자 메모리 모두 삭제 : flushall 사용 메모리 확인 : info Memory
Remark : Redis command 명령어를 알아보자 메모리 모두 삭제 : flushall 사용 메모리 확인 : info Memory
1.설치 2.실행, 중지, 재시작 3.상태확인 4.설정파일 4.1모든 아이피 허용 4.2포트변경 4.3접속Password 설정 4.4잘되는지 확인 4.5 redis-server 기타 정보 확인 4.6 redis-server 낮은버전으로 설치된 경우 4.7 EPEL 및 YUM Utilities 패키지 설치 후 redis 다시 설치 5. 로컬에 접속 5.0 호스트, 포트, 비빈으로 접속 5.2 한글 안깨지게 호스트, 포트, 비빈으로 접속 5.3 데이타 넣기 5.4 데이타… Read More »
remark : Tomcat8 특정 아이피만 허용 To allow access only for the clients connecting from localhost:
1 2 3 4 |
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1"/> |
or
1 2 3 4 |
<Valve className="org.apache.catalina.valves.RemoteCIDRValve" allow="10.0.0.0/8, 127.0.0.1, ::1"/> |
To allow unrestricted access for the clients connecting from localhost but for all other clients only to port 8443:
1 2 3 4 5 |
<Valve className="org.apache.catalina.valves.RemoteAddrValve" addConnectorPort="true" allow="127\.\d+\.\d+\.\d+;\d*|::1;\d*|0:0:0:0:0:0:0:1;\d*|.*;8443"/> |
or
1 2 3 4 5 |
<Valve className="org.apache.catalina.valves.RemoteCIDRValve" addConnectorPort="true" allow="127.0.0.1;\d*|::1;\d*|10.0.0.0/8;8443"/> |
Remark : SSL certificate 1. Install Let’s Encrypt client (Certbot)
1 2 3 4 |
# yum install epel-release # yum install certbot python2-certbot-apache mod_ssl |
2. Get an SSL Certificate
1 2 3 4 5 6 7 |
# sudo certbot --apache -d test.com -d www.test.com Or # sudo certbot --apache -d sub.test.com |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator apache, Installer apache Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): admin@domain.com Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server at https://acme-v02.api.letsencrypt.org/directory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (A)gree/(C)ancel: A - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: N Starting new HTTPS connection (1): supporters.eff.org Obtaining a new certificate Performing the following challenges: http-01 challenge for domain.com Waiting for verification... Cleaning up challenges Created an SSL vhost at /etc/httpd/conf.d/domain.com-le-ssl.conf Deploying Certificate to VirtualHost /etc/httpd/conf.d/domain.com-le-ssl.conf |
1 2 3 4 5 6 7 8 9 10 |
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: No redirect - Make no further changes to the webserver configuration. 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for new sites, or if you're confident your site works on HTTPS. You can undo this change by editing your web server's configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1 |
2.1 delete SSL (필요시)
1 2 3 |
# sudo certbot delete --cert-name example.com |
3. check the newly created SSL certificate
1 2 3 4 5 |
# ls /etc/letsencrypt/live/domain.com/ cert.pem chain.pem fullchain.pem privkey.pem |
Conform
Remark: firewalld 은 zone 기준으로 세팅해보자 1. firewalld zone Check 2. zone add 2.1 zone delete 3. mysql-access 192.168.0.111 allow 4. mysql-access port=3306/tcp allow 5. firewall reload
1. 특정 IP 막기 2. firewall 적용 3. firewall 적용 확인 4. IP 풀기 4.1 firewall 적용
firewalld 기본설치 Remark: CentOS 에서 firewalld 가 기본적으로 설치 되어있습니다. 1. firewall Status Check 2. firewall reload 3. http 서비스를 추가합니다. 4. 시스템 재부팅 또는 방화벽 재시작 후에도 적용되도록 하려면 –permanent 옵션을 붙입니다. 5. 사용 가능한 모든 서비스/포트 목록을 출력 6. http 서비스를 제거합니다. 7. 재실행시 중지
CentOS 열린포트 확인 remark : 열린포트 확인 해보기 netstat -tnlp
Remark: 해킹의 근간이 되는 IP주소에 컴이 있는지 확인하는 Ping 요청을 막아보자 1. Ping 요청에 무응답 세팅 (닫아주기) 1.1 ping 확인 2. Ping 요청에 응답 세팅 (열어주기) 2.1 ping 확인
백업 : root 권한으로 백업 복원 : root 권한으로 복원 스케쥴 걸기 : sql.sh 파일을 만들어 crontab 에 세팅 등록 내용 설정 분,시,일,월,요일, 실행명령 순으로 설정 crontab 파일 형식—— ——– —————————————————필 드 의 미 범 위—— ——– —————————————————첫번째 분 0-59두번째 시 0-23세번째 일 0-31네번째 월 1-12다섯번째 요일 0-7 (0 또는 7=일요일, 1=월, 2=화,…)여섯번째 명령어 실행할… Read More »