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     (去掉行首的注释)

  • 相关阅读:
    主席树学习笔记(静态区间第k大)
    p1156 题解(未完全解决)
    树上神奇 逆 逆序对(我的叫法)hh的小纸条 重中之重!!!!!
    二叉查找树学习笔记(BST)
    负环...坑点
    差分约束系统学习笔记
    tarjan学习(复习)笔记(持续更新)(各类找环模板)
    分层图食用简介
    js数组方法
    灵动标签调用父栏目下的所有文章
  • 原文地址:https://www.cnblogs.com/joeking/p/15223217.html
Copyright © 2011-2022 走看看