美文网首页
Apache配置https

Apache配置https

作者: 芮淼一线 | 来源:发表于2020-08-09 03:29 被阅读0次

Apache

Apache命令

 开启apache:          sudo apachectl start
 重启apache:          sudo apachectl restart
 关闭apache:          sudo apachectl stop
 apache配置检测是否正确 sudo apachectl configtest

Apache开启https

SSL生成证书:
步骤1:生成密钥

openssl genrsa 1024 > server.key

步骤2: 生成证书请求文件

openssl req -new -key server.key > server.csr

根据提示信息输入相关信息,生成crt文件

Country Name:                                   Zh
State or Province Name :                        Sichuan
Locality Name:                                  Chengdu
Organization Name:                              Ruirui Software
Organizational Unit Name:                       Ruirui
Common Name (eg, fully qualified host name):    localhost
Email Address:                                  1352892108@qq.com
A challenge password:                           asd123456789

步骤3: 生成证书

openssl req -x509 -days 7300 -key server.key -in server.csr > server.crt

配置Apache SSL
拷贝证书相关文件到配置路径

cp server.key server.crt /private/etc/apache2/

修改httpd.conf,以下三行取消注释

LoadModule ssl_module libexec/apache2/mod_ssl.so

Include /private/etc/apache2/extra/httpd-ssl.conf

LoadModule socache_shmcb_module libexec/apache2/mod_socache_shmcb.so

修改httpd-ssl.conf,找到VirtualHost,修改主机名(绿色区域),证书相关文件路径(蓝色区域)

<VirtualHost www.segmentfault.com.gao:443>
#   General setup for the virtual host
#  DocumentRoot "/Library/WebServer/Documents"
DocumentRoot "/Users/kimi/WebServer"
ServerName www.segmentfault.com.gao:443
ServerAdmin you@example.com
ErrorLog "/private/var/log/apache2/error_log"
TransferLog "/private/var/log/apache2/access_log"

SSLCertificateFile "/private/etc/apache2/ssl/server.crt"

SSLCertificateKeyFile "/private/etc/apache2/ssl/server.key"

https证书生成

1.证书生成可以直接使用KeyManager软件生成
2.使用 KeyManager - FreeSSL.cn
3.FreeSSL.cn

相关文章

  • apache配置https

    参考url https://blog.csdn.net/ithomer/article/details/50433...

  • Apache配置https

    Apache Apache命令 Apache开启https SSL生成证书:步骤1:生成密钥 步骤2: 生成证书请...

  • Apache 配置https

    安装证书模块 查看apache已安装了哪些模块 编辑apache配置文件/etc/httpd/conf.d/ssl...

  • Apache配置HTTPS

    起因 昨天说弄小程序,结果调用wx.request的时候发现,说没有配置域名,仔细一看开发文档才发现,原来请求的U...

  • Apache 配置 HTTPS访问

    将需要配置的项目移动到另一根目录下,作为https访问位置。 修改bitnami配置文件..\Bitnami\wa...

  • PHPStudy Apache配置HTTPS

    开启php_openssl 直接在phpStudy中php扩展插件中找到php_openssl打勾即可开启 在服务...

  • Ubuntu 配置Apache https

    Ubuntu 16.04.1 Apache/2.4.18 (Ubuntu) 到apache2的目录,修改配置文件 ...

  • MAC搭建ios内测平台

    一、启动Apache服务,配置https 1.启动 Apache Mac OS X 自带了 Apache 服务,我...

  • Apache2.4.7配置Https

    一、环境 服务器:阿里云系统:ubuntu14.04Apache:2.4.7 二、准备证书 HTTPS的本质是通过...

  • apache https配置文档说明

    1,在阿里云上创建一个域名,例如yphjj.360logs.com 2,SSL证书购买 3,绑定已经拥有的域名 4...

网友评论

      本文标题:Apache配置https

      本文链接:https://www.haomeiwen.com/subject/yrbkrktx.html