[ Server ][ Linux ] CentOS7 Let's Encrypt 무료 SSL인증서 설치 / 관리(확인) / 삭제 > linux

본문 바로가기
사이트 내 전체검색

linux

[ Server ][ Linux ] CentOS7 Let's Encrypt 무료 SSL인증서 설치 / 관리(확인) / 삭제

페이지 정보

작성자 웹지기 댓글 2건 조회 6,868회 작성일 19-10-31 13:36

본문

※ 서버의 관리자 권한으로 접속해야 다음의 명령들이 실행이 가능해 진다.

 

certbot 설치

 1) 자동설치) https://certbot.eff.org 사이트 접속해서 본인 서버의 운영체제를 체크하고 진행하게 도와준다.

 

 2) 수동설치 - 아파치존 AAI기준

  = AAI에서는 기본 설치명령을 통해 python-certbot-apache가 자동으로 설치되므로 추가 설치는 필요치 않다.

  = AAI에서 adduser.sh를 통해서 자동으로 ssl을 설치할 수 있지만, 1개의 계정에 1개의 ssl만 설치하는 구조이므로 

여러개의 도메인 또는 서브도메인이 있다면 수동으로 설치를 해줘야 한다.

 - 한개의 계정에 대한 명령(adduser.sh)로 자동설치 가능

  = 수동설치

# certbot --apache -d domain.com -d www.domain.com

# 또는 

# certbot certonly --webroot -w /home/계정명/public_html -d domain -d www.domain

 

  = 여러개의 도메인 적용시 다음과 같이 사용

# certbot --apache -d domain.com,www.domain.com,domain2.com,www.domain2.com

또는

# certbot --apache -d domain.com -d www.domain.com -d domain2.com -d www.domain2.com

 

현재설치된 certbot 확인

# certbot certificates

 

certbot 자동 갱신

 - 기본적으로 3달에 한번 갱신을 해줘야 하는데, AAI같은 경우 자동으로 갱신이 되도록 설정되었다.

 ( /etc/cron.daily/letsencrypt-renew 에 자동 설정 되어있슴 )

 

