zoukankan      html  css  js  c++  java
  • wdcp 下apache模式开启https访问,支持多站点

    1、vi conf/httpd.conf

    查找 #Include conf/extra/httpd-ssl.conf (删除行首的配置语句注释符号“#”保存退出)

    2、vi conf/extra/httpd-ssl.conf

    注释所有的 VirtualHost 里面的代码

    然后在末尾加上以上代码

    <VirtualHost *:443>
    DocumentRoot "/www/web/smallshop/public_html"
    ServerName demo.smallshop.me:443
    ServerAdmin you@example.com
    ErrorLog "/www/wdlinux/httpd-2.4.18/logs/error_log"
    TransferLog "/www/wdlinux/httpd-2.4.18/logs/access_log"
    
    SSLEngine on
    
    SSLCertificateFile /www/ssl/smallshop/public.pem
    SSLCertificateKeyFile /www/ssl/smallshop/213979745040220.key
    SSLCACertificateFile /www/ssl/smallshop/chain.pem
    
    <FilesMatch ".(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory "/www/wdlinux/httpd-2.4.18/cgi-bin">
        SSLOptions +StdEnvVars
    </Directory>
    
    BrowserMatch "MSIE [2-5]" 
             nokeepalive ssl-unclean-shutdown 
             downgrade-1.0 force-response-1.0
    CustomLog "/www/wdlinux/httpd-2.4.18/logs/ssl_request_log" 
              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x "%r" %b"
    
    </VirtualHost>

    这样可以同时开启多个站点的https访问。

    如果需要开启http强制跳转到https可以在.htaccess里面加上下面的代码

    RewriteBase /
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

    如果提示SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe错误

    在conf/httpd.conf里面找到LoadModule socache_shmcb_module modules/mod_socache_shmcb.so 去掉开头的#就可以了。

  • 相关阅读:
    对Spark硬件配置的建议
    Hadoop调优 | NameNode主备宕机引发的思考
    系统解析Apache Hive
    Spark集群和任务执行
    Redis中的一致性哈希问题
    Java并发队列与容器
    重要 | Spark和MapReduce的对比,不仅仅是计算模型?
    Redis从入门到精通
    LeaFlet自定义控件
    java学习的一些琐碎知识点
  • 原文地址:https://www.cnblogs.com/whlives/p/6222171.html
Copyright © 2011-2022 走看看