로그인

검색

조회 수 31199 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 게시글 수정 내역 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 게시글 수정 내역 댓글로 가기 인쇄


우분투 8.x ~ 10.04 ~ 12.04 기준.



설정을 하기전에는 openssl 설치가 되어 있어야함


apt-get install openssl libapache2-mod-ssl
a2enmod ssl




SSL 연결에 필요한 파일


1. Startssl 에서 1번째로 만든 key 파일.

2. Startssl 에서 2번째로 발급받은 crt 파일.

3. Toolbox -> StartCom CA Certificates 에서 다운로드 한 루트인증기관 ca.pem 파일

4. Toolbox -> StartCom CA Certificates 에서 다운로드 한 루트인증기관체인 sub.class1.server.ca.pem 파일



루트인증기관 파일 다운로드 방법



c1.png 





우분투(리눅스) 서버쪽 설정..


아래의 파일을 FTP 업로드후 각 디렉토리에 맞게 이동시켜준다


mv 내도메인.crt /etc/ssl/certs/

mv 내키.key /etc/ssl/private/

mv ca.pem /etc/ssl/certs/

mv sub.class1.server.ca.pem /etc/ssl/certs/



아파치 설정



vi /etc/apache2/sites-available/도메인.com


기존 http 설정 아래에 삽입합니다.. (#은 주석처리된것임)



<VirtualHost *:80>

           .

           .

           . 생략

</VirtualHost>

<VirtualHost _default_:443>

   DocumentRoot /home/내아이디/public_html ;내계정 디렉토리

   ServerName 도메인:443

   ServerAdmin 이메일주소

   #ErrorLog /usr/local/apache/logs/error_log

   #TransferLog /usr/local/apache/logs/access_log

   SSLEngine on

   SSLProtocol all -SSLv2

   SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM


   SSLCertificateFile /etc/ssl/certs/내인증서.crt

   SSLCertificateKeyFile /etc/ssl/private/내키.key

   SSLCertificateChainFile /etc/ssl/certs/sub.class1.server.ca.pem

   SSLCACertificateFile /etc/ssl/certs/ca.pem


  <Files ~ "\.(cgi|html|shtml|phtml|php?\d?)$">

     SSLOptions +StdEnvVars

  </Files>

   SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

   #CustomLog /usr/local/apache/logs/ssl_request_log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>



저장하고 나온다음 아파치를 재시작 하면 


/etc/init.d/apache2 restart (service apache2 restart)


완료 됩니다...





주의

단 startssl class1 은 와일드카드 라이센스가 아니기 때문에..

하나의 ip로 이루어진 가상 호스트에서는 여러개 사용시 포트를 변경 해주어야 합니다.

단독도메인이면 상관없음.


vi /etc/apache2/port.conf


<IfModule mod_ssl.c>

    # If you add NameVirtualHost *:443 here, you will also have to change

    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl

    # to <VirtualHost *:443>

    # Server Name Indication for SSL named virtual hosts is currently not

    # supported by MSIE on Windows XP.

    # NameVirtualHost *:443

    Listen 443

   Listen 444

</IfModule>



빨간줄처럼 listen 포트를 열어주고 아파치를 재시작합니다.

port가 변경되었기 때문에 마찬가지로 해당도메인에 대한 virtualhost 에서 설정한 부분도 변경해줘야 합니다..



vi /etc/apache2/sites-available/도메인.com


<VirtualHost _default_:444>

   DocumentRoot /home/내아이디/public_html  ;내계정 디렉토리

   ServerName 도메인:444



아래와 같이 연결됩니다.


https://내도메인:444 




주의2. 

startssl 에서 key 파일 생성시에 비번을 넣었기때문에 

아파치 재시작시 비밀번호를 물어본다.


openssl rsa -in [처음받은key파일] -out [비번제거해서 새로생성할파일명] 


cd /etc/ssl/private/

openssl rsa -in 내인증서.key -out 내인증서.key

(파일명은 알아서 변경..)





(key 생성과정에서 넣었던 비번)

20.png



리눅스

유용한 정보 및 자료

  1. 우분투 nginx rewrite

    Date2011.11.03 CategoryServer By보석 Views235869
    Read More
  2. 우분투 mysql DB 파일 위치 변경 방법 패키지로 설치 했을 경우

    Date2013.08.26 CategoryServer By보석 Views57387
    Read More
  3. [리눅스] 새 계정 만들기/지우기, 사용자 아이디 추가/삭제; Create Account

    Date2011.08.31 CategoryServer By보석 Views39168
    Read More
  4. 리눅스용 무료 웹하드 <shade webhard> 설치하기

    Date2011.10.17 CategoryServer By보석 Views36136
    Read More
  5. [우분투] screen 명령어

    Date2013.02.04 CategoryServer By보석 Views33018
    Read More
  6. 우분투 리눅스에서 APM 설치하기 (웹서버 설정)

    Date2011.07.04 CategoryServer By보석 Views32846
    Read More
  7. Startssl.com 무료 ssl 인증서 서버 설정

    Date2012.08.17 CategoryServer By보석 Views31199
    Read More
  8. 우분투 가상호스트 설정

    Date2011.05.15 CategoryServer By보석 Views28853
    Read More
  9. 우분투 Memcached 설치는 이렇게

    Date2011.10.19 CategoryServer By보석 Views28786
    Read More
  10. Nginx 가상호스트 설정

    Date2011.10.31 CategoryServer By보석 Views27860
    Read More
  11. 링크하드 리눅스 설치 성공담 - 웹하드 WebHard Linux Install

    Date2011.10.17 CategoryServer By보석 Views27005
    Read More
  12. 테이블 형태 변경하기 MyISAM -> InnoDB(또는 InnoDB -> MyISAM)

    Date2011.10.21 CategoryServer By보석 Views25963
    Read More
  13. 우분투 PHP5.3 버젼에 ioncube설치하기

    Date2011.10.17 CategoryServer By보석 Views25749
    Read More
  14. Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Ubuntu 11.10

    Date2011.11.01 CategoryServer By보석 Views25692
    Read More
  15. Install Nginx, PHP5, PHP-FPM and MySQL on Ubuntu 11.04

    Date2011.10.31 CategoryServer By보석 Views25494
    Read More
  16. 링크하드 nginx rewrite 해결방법

    Date2012.05.30 CategoryServer By보석 Views25204
    Read More
  17. 설치된 패키지 깨끗이 삭제하지

    Date2011.11.03 CategoryServer By보석 Views24470
    Read More
  18. 우분투 rpm 파일을 deb로변경후 설치하기

    Date2013.02.15 CategoryServer By보석 Views23855
    Read More
  19. 우분투 센드메일 설치 및 설정 sendmail

    Date2011.05.16 CategoryServer By보석 Views22216
    Read More
  20. 우분투 로그 위치 및 각 로그의 설명

    Date2013.08.25 CategoryServer By보석 Views21415
    Read More
Board Pagination Prev 1 2 3 4 Next
/ 4