apache服务器开启https

 时间:2024-10-14 03:52:20

1、生成https证书,测试使用,正式使用需要购买生成私钥文件 sudo openssl genrsa -aes256 -out service.key 1024然后按提示输入密码,文件生成成功

apache服务器开启https

2、生成证书文件并签署sudo openssl req -sha25瀵鸦铙邮6 -new -x509 -days 1826 -key service.key -out service.crt估计提示输入相关信息Common Name (e.g. server FQDN or YOUR name) []:这一项必须和你的域名一致

apache服务器开启https

3、配置apache,开启https打开httpd.conf文件:移除注释LoadModule ssl_module libexec/apache2/mod_ssl.soInclude /private/etc/apache2/extra/httpd-vhosts.conf

apache服务器开启https
apache服务器开启https

4、修改httpd-vhosts.罕铞泱殳conf文件修改DocumentRoot "/Users/xun锾攒揉敫ao/website/upload" 为自己的网站路径指定证书和密钥文件路径SSLCertificateFile "/private/etc/apache2/server.crt"SSLCertificateKeyFile "/private/etc/apache2/server.key"

apache服务器开启https
apache服务器开启https

5、重启apache用 sudo apachectl configtest 检测配置文件是否有错误(windows为httpd -t)sudo apachectl restart (windows为httpd -k restart)

apache服务器开启https

6、访问网站:https://域名如果浏览器提示“您的连接不是私密连接”,则需安装证书的本地计算机

apache服务器开启https
  • VS中如何设置加粗所选选项卡上的文本
  • 怎么用bat执行java应用程序
  • Synchronizing has encoountered a problem?
  • 如何设置Excel始终以默认编码保存网页
  • 如何使用JavaScript中的函数返回值打印不同的值
  • 热门搜索
    抗美援朝70周年手抄报 宪法手抄报图片大全 鼠年手抄报 庆十一手抄报 小学保护环境手抄报 手抄报怎么做 五一英语手抄报 消防手抄报资料 我的成长足迹手抄报 幸福班级手抄报