개발자의 끄적끄적

[apache] CentOS7 SSL 인증서 설치하기 본문

개발/was & server

[apache] CentOS7 SSL 인증서 설치하기

효벨 2020. 3. 24. 01:00
728x90
반응형

[apache] CentOS7 SSL 인증서 설치하기

 

[서버환경]

CentOS 7.2

Apache 2.4

 

Yum으로 설치되었으며 mod_ssl 설치가 안되어 설치를 진행.

 

]# yum -y install mod_ssl

 

conf.d 아래이 ssl.conf 가 생성된다. 해당 설정파일에서 가상호스트를 작성한다.

 

<VirtualHost _default_:443> 해당 부분을 알맞게 수정.

 

<VirtualHost *:443>

 ServerName abc.com

 ServerAlias www.abc.com

 DocumtnRoot /home/abc/www

 

 SSLEngine On

 SSLCertificateFile /etc/httpd/cert/abc.com.crt

 SSLCertificateKeyFile /etc/httpd/cert/abc.com.key

</VirtualHost>

 

]# service httpd restart

Redirecting to /bin/systemctl restart  httpd.service

 

 

서비스 재시작하는 부분에서 에러가 뜰수 있는데 해당 내용을 살펴보면

 

]# systemctl status httpd.service

------------------------httpd[3100]: In order to read them you have to provide the pass phrases.

 

Pass Phrase 요구한다.

 

Pass를 Key파일안에 삽입하기로 한다.

 

]# openssl rsa -in /etc/httpd/cert/abc.com.key -out /etc/httpd/cert/abc.com.key

Enter pass phrase for abc.com.key:

writing RSA key

 

 

이후 서비스 재시작

 

]# service httpd restart

Redirecting to /bin/systemctl restart  httpd.service

 

포트 확인

 

]# netstat -lnp | grep 443

tcp6       0      0 :::443                  :::*                    LISTEN      3794/httpd



출처: https://rootrator.tistory.com/136 [R O O T + A D M I N I S T R A T O R]

반응형
Comments