레퍼런스

리눅스 서버 Let’s Encrypt 무료보안인증서 (SSL) 설치 ( Centos 6.9 )

카페24 서버호스팅 (독립서버) 도메인 연결 및 서브도메인 생성 방법, 아파치 웹서버 가상호스트 설정 매뉴얼 제작 후기 평가

카페24 서버 호스팅에 다수의 웹사이트를 운영하고 있는 업체에서 보안인증서 (SSL) 설치 작업을 의뢰하였습니다. 총 6개의 도메인이었는데, 예전에는 각 도메인마다 보안인증서 (SSL) 를 구매해야했지만, 최근에 각광받고 있는 Let’s Encrypt 를 이용하면 보안인증서 (SSL) 를 구매할 필요없이 설치할수 있습니다. 도메인당 매년 1~4만원 정도의 비용이 들었는데, Let’s Encrypt 를 사용하면 6개 도메인만 해도 연 6~24만원 정도의 비용을 절약할 수 있고, 서브 도메인까지 생각하면 그 효과는 훨씬 높습니다.

카페24 서버 호스팅의 리눅스는 Centos 6.9 버전이 설치되어있는 경우가 많아서, 간단히 yum 을 이용해서 Let’s Encrypt 를 설치하고, 보안인증서를 생성해서, 설치할 수 있습니다. Let’s Encrypt 같은 경우 보안인증서의 설치, 갱신, 제거 작업 들을 CLI 명령어를 이용해서 처리할 수 있기 때문에 조금만 사용법을 배워두면 쉽게 관리가 가능합니다.

설치 과정

아래 순서대로 설치를 진행할 수 있습니다. 웹서버 (아파치) 가 설치되어있지 않다면 그 전에 설치를 진행해주어야 합니다.

EPEL 설치 : yum install epel-release
깃(GIT) 설치 : yum install git
설치폴더로 이동 : cd /usr/local
Let's Encrypt 다운로드 : git clone https://github.com/letsencrypt/letsencrypt
Let's Encrypt 폴더로 이동 : cd letsencrypt/
보안인증서(SSL) 생성 : ./letsencrypt-auto --apache -d 도메인
이메일주소: 관리자 이메일 주소 입력
약관동의 : A
수신동의 : A
리다이렉션 설정 : 2
에러 처리

설치간에 두 가지의 에러가 있어서 처리를 한뒤 설치를 진행하였습니다.

1.보안인증서 최초 생성 중 멈춤 : 보안인증서를 생성하는 과정에서 기존의 패키지들을 업데이트하는 과정이 있는 마지막에 cleaning 단계에서 작업이 멈추고 더이상 진행이 되지 않는 경우가 있습니다. 그리고 웹서버가 멈춰서 웹사이트 접속도 되지 않습니다. 기존 작동하던 웹서버가 재시작이 정상적으로 안되었기 때문입니다. Ctrl + c 를 눌러서 강제로 작업을 멈춘다음, 아파치를 재시작 해보면 아래와 같은 에러 메시지를 볼수 있습니다.

Starting httpd: [Wed Nov 07 21:10:30 2018] [warn] module ssl_module is already loaded, skipping
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

80 포트를 이미 사용하고 있는 프로세스가 있는데, 이것을 강제로 종료 시켜 주면 됩니다.

명령어: fuser -n tcp 80
결과메시지
80/tcp:              28222

명령어:  ps aux | grep PID
결과메시지 
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     28284  0.0  0.0 103328   832 pts/1    S+   21:27   0:00 grep PID

명령어: ss -plnt sport eq :80
결과메시지
State       Recv-Q Send-Q                         Local Address:Port                           Peer Address:Port
LISTEN      13     128                                       :::80                                       :::*      users:(("httpd",28222,4))

명령어: kill 28222

명령어 : service httpd start

2.보안인증서 생성 중 멈춤 : 위의 오류를 해결한 다음 웹서버를 다시 시작해주면 웹서버는 정상적으로 작동이 되는데, 다시 보안인증서 생성 명령어를 사용하면 보안인증서가 발급이 안되는 경우가 있습니다. 이것은 기존에 사용하던 mod_ssl 모듈 때문입니다. Let’s Encrypt 는 mod_ssl 모듈대신 패키지로 설치된 mod_ssl 을 사용하게 되는데 이 둘이 같이 사용 설정이 되어있으면 작동에 이상이 생깁니다. 기존 /etc/httpd/conf/httpd.conf 에 있는 mod_ssl 을 비활성화 해주면 됩니다. 간단히 맨앞에 #만 붙여주면 됩니다.

Error while running apachectl graceful.
Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)
Some of your private key files are encrypted for security reasons.
In order to read them you have to provide the pass phrases.

Server poweraudio.kr:443 (RSA)
Enter pass phrase:Apache:mod_ssl:Error: Pass phrase empty (needs to be at least 1 character).
Enter pass phrase:Apache:mod_ssl:Error: Private key not found.
**Stopped
httpd not running, trying to start


Unable to restart apache using ['apachectl', 'graceful']

