[리눅스] CentOS 7 https적용하기 (ssl세팅)
2022. 1. 21. 15:51ㆍ리눅스
반응형
openssl로 인증서(crt)와 개인키(key) 생성 하여 특정 경로에 저장
> yum -y install mod_ssl
> cd /etc/httpd/conf.d
> vi ssl.conf
ssl.conf 설정파일 맨 아래에 다음 내용 입력
<VirtualHost {접속 아이피}:443>
ServerName {접속 도메인}
ServerAlias www.{접속 도메인}
SSLEngine on
SSLCertificateFile {crt확장자로 되어 있는 인증서 경로}/{인증서명}.crt
SSLCertificateKeyFile {key확장자로 되어 있는 인증서 키 경로}/{인증서 키명}.key
CustomLog /var/log/httpd/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
ErrorLog /var/log/httpd/ssl_error_log
</VirtualHost>
443포트 방화벽 오픈
> firewall-cmd --permanent --add-service=https
> systemctl start/restart firewalld
> systemctl start/restart httpd
브라우져로 443포트로 접속시 url입력창 맨 왼쪽에 잠겨있는 자물쇠모양이 보여지고 정상적으로 화면이 보여지면 성공
* systemctl start/restart httpd 호출시 'Enter SSL pass phrase for...' 메시지가 보여지는걸 제거해줄려면
ssl 인증서 키 경로로 이동하여 아래와 같은 명령어 입력
cp {인증서 키명}.key copy_{인증서 키명}.key.org
openssl rsa -in copy_{인증서 키명}.key.org -out {인증서 키명}.key
출처: https://blog.bbom.org/45 [임성진의 블로그입니다~~]
반응형
'리눅스' 카테고리의 다른 글
[리눅스] yum 관련 명령어 (0) | 2022.11.21 |
---|---|
[리눅스] mariadb 백업처리 (1) | 2022.01.27 |
[리눅스] CentOS 7 mariadb 설치하기 (0) | 2022.01.21 |
[리눅스] CentoOS 7 리눅스 jsp개발환경 세팅 (0) | 2022.01.19 |
[리눅스] crond를 이용하여 DB백업 배치 돌리기 (0) | 2021.12.19 |