httpd加免费证书成https

我们用的是letsencrypt的证书

letsencrypt

1.安装certbot

certbot
然后进去之后选择软件和系统

笔主的是centos7的,然后就直接yum安装

sudo yum install python-certbot-apache

然后

certbot --apache

但是笔主这里报了个错:

[root@VM_37_3_centos ~]# certbot --apache
Traceback (most recent call last):
  File "/usr/bin/certbot", line 9, in <module>
    load_entry_point('certbot==0.11.1', 'console_scripts', 'certbot')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/certbot/main.py", line 21, in <module>
    from certbot import client
  File "/usr/lib/python2.7/site-packages/certbot/client.py", line 10, in <module>
    from acme import client as acme_client
  File "/usr/lib/python2.7/site-packages/acme/client.py", line 31, in <module>
    requests.packages.urllib3.contrib.pyopenssl.inject_into_urllib3()
  File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 112, in inject_into_urllib3
    _validate_dependencies_met()
  File "/usr/lib/python2.7/site-packages/requests/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必须要v0.14以上

我们看一下这个现有:

[root@VM_37_3_centos ~]# pip show pyOpenssl
Name: pyOpenSSL
Version: 0.13.1
Summary: Python wrapper module around the OpenSSL library
Home-page: http://pyopenssl.sourceforge.net/
Author: Jean-Paul Calderone
Author-email: exarkun@twistedmatrix.com
License: APL2
Location: /usr/lib64/python2.7/site-packages
Requires:

是0.13的。。。。醉了

好吧,卸载了重新装

pip uninstall pyOpenssl
[root@VM_37_3_centos ~]# pip uninstall pyOpenssl
DEPRECATION: Uninstalling a distutils installed project (pyOpenssl) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling pyOpenSSL-0.13.1:
  /usr/lib64/python2.7/site-packages/pyOpenSSL-0.13.1-py2.7.egg-info
Proceed (y/n)? y
  Successfully uninstalled pyOpenSSL-0.13.1

然后我们就卸载完毕了

装吧

pip install pyOpenssl

然后果然不出所料报错了

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o
    unable to execute gcc: No such file or directory
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
  Rolling back uninstall of cryptography
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-SPjUI6/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-eQZ2dp-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-SPjUI6/cryptograp````
y/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
HTTP(超文本传输协议)是一种用于传输超媒体文档(例如HTML)的应用层协议。HTTPS(安全套接字层超文本传输协议)是HTTP的安全版本,通过使用SSL / TLS协议对数据进行密和身份验证来保护数据传输的安全性。HTTPD是一个开源的Web服务器软件,它是Apache Web服务器的一部分,用于处理HTTP请求。以下是关于HTTPSHTTPD的一些介绍和演示: 1. HTTPS的工作原理: HTTPS使用SSL / TLS协议对数据进行密和身份验证。当客户端向服务器发送HTTPS请求时,服务器会将其公钥发送给客户端。客户端使用该公钥密数据并将其发送回服务器。服务器使用其私钥解密数据并将其发送回客户端。这样,数据在传输过程中得到了保护。 2. HTTPD的安装和配置: 在CentOS 6上安装httpd2.2,可以使用以下命令: ``` sudo yum install httpd ``` 安装完后,可以使用以下命令启动httpd服务: ``` sudo service httpd start ``` httpd的配置文件位于/etc/httpd/conf/httpd.conf。可以使用文本编辑器打开该文件并进行配置更改。例如,可以更改服务器的默认端口号,更改文档根目录等。 3. HTTPS的配置: 要在httpd中启用HTTPS,需要安装mod_ssl模块。可以使用以下命令在CentOS 6上安装mod_ssl: ``` sudo yum install mod_ssl ``` 安装完后,可以在/etc/httpd/conf.d/ssl.conf中找到HTTPS的配置文件。该文件已经载了mod_ssl模块,并监听443端口。可以在该文件中进行更改,例如更改SSL证书的位置和名称等。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值