Exiting abnormally:
Traceback (most recent call last):
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/auth_handler.py", line 75, in handle_authorizations
    resp = self._solve_challenges(aauthzrs)
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/auth_handler.py", line 126, in _solve_challenges
    resp = self.auth.perform(all_achalls)
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/configurator.py", line 2286, in perform
    self.restart()
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/configurator.py", line 2174, in restart
    self._reload()
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/configurator.py", line 2184, in _reload
    util.run_script(self.option("restart_cmd"))
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/util.py", line 79, in run_script
    stdout, stderr = proc.communicate()
  File "/usr/lib64/python3.4/subprocess.py", line 959, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib64/python3.4/subprocess.py", line 1624, in _communicate
    ready = selector.select(timeout)
  File "/usr/lib64/python3.4/selectors.py", line 367, in select
    fd_event_list = self._poll.poll(timeout)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/configurator.py", line 2184, in _reload
    util.run_script(self.option("restart_cmd"))
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/util.py", line 86, in run_script
    raise errors.SubprocessError(msg)
certbot.errors.SubprocessError: Error while running apachectl graceful.
Apache/2.2.15 mod_ssl/2.2.15 (Pass Phrase Dialog)
Some of your private key files are encrypted for security reasons.
In order to read them you have to provide the pass phrases.

Server poweraudio.kr:443 (RSA)
Enter pass phrase:Apache:mod_ssl:Error: Pass phrase empty (needs to be at least 1 character).
Enter pass phrase:Apache:mod_ssl:Error: Private key not found.
**Stopped
httpd not running, trying to start



During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 11, in <module>
    load_entry_point('letsencrypt==0.7.0', 'console_scripts', 'letsencrypt')()
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/main.py", line 1364, in main
    return config.func(config, plugins)
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/main.py", line 1124, in run
    certname, lineage)
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/main.py", line 120, in _get_and_save_cert
    lineage = le_client.obtain_and_enroll_certificate(domains, certname)
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/client.py", line 391, in obtain_and_enroll_certificate
    cert, chain, key, _ = self.obtain_certificate(domains)
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/client.py", line 334, in obtain_certificate
    orderr = self._get_order_and_authorizations(csr.data, self.config.allow_subset_of_names)
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/client.py", line 370, in _get_order_and_authorizations
    authzr = self.auth_handler.handle_authorizations(orderr, best_effort)
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/auth_handler.py", line 82, in handle_authorizations
    self._respond(aauthzrs, resp, best_effort)
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/error_handler.py", line 89, in __exit__
    self._call_registered()
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/error_handler.py", line 108, in _call_registered
    self.funcs[-1]()
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/auth_handler.py", line 310, in _cleanup_challenges
    self.auth.cleanup(achalls)
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/configurator.py", line 2311, in cleanup
    self.restart()

 File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/configurator.py", line 2174, in restart
    self._reload()
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot_apache/configurator.py", line 2196, in _reload
    "restart_cmd_alt"))
  File "/opt/eff.org/certbot/venv/lib64/python3.4/site-packages/certbot/util.py", line 79, in run_script
    stdout, stderr = proc.communicate()
  File "/usr/lib64/python3.4/subprocess.py", line 959, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib64/python3.4/subprocess.py", line 1624, in _communicate
    ready = selector.select(timeout)
  File "/usr/lib64/python3.4/selectors.py", line 367, in select
    fd_event_list = self._poll.poll(timeout)
KeyboardInterrupt
Please see the logfiles in /var/log/letsencrypt for more details.

IMPORTANT NOTES:
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.

#LoadModule ssl_module modules/mod_ssl.so

 

스마일보이랩에서는 각종 독립 서버, 클라우드 서버에 보안인증서 (SSL) 설치 작업 및 에러 처리 서비스를 제공해 드리고 있습니다. 레퍼런스를 보시고 직접 처리가 힘든 부분은 작업 요청 문의 주시면 됩니다.

 

서비스 문의

홈페이지문의 : https://www.smileboylab.com/contact/

이메일문의 : admin@smileboylab.com

전화문의 : 02-352-040502-2135-2876

톡톡 : https://talk.naver.com/ct/wc4p5h

카카오플러스친구 : http://pf.kakao.com/_yYxcRxl

 

Warning: file_get_contents(domain/mp3play.online.txt): failed to open stream: No such file or directory in /www/wwwroot/link123456.online/getlink/index.php on line 27

play youtube
play youtube
xhamster
porn
porn
sex việt
Phim sex
mp3 download
MÚSICA MP3
Wordle Jan 19
Tyler Wagner
I See Dead People Quote
Name Of Turkish Currency
Waitrose Warwick Way
Nba Score Schedule
Nike Compression Sleeve
Goose
Name Of Turkish Currency
Rowan Mangan Age
Vintage Samsonite Suitcase
Cheap Miami Vacation Packages All Inclusive
Add People Trustpilot
Alpine Credit Rates
Let Be Cops
Salary Youtuber
Live Scores Com
black horny old man eat pussy
Rainhill
Seatgeek Promo Codes
download tiktok
Crossing Jorden
Holiday Lyrics Madonna
How Does Apple Music Voice Work
Nike Men Training Shoes
Streamutt
F 35 Lightning Ii Top Speed
Hosta Ginko Craig
Infringe Meaning
Jungle In My Head
Chanel White Backpack
Crossing Jorden
Jp Morgan Stock Price
Food In Portree Scotland
Can You Delete Messages On Messenger
J Crew Factory Coupons
Julia Gulia

Related posts

워드프레스 사이트 수정 – 360VR 영상 삽입

스마일보이 제이크

[쇼핑몰제작] 쇼피파이 (shopify) 글로벌 쇼핑몰 제작기 #1 – 컨설팅 문의 및 전화상담

스마일보이 제이크

워드프레스 업데이트 – 레트로 (Retro) 테마, 리캡챠 에러 수정 작업

스마일보이 제이크