zoukankan      html  css  js  c++  java
  • apache安装并配置https

    1.yum 安装openssl和openssl-devel,httpd-devel  expat-devel

     

    2.安装gcc、gcc-c++  apr   apr-util   pcre   httpd

    如果版本之间不匹配,安装过程中会出现问题。

     

    https://www.cnblogs.com/wcwnina/p/8029156.html

    3.生成相关证书

    yum install mod_ssl

    cd /etc/pki/CA

    1.生成2048位的加密私钥

    openssl genrsa -out server.key 2048

    2.生成证书签名请求

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

    You are about to be asked to enter information that will be incorporated

    into your certificate request.

    What you are about to enter is what is called a Distinguished Name or a DN.

    There are quite a few fields but you can leave some blank

    For some fields there will be a default value,

    If you enter '.', the field will be left blank.

    Country Name (2 letter code) [XX]:CN

    State or Province Name (full name) []:beijing

    Locality Name (eg, city) [Default City]:beijing

    Organization Name (eg, company) [Default Company Ltd]:test.com

    Organizational Unit Name (eg, section) []:test  

    Common Name (eg, your name or your server's hostname) []:test.com

    Email Address []:test@qq.com

    Please enter the following 'extra' attributes

    to be sent with your certificate request

    A challenge password []:123456

    An optional company name []:test

    3.生成类型为X509的自签名证书(有效期36500天)

    openssl x509 -req -days 36500 -in server.csr -signkey server.key -out server.crt

    4.相关配置文件修改

    1.修改ssl.conf

    vim  /etc/httpd/conf.d/ssl.conf

    SSLCertificateFile /etc/pki/CA/server.crt

    SSLCertificateKeyFile /etc/pki/CA/server.key

    DocumentRoot "/var/www/html"(去掉行首的注释)

    ServerName www.test.com (去掉行首的注释)

    2.修改Apache的配置文件httpd.conf

    vim  usr/local/apache/conf httpd.conf

    LoadModule ssl_module modules/mod_ssl.so   (去掉行首的注释)

    LoadModule socache_shmcb_module modules/mod_socache_shmcb.so (去掉行首的注释)

    Include conf/extra/httpd-ssl.conf     (去掉行首的注释)

  • 相关阅读:
    Single Number 解答
    Minimum Size Subarray Sum 解答
    Valid Anagram 解答
    Count Primes 解答
    fullCalendar 日历显示每天数据调用方法实践
    jqGrid列的统计
    关于 asp.net Web Api 上传文件请求内容过大404错误记录
    My97DatePicker只显示月份
    js 宏微任务执行顺序
    git 等官网下载慢方法
  • 原文地址:https://www.cnblogs.com/joeking/p/15223217.html
Copyright © 2011-2022 走看看