大多数 SSL证书都是付费的,我们使用Let’s Encrypt进行演示,无需收费即可实现生产环境也可以使用 https 服务。
Apache
下载 Let’s Encrypt
1 2 3 |
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt cd /opt/letsencrypt/ ./certbot-auto --apache |
根据提示选择域名进行配置
编辑 Apache配置文件
1 2 3 4 5 6 7 8 9 |
# vim /etc/httpd/conf.d/odoo.alanhou.org.conf <VirtualHost _default_:443> SSLEngine On SSLCertificateFile /etc/letsencrypt/live/odoo.alanhou.org/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/odoo.alanhou.org/privkey.pem ProxyPass / http://localhost:8069/ ProxyPassReverse / http://localhost:8069/ </VirtualHost> |
Nginx