CentOS 7.4.1708(64๋นํธ)
์ผํ ์ค 7 ์
sudo certbot --authenticator standalone --installer nginx --pre-hook "nginx -s stop" --post-hook "nginx"
์ฐ์ถ:
Traceback (most recent call last):
File "/bin/certbot", line 9, in <module>
load_entry_point('certbot==0.20.0', 'console_scripts', 'certbot')()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 572, i n load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2755, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2408, in load
return self.resolve()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2414, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 19, in <module>
from certbot import client
File "/usr/lib/python2.7/site-packages/certbot/client.py", line 11, in <module >
from acme import client as acme_client
File "/usr/lib/python2.7/site-packages/acme/client.py", line 32, in <module>
requests.packages.urllib3.contrib.pyopenssl.inject_into_urllib3() # type: i gnore
File "/usr/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 112 , in inject_into_urllib3
_validate_dependencies_met()
File "/usr/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 147 , in _validate_dependencies_met
raise ImportError("'pyOpenSSL' module missing required functionality. "
ImportError: 'pyOpenSSL' module missing required functionality. Try upgrading to v0.14 or newer.
๋๋ ๋์๊ฒ ์ธ์ฆ์๋ฅผ ์ฃผ๊ธฐ ์ํด ๊ทธ๊ฒ์ ์ ์ธํ์ง๋ง ๊ทธ๊ฒ์ ๊ทธ ์ค๋ฅ๋ฅผ ์ฃผ์๋ค. ์ด๋ฏธ pyOpenSSL ์ ๋ฐ์ดํธ๋ฅผ ์๋ํ์ง๋ง ์๋ํ์ง ์์์ต๋๋ค.
/var/log/letsencrypt
์ ์ ์ฅ๋ฉ๋๋ค. ์ํ๋ ๋๋ก ๋๋ฉ์ธ, ์ด๋ฉ์ผ ๋ฐ IP ์ฃผ์๋ฅผ ์์ ๋กญ๊ฒ ์์ ํ ์ ์์ต๋๋ค.ํด๋๊ฐ ์กด์ฌํ์ง ์์ต๋๋ค
์
์คํธ๋ฆผ ๋ฐฑ์๋ {
# ๋ท๋ฐ์ดํฐ ์๋ฒ
์๋ฒ 127.0.0.1:19999;
ํต์ผ๋ผ์ด๋ธ 64;
}
์๋ฒ {
# nginx๋ ์ด๊ฒ์ ๋ฃ์ต๋๋ค.
๋ค์ด๋ด 80;
# the virtual host name of this
server_name netdata.mydomain.fi;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_pass_request_headers on;
proxy_set_header Connection "keep-alive";
proxy_store off;
}
}
centos-release-7-4.1708.el7.centos.x86_64
ImportError: 'pyOpenSSL' ๋ชจ๋์ ํ์ ๊ธฐ๋ฅ์ด ์์ต๋๋ค. v0.14 ์ด์์ผ๋ก ์ ๊ทธ๋ ์ด๋ํด ๋ณด์ญ์์ค.
pyOpenSSL 0.13.1
์์ pyOpenSSL 17.5.0
๋ก ์
๊ทธ๋ ์ด๋
๋ค์ด๊ทธ๋ ์ด๋ํ ๋:
sudo pip install pyOpenSSL==0.15.1
๊ฐ์ ์ค๋ฅ
ImportError: 'pyOpenSSL' ๋ชจ๋์ ํ์ ๊ธฐ๋ฅ์ด ์์ต๋๋ค. v0.14 ์ด์์ผ๋ก ์ ๊ทธ๋ ์ด๋ํด ๋ณด์ญ์์ค.
pip install --upgrade --force-reinstall 'requests==2.6.0'
์๋
pip
yum
์ค์น๋ ํจํค์ง๋ฅผ ํผํฉํ์ง ๋ง์ญ์์ค. ์ ์ ํ ์์ ์๋ pip ํจํค์ง๋ฅผ ์ ๊ฑฐํ๊ณ yum
์์ ๋ชจ๋ ๊ฒ์ ์ค์นํ๋ ๊ฒ์ด ํฌํจ๋ฉ๋๋ค. ์ฌ๊ธฐ ์ ์ค๋ช
ํ์ต๋๋ค.
certbot์ ์คํํ๊ธฐ ์ํด CentOS 7์์ ์ต์ pyOpenSSL์ด ํ์ํ์ง ์์ต๋๋ค!
pip uninstall requests
yum reinstall python-requests
pip uninstall six
yum reinstall python-six
pip uninstall urllib3
yum reinstall python-urllib3
์ด ๋ฒ๊ทธ๋ ์ฌ์ ํ RHEL 7์์ ์ง์๋ฉ๋๋ค.
Traceback (most recent call last):
File "/bin/certbot", line 9, in <module>
load_entry_point('certbot==0.22.2', 'console_scripts', 'certbot')()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2355, in load
return self.resolve()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2361, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 20, in <module>
from certbot import client
File "/usr/lib/python2.7/site-packages/certbot/client.py", line 13, in <module>
from acme import client as acme_client
File "/usr/lib/python2.7/site-packages/acme/client.py", line 33, in <module>
requests.packages.urllib3.contrib.pyopenssl.inject_into_urllib3() # type: ignore
File "/usr/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 112, in inject_into_urllib3
_validate_dependencies_met()
File "/usr/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 147, in _validate_dependencies_met
raise ImportError("'pyOpenSSL' module missing required functionality. "
ImportError: 'pyOpenSSL' module missing required functionality. Try upgrading to v0.14 or newer.
๊ทธ๋์ ์ ํ. ๋๋ Centos๋ฅผ ์ซ์ดํ๊ธฐ ์์ํ๋ค.
CentOS์์ pyOpenSSL์ ์ ๋ฐ์ดํธํ๋ ค๊ณ ํ๋ฉด ๋ค์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
sudo pip install pyOpenSSL==0.15.1
pyOpenSSL==0.15.1 ์์ง
๋ค์ด๋ก๋ https://files.pythonhosted.org/packages/37/2f/840f2656e4bcf257cb814825bb751a9197ca6f39f1fa036ab111920ac7ef/pyOpenSSL-0.15.1-py1.py3-n
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 112kB 1.9MB/s
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/lib/python2.7/site-packages์ 6>=1.5.2(pyOpenSSL==0.15.1์์) (1.9.0)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/lib64/python2.7/site-packages์ cryptography>=0.7(pyOpenSSL==0.15.1์์) (2.3.1)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: idna>=2.1 in /usr/lib/python2.7/site-packages (from cryptography>=0.7->pyOpenSSL==0.15.1) (2.7)
์ด๋ฏธ ์ถฉ์กฑ๋ ์๊ตฌ ์ฌํญ: enum34; /usr/lib/python2.7/site-packages์ python_version < "3"(์ํธํ์์>=0.7->pyOpenSSL==0.15.1) (1.0.4)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: cffi!=1.11.3,>=1.7 in /usr/lib64/python2.7/site-packages (from cryptography>=0.7->pyOpenSSL==0.15.1) (1.11.5)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: asn1crypto>=0.21.0 in /usr/lib/python2.7/site-packages (from cryptography>=0.7->pyOpenSSL==0.15.1) (0.24.0)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: ipaddress; /usr/lib/python2.7/site-packages์ python_version < "3"(์ํธํ์์>=0.7->pyOpenSSL==0.15.1) (1.0.16)
์๊ตฌ ์ฌํญ์ด ์ด๋ฏธ ์ถฉ์กฑ๋จ: /usr/lib/python2.7/site-packages์ pycparser(cffi!=1.11.3,>=1.7->cryptography>=0.7->pyOpenSSL==0.15.1์์) (2.14)
์์ง๋ ํจํค์ง ์ค์น: pyOpenSSL
๊ธฐ์กด ์ค์น ๋ฐ๊ฒฌ: pyOpenSSL 0.13.1
'pyOpenSSL'์ ์ ๊ฑฐํ ์ ์์ต๋๋ค. distutils๊ฐ ์ค์น๋ ํ๋ก์ ํธ์ด๋ฏ๋ก ์ด๋ค ํ์ผ์ด ํด๋น ํ๋ก์ ํธ์ ์ํ๋์ง ์ ํํ๊ฒ ๊ฒฐ์ ํ ์ ์์ผ๋ฏ๋ก ๋ถ๋ถ์ ์ผ๋ก๋ง ์ ๊ฑฐ๋ฉ๋๋ค.
์ฝ๊ฐ์ ์ปจํ ์คํธ: pyOpenSSL์ dist ํจํค์ง๋ 0.13.1์ ์์ต๋๋ค. pip๋ฅผ ํตํด ์ ๋ฐ์ดํธํ๊ธฐ ์ํด ์ ๊ฑฐํ๋ ค๋ฉด - Yum์ผ๋ก certbot์ ์ ๊ฑฐํฉ๋๋ค. certbot์ ๊ณ ๋ คํ๋ฉด pyOpenSSL์ ์ ๋ฐ์ดํธํด์ผ ํ๋ ์ ์ฒด ์ด์ ์์ต๋๋ค.
yum ์ ๋ณด pyOpenSSL
๋ก๋๋ ํ๋ฌ๊ทธ์ธ: fastmirror, langpacks
์บ์๋ ํธ์คํธ ํ์ผ์์ ๋ฏธ๋ฌ ์๋ ๋ก๋
๋๋ฒ๊น ๊ณผ ์ง์ฅ ๋ชจ๋๋ฅผ ์ํด dist pyOpenSSL(๋ฐ๋ผ์ certbot)์ ์ ๊ฑฐํ๊ณ pyOpenSSL์ pip ์ค์นํ ๋ค์ certbot์ ๋ค์ ์ค์นํ์ต๋๋ค. Yum์ pyOpenSSL 0.15.1์ 0.13.1....์ผ๋ก ๋ฎ์ด์ผ๊ณ certbot์ผ๋ก ๊ฐฑ์ ํ๋ ค๊ณ ํ ๋ ๋์ผํ ๊ฒฐ๊ณผ๋ฅผ ์ป์์ต๋๋ค.
๊ทธ๋ฐ ๋ค์ sudo pip install --upgrade pyopenssl - ๋ฐ distutils ์ค์น๋ ๋ฒ์ ์ ๋ํ ๋์ผํ ์ค๋ฅ ๋ฉ์์ง๋ฅผ ์๋ํ์ต๋๋ค.
์ค๋์ ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ์์ต๋๋ค. ๊ทธ๋ฌ๋ฉด ๋ด ์ธ์ฆ์๊ฐ ๋ง๋ฃ๋ ๊ฒ ๊ฐ์ต๋๋ค.
acme.sh๊ฐ ์๋ํ๊ณ certbot์ ํฌ๊ธฐํ์ต๋๋ค ;)
์ฌ๋ฌ๋ถ, ์ค์ ๋ก ์ด๊ฒ์ ๋ํ ์์ ์ฌํญ์ ์ฐพ์์ต๋๋ค. ๋๋ ๊ธฐ์ฌ์ ๊ฑธ๋ ค ๋์ด์ง ๊ฒ ์ธ์๋ ์๋ฌด ๊ฒ๋ ํ ์ ์์ต๋๋ค. https://medium.com/@getpagespeed/fix -importerror-pyopenssl-module-missing-required-functionity-e1c514797204
์์ ์ฌํญ์ ์ฐพ์์ค Danila Vershinin์๊ฒ ๋ชจ๋ ํฌ๋ ๋ง์!
certbot ๋ฐ aws cli๊ฐ ์ค์น๋ ๊ฒฝ์ฐ ํด๋น ๋ฌธ์ ๊ฐ ๋ฐ์ํ ๊ฐ๋ฅ์ฑ์ด ๋งค์ฐ ๋๋ค๋ ์ ๋ง ์ถ๊ฐํ ์ ์์ต๋๋ค.
๋ด ๋น ๋ฅธ ์ฐ๊ตฌ์์ ์ ์๋ break aws cli๋ก ์์คํ
ํจํค์ง๋ฅผ ์ค์นํ๋ ๊ฒ์ผ๋ก ๋ณด์
๋๋ค. aws cli๋ฅผ ์์ ํ๋ฉด certbot ๋ฑ์ ์ค๋จํ๋ฏ๋ก ์ ๋ง ์ฌ๋ฏธ๊ฐ ์์ต๋๋ค. :)
์ฌ๋ฌ๋ถ, ์ค์ ๋ก ์ด๊ฒ์ ๋ํ ์์ ์ฌํญ์ ์ฐพ์์ต๋๋ค. ๋๋ ๊ธฐ์ฌ์ ๊ฑธ๋ ค ๋์ด์ง ๊ฒ ์ธ์๋ ์๋ฌด ๊ฒ๋ ํ ์ ์์ต๋๋ค. https://medium.com/@getpagespeed/fix -importerror-pyopenssl-module-missing-required-functionity-e1c514797204
์์ ์ฌํญ์ ์ฐพ์์ค Danila Vershinin์๊ฒ ๋ชจ๋ ํฌ๋ ๋ง์!
ํฝ์ค๊ฐ ์๋ํ์ง ์์ต๋๋ค. ์ค์น๋ pip ํจํค์ง๊ฐ ์๊ณ yum์ ๋์ด๋ ๋ชจ๋ ํจํค์ง๊ฐ ์ด๋ฏธ ์ค์น๋์ด ์ต์ ์ํ๋ผ๊ณ ๋ณด๊ณ ํฉ๋๋ค.
๋์ผํ ์์คํ ์ aws cli ๋ฐ certbot์ ์ฌ์ฉํ๋ ๊ฒ๊ณผ ๊ด๋ จํ์ฌ.
์ถฉ๋ํ๋ urllib3 ๋ฒ์ ์ด ์์ต๋๋ค.
awscli-1.16.81
์๋ urllib3-1.24.1
$ ๊ฐ ํ์ํ๊ณ python2-certbot-0.27.1-1.el7.noarch.rpm
๋ urllib3-1.10.2
์ ํจ๊ป ์๋ํฉ๋๋ค.
์ต์ ๋ฒ์ ์ ์์์ ์ธ๊ธํ ์ค๋ฅ๋ฅผ ์ ๊ณตํฉ๋๋ค.
--user
awscli
๋ฅผ ์ค์นํด๋ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ฌ ํจ๊ป ์๋ํ๋๋ก ํ ์ ์์ต๋๋ค. ์ urllib๊ฐ /root/.local/lib
certbot
๊ฐ ์คํ๋๊ธฐ ๋๋ฌธ์
๋๋ค. ์ฌ๊ธฐ๋ ๋ณด๊ณ ...
์๋ก์ด urllib๊ฐ /root/.local/lib์ ๋ฐฐ์น๋๊ณ certbot๋ ์ฌ๊ธฐ๋ฅผ ์ฐพ๊ธฐ ๋๋ฌธ์ --user๋ฅผ ์ฌ์ฉํ์ฌ awscli๋ฅผ ์ค์นํด๋ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ฏ๋ก ํจ๊ป ์๋ํ๋๋ก ํ ์ ์์ต๋๋ค.
aws cli๋ฅผ ์ค์นํ ํ ์ถฉ๋ํ๋ urllib3 ๋ฒ์ ๊ณผ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. ๊ฒฐ๊ตญ certbot์ ์์ ํ ํ virtualenv๋ฅผ ์ฌ์ฉํ์ฌ aws cli๋ฅผ ์ค์นํ์ต๋๋ค.
https://docs.aws.amazon.com/cli/latest/userguide/install-virtualenv.html
์ด์ certbot๊ณผ aws cli ๋ชจ๋ ๊ด์ฐฎ์ต๋๋ค.
๋ํ ์์ฒด ํฌํจ๋๋๋ก ์ ๊ณตํ๋ ๋ฒ๋ค ์ค์น ํ๋ก๊ทธ๋จ์ ์ฌ์ฉํ์ฌ awscli๋ฅผ ์ค์นํ์ต๋๋ค.
https://docs.aws.amazon.com/cli/latest/userguide/install-bundle.html
awscli์ certbot ๊ฐ์ ์ถฉ๋์ ํด๊ฒฐํ๋ ๋ ๋ค๋ฅธ ๋ฐฉ๋ฒ์ python36์ ์ค์นํ๊ณ ์ด๋ฅผ ์ฌ์ฉํ์ฌ awscli๋ฅผ ์คํํ๋ ๊ฒ์ ๋๋ค.
certbot ํจํค์ง๊ฐ ์์ฒด ํ๊ฒฝ์ python ๋ชจ๋์ ์ค์นํ์ง ์๊ฑฐ๋ ๋ฒ์ ์๊ตฌ ์ฌํญ๊ณผ ๊ด๋ จํ์ฌ ๋ ์๊ฒฉํ ์ ์์ต๋๊น?
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
pip install --upgrade --force-reinstall 'requests==2.6.0'
์๋