블로그 이미지
Rootrator
1개를 알면 모르는 10개가 튀어나온다..!

calendar

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

Notice

2018. 11. 28. 16:40 Linux


[서버환경]

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



반응형
posted by Rootrator