2017. 8. 3. 17:27 Linux Server/apache
[apache] letsencrypt 설치 및 설정
[ letsencrypt 설치 및 설정 ]
# git clone https://github.com/letsencrypt/letsencrypt
# cd letsencrypt
# ./letsencrypt-auto --help -> 다운받은 폴더로 이동 후 아래 명령을 실행하면 자동으로 관련 의존성을 다운받아서 설치 된다.
# ./letsencrypt-auto certonly -a webroot --agree-tos -m <이메일> -w <webrootpath> -d <SSL발급도메인명> --rsa-key-size 4096
ex) ./letsencrypt-auto certonly -a webroot --agree-tos -m les4707@naver.com -w /home/web/ -d leeeunseok.xyz --rsa-key-size 4096
기본 포트를 SSL으로 이용하는 경우
vi /usr/local/apache/conf/extra/httpd-ssl.conf
<VirtualHost *:443>
DocumentRoot 웹루트경로
ServerName 도메인명:443
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/도메인명/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/도메인명 /privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/도메인명/fullchain.pem
<VirtualHost>
이후 아파치 재시작
[root@techsmile-6580 letsencrypt]# /etc/init.d/apachectl stop
AH00526: Syntax error on line 51 of /usr/local/apache/conf/extra/httpd-ssl.conf:
Invalid command 'SSLCipherSuite', perhaps misspelled or defined by a module not included in the server configuration
아파치 재시작시 위와 같이 에러발생할경우 아래파일을 열고 주석해제
vi /usr/local/apache/conf/httpd.conf
LoadModule ssl_module modules/mod_ssl.so -> 해당부분 주석해제
[root@techsmile-6580 letsencrypt]# /etc/init.d/apachectl stop
AH00526: Syntax error on line 76 of /usr/local/apache/conf/extra/httpd-ssl.conf:
SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropriate socache module (mod_socache_shmcb?).
아파치 재시작시 위와 같이 에러발생할경우 아래파일을 열고 주석해제
vi /usr/local/apache/conf/httpd.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so -> 해당부분 주석해제
letsencrypt는 3달에 한번씩 갱신해줘야하며, 아래 내용은 도메인 갱신하는 명령어입니다.
/letsencrypt-auto certonly -a webroot --agree-tos --renew-by-default -w <webrootpath> -d <ssl갱신도메인명> --rsa-key-size 4096
vi letscron.sh -> 스크립트 만들고 크론탭에 약2달에한번 실행되도록 등록할것
#!bin/sh
echo /letsencrypt-auto certonly -a webroot --agree-tos --renew-by-default -w /home/web/ -d leeeunseok.xyz --rsa-key-size 4096
'Linux Server > apache' 카테고리의 다른 글
[apache] http_error_code (0) | 2018.02.26 |
---|---|
[apache] ip 접속 제어 (0) | 2018.02.09 |
[apache] ssl 키 발급 및 적용 (0) | 2017.06.03 |
[php 언어셋 문제] (0) | 2017.05.09 |
[apache] cband 모듈설치 (0) | 2017.04.27 |