인증서 해지 ( https://certbot.eff.org/docs/using.html#revoking-certificates )

 - 보안 사고 등으로 인해 비밀키가 유출되어 인증서를 교체하려는 경우, 기존인증서를 삭제하기전 해지(revoke)를 해주어야 안전.

# certbot revoke --cert-path /etc/letsencrypt/live/example.com/cert.pem

 

인증서 삭제 

 - 인증서파일과 ssl로 설정된 파일을 지워준다.

# certbot delete --cert-name example.com

# cd /etc/httpd/conf.d

# rm -rf username-le-ssl..conf

 

해당폴더에서 username-le-ssl.conf 파일 삭제 여부 확인

파일이 존재 할 시 다시 삭제

username.conf 파일내의 https관련 부분이 있다면 삭제

# systemctl restart httpd

 

 

추천1 비추천0

댓글목록

장승원님의 댓글

장승원 작성일

도메인이 하나일때는 정상 작동하지만 도메인이 여러개일 경우 작동이 되지 않습니다.
아파치님께서 다음의 명령으로 진행하라고 하셔서 진행해볼 생각입니다.
# certbot certonly --webroot -w /home/$id/public_html -d domain -d www.domain 와 같은 방식 입니다.

장승원님의 댓글의 댓글

장승원 작성일

설치후 설정이 좀 필요하긴 하지만 정상 작동하네요
일단 이방법은 userid.conf 파일을 수정하지 않고 userid-le-ssl.conf 파일도 생성하지 않으므로 직접 넣어주어야 한다.

/etc/httpd/conf.d/userid.conf 파일에 VirtualHost 안쪽에 다음을 추가( http로들어와도 https로 리다이렉트)
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.domain.com [OR]
RewriteCond %{SERVER_NAME} =www.domain2.com [OR]
RewriteCond %{SERVER_NAME} =domain.com [OR]
RewriteCond %{SERVER_NAME} =domain2.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

/etc/httpd/conf.d/userid-le-ssl.conf 파일추가
<IfModule mod_ssl.c>
<VirtualHost *:443>
DocumentRoot /home/userid/public_html
ServerName domain.domain.com
ServerAlias domain.com www.domain.com domain2.com www.domain2.com
<FilesMatch \.php$>
    SetHandler proxy:fcgi://127.0.0.1:9072
</FilesMatch>
    ErrorLog logs/domain.com-error_log
    CustomLog logs/domain.com-access_log common
#SetEnvIFNoCase Referer newkoad.com link_allow
#<FilesMatch "\.(gif|jpg|jpeg|png|bmp)$">
#  Order allow,deny
#  allow from env=link_allow
#  #deny from all
#</FilesMatch>
    <Directory "/home/userid/public_html">
        Options FollowSymLinks MultiViews
        Allow from all
        Require all granted
        AllowOverride all
        Order allow,deny
    </Directory>
RewriteEngine on
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
</VirtualHost>
</IfModule>

이렇게 추가하고 접속해보면 된다.

Total 103건 2 페이지
  • 87 [ Server ][ Linux ] CentOS7 su 접속 그룹으로 제한하기
  • CentOS7 의 경우 우분투처럼 관리자의 권한이 있는 계정만 su로 로그인이 되지 않고, 모든 계정이 로그이 되게 설정되어있다. 이를 특정계정만 로그인이되게 그룹을 설정해서 접속을 제한하는 방법이다. root 또는 su로 이동해서 명령을 실행한다. # vim /etc/pam.d/su 해당 파일을 열면 다음과 같은 결과를 얻을 것이다. 아래 결과에서 pam_wheel.so use_uid 부분의 주석을 제거해준다. # #%PAM-1.0 # auth ...
  • 웹지기 11-05 6514 0 0 댓글 0
  • 86 [ Server ][ Linux ] CentOS7 ZipArchive 설치(php-pecl-zip)
  • 패키지 설치 및 실행 확인 # yum search zip |grep -i php # # * remi-php72: ftp.riken.jp # php-mcnetic-zipstreamer.noarch : Stream zip files without i/o overhead # php-pclzip.noarch : Compression and extraction functions for Zip formatted # php-pecl-zip.x86_64 : A ZI...
  • 웹지기 11-04 7519 1 0 댓글 1
  • 열람중 [ Server ][ Linux ] CentOS7 Let's Encrypt 무료 SSL인증서 설치 / 관리(…
  • ※ 서버의 관리자 권한으로 접속해야 다음의 명령들이 실행이 가능해 진다. certbot 설치 1) 자동설치) https://certbot.eff.org 사이트 접속해서 본인 서버의 운영체제를 체크하고 진행하게 도와준다. 2)수동설치 - 아파치존 AAI기준) = AAI에서는 기본 설치명령을 통해 python-certbot-apache가 자동으로 설치되므로 추가 설치는 필요치 않다. = AAI에서 adduser.sh를 통해서 자동으로 ssl을 설치할 수 있지만, 1개의 계정에 1개...
  • 웹지기 10-31 6869 1 0 댓글 2
  • 83 [ server ][ linux ] Centos7 ssl - 호스트에 필요한 TLS 설명 및 버젼 확인
  • Transport Layer Security 인터넷에서의 정보를 암호화해서 송수신하는 프로토콜, 넷스케이프 커뮤니케이션스가 개발한 SSL(Secure Sockets Layer)에 기반한 기술로, 국제 인터넷 표준화 기구에서 표준으로 인정하는 프로토콜이다. 표준에 명시된 정식 명칭은 TLS지만 아직도 SSL 이라는 용어가 많이 사용되고 있다. CentOS7 에서 다음으로 현재 사용하는 버젼을 확인 tls 1.2 # openssl s_client -connect www.googl...
  • 웹지기 10-18 6866 0 0 댓글 0
  • 82 [ server ][ linux ] CentOS7 특정 포트 확인 및 강제 종료
  • 특정 포트를 사용중인지 확인하기 위한 방법 어디에 사용되는 포트인지 알고 싶은 포트를 8882 의 위치에 적는다. kill에서 -9는 강제종료 맨뒤 숫자는 pid 번호 # lsof -i TCP:8882 # COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME # php 109808 root 4u IPv4 201975 0t0 TCP *:8882 (LISTEN) # php 109808 root 7u IPv...
  • 웹지기 10-11 5241 0 0 댓글 0
  • 80 [ Server ][ CentOS7] ModSecurity: Warning. Operator GE match…
  • [Tue Sep 24 13:17:58.056498 2019] [:error] [pid 3620:tid 140457073518336] [client 127.0.0.1:36381] [client 127.0.0.1] ModSecurity: Warning. Operator GE matched 5 at TX:inbound_anomaly_score. [file "/etc/httpd/modsecurity.d/activated_rules/modsecurity_crs_60_correlation.conf&...
  • 웹지기 09-24 4216 0 0 댓글 0
  • 79 [ Server ][ CentOS7 ] ClamAV AntiVirus install
  • Notes on ClamAV AntiVirus CentOS 7 VM notes:Set /etc/clamd.d/scan.conf “MaxThreads” to 1 (default is 10) to avoid too much CPU usage upon reboot CentOS 7 issues:https://www.adminsys.ch/2015/08/21/installing-clamav-epel-centosred-hat-7-nightmare/http://linux-audit.com/install-cl...
  • 웹지기 09-03 7574 0 0 댓글 0
  • 77 [ Server ][ Linux ] CentOS7 IP 확인 설정 변경하기
  • CentOS7 Minimal 로 설치시 별 다른 패키지가 설치 되어있지 않아 설치하기 전에는 다음의 명령을 사용한다. # ip address [root@cms_db ~]# ip address 1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 in...
  • 웹지기 08-12 8151 0 0 댓글 0
  • 76 [ Server ][ Linux ] CentOS7 Hostname 변경 / 설정하기
  • 호스트 네임이 무엇으로 되어있는지 확인해보자. # hostname # localhost.localhostname # hostname &lt;변경하고 싶은 호스트명&gt; # hostname 이렇게 하면 현재 상태의 호스트명이 일회성으로 변경이 된다. 이를 영구적으로 변경하고 싶으면 다음의 명령을 사용한다. # hostnamectl set-hostname &lt;변경하고 싶은 호스트명&gt; ...
  • 웹지기 08-12 4663 0 0 댓글 0
  • 75 [ Server ][ Linux ] CentOS7 AAI ( apm ) 설치 전 utf8 -> utf8mb4…
  • apachezone.com의 AAI 정식버젼 다운로드 기본적으로 문자셋이 utf8을 지향하고 있다. 이를 모두 utf8mb4로 변경을 한 후 설치를 해보자. FTP 또는 git을 통해 AAI를 서버에 업로드한다 업로드시에는 /root/AAI 폴더를 생성하고 이곳에 업로드를 한다. git으로 다운시는 자동으로 생성된다 AAI/APM/APMinstaller.sh 파일 452줄부터 462줄 - mysql utf8 =&gt; utf8mb4로 utf8_general_ci =&#...
  • 웹지기 08-09 4745 0 0 댓글 0
  • 74 [ Server ][ Linux ] CentOS7 AAI ( apm ) 설치 후 설정
  • apachezone.com의 AAI 정식버젼 설치 후 추가작업 목록 ( varnish 설치는 포함하지 않아도 됨 ) @/etc/cron.daily/backup 파일을 에디터로 열고 '패스워드' 를 찾아서 mysql root 패스워드로 교체 # vim /etc/cron.daily/backup @vsftpd서비스 설치 확인 # systemctl status vsftpd.service @미설치시 다음처럼 뜸 # Unit vsftpd.s...
  • 웹지기 08-08 4025 0 0 댓글 0
게시물 검색

회원로그인

접속자집계

오늘
937
어제
9,384
최대
33,828
전체
8,407,493

그누보드5
Copyright © funyphp.com. All rights reserved.