开发者社区> 问答> 正文

为 “护卫神 apache大师”站点添加ssl证书,实现https访问

云友“ 感觉2017  ”想在 “apache大师”里配置https访问,所以写此帖。

环境:护卫神 apache大师 2.1.0,Windows 2012

过程:

1. 安装好 “护卫神 apache大师” 软件,开设站点,如本例 mp.anqun.org
[attachment=134758]



[attachment=134753]
2. 编辑 C:\HwsApacheMaster\Apache\conf\httpd.conf 文件,搜索 mod_ssl,移除注释符号#(本例第124行); 同理,让 httpd-ssl.conf 配置文件也生效
[attachment=134754]

[attachment=134755]

3. 编辑 C:\HwsApacheMaster\Apache\conf\extra\httpd-ssl.conf 文件,修改 SSLSessionCache 文件的存储路径,使之有效;之后新建一个https的站点配置内容,如本例的 mp.anqun.org,证书文件保存在 C:\HwsApacheMaster\Apache\conf\ssl 目录内








#   Inter-Process Session Cache:
#   Configure the SSL Session Cache: First the mechanism
#   to use and second the expiring timeout (in seconds).
#SSLSessionCache         "dbm:E:/Huweishen.com/HwsApacheMaster/Apache2.2/logs/ssl_scache"
# SSLSessionCache        "shmcb:E:/Huweishen.com/HwsApacheMaster/Apache2.2/logs/ssl_scache(512000)"
SSLSessionCache        "shmcb:logs/ssl_scache(512000)"
SSLSessionCacheTimeout  300








#   Semaphore:
#   Configure the path to the mutual exclusion semaphore the
#   SSL engine uses internally for inter-process synchronization.
SSLMutex default








##
## SSL Virtual Host Context
##
<VirtualHost *:443>
        SSLEngine on
        SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
        SSLCertificateFile      "conf\ssl\1_mp.anqun.org_bundle.crt"
        SSLCertificateKeyFile   "conf\ssl\2_mp.anqun.org.key"
        ServerName      "mp.anqun.org"
        DocumentRoot    "C:\HwsApacheMaster\wwwroot\mp_f75yPU"
        




   <Directory "C:/HwsApacheMaster/wwwroot/mp_f75yPU">
        Options FollowSymLinks ExecCGI
    #AddHandler fcgid-script .php
    #FcgidWrapper "/php-cgi.exe" .php
        DirectoryIndex index.html index.htm index.php default.php index.jsp
        AllowOverride All
        Order Deny,Allow
        Allow from all
    </Directory>
</VirtualHost>

[attachment=134756]

4. 重启apache,在浏览器里测试,https访问有效(需在实例安全组规则里开放443端口)
[attachment=134759]

[attachment=134757]

参考: http://www.huweishen.com/?apachemaster

展开
收起
dongshan8 2017-10-23 11:17:38 11552 0
6 条回答
写回答
取消 提交回答
  • 阿里云SSL证书服务可提供Nginx服务器、Apache服务器、Tomcat服务器、IIS服务器和其他服务器类型证书下载并安装到对应的服务器中,详情请参见如何在各类服务中安装SSL证书

    2020-12-08 15:31:32
    赞同 展开评论 打赏
  • Re为 “护卫神 apache大师”站点添加ssl证书,实现https访问
    说的太模糊,大神能不能出个更详细的教程?
    2018-04-15 22:24:55
    赞同 展开评论 打赏
  • Re为 “护卫神 apache大师”站点添加ssl证书,实现https访问
    老师您好,我在配置时出了问题,apache能够重启,但是https网站无法打开。
    我看了一下,我apache的logs目录里没有ssl_scache


    那下面的这个代码我该怎样改呢?


    SSLSessionCache        "shmcb:logs/ssl_scache(512000)"
    SSLSessionCacheTimeout  300


    期待您的答复,谢谢。
    2018-01-31 17:26:59
    赞同 展开评论 打赏
  •       
    2018-01-25 11:18:07
    赞同 展开评论 打赏
  • 旺旺:nectar2。
    回 4楼(感觉2017) 的帖子
    您好,

    能否查看一下apache的日志,看有没有详细的错误提示呢?

    -------------------------

    回 7楼(感觉2017) 的帖子
    您好,

    日志里说以下这个目录不存在喔:

    C:/HwsApacheMaster/Apache/htdocs/jnydtpzkmagb

    -------------------------

    回 11楼(感觉2017) 的帖子
    您好,

    可能仅是网站访问某个网址,但并不存在,如这里的:

    [client 123.126.113.134] File does not exist: C:/HwsApacheMaster/Apache/htdocs/catalog.php

    这么看来,还没有发现导致apache启动失败的真正原因。

    您可以尝试慢慢调整,如注释掉某些部分后尝试启动apache,反复尝试。
    2017-10-23 19:52:26
    赞同 展开评论 打赏
  • Re为 “护卫神 apache大师”站点添加ssl证书,实现https访问
    刚看到,先谢谢版主,我试下,再回你,非常感谢!!!

    -------------------------

    Re为 “护卫神 apache大师”站点添加ssl证书,实现https访问



    #   Inter-Process Session Cache:
    #   Configure the SSL Session Cache: First the mechanism
    #   to use and second the expiring timeout (in seconds).
    #SSLSessionCache         "dbm:E:/Huweishen.com/HwsApacheMaster/Apache2.2/logs/ssl_scache"


    SSLSessionCache        "shmcb:logs/ssl_scache(512000)"
    SSLSessionCacheTimeout  300


    #   Semaphore:
    #   Configure the path to the mutual exclusion semaphore the
    #   SSL engine uses internally for inter-process synchronization.
    SSLMutex default


    ##
    ## SSL Virtual Host Context
    ##
    <VirtualHost *:443>
            SSLEngine on
            SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
            SSLCertificateFile      "conf\ssl\2_sy.518520.com.crt"
            SSLCertificateKeyFile   "conf\ssl\3_sy.518520.com.key"
            ServerName      "sy.518520.com"
            DocumentRoot    "C:\HwsApacheMaster\wwwroot\sy_kfWqKJ"
            
       <Directory "C:/HwsApacheMaster/wwwroot/sy_kfWqKJ">
            Options FollowSymLinks ExecCGI
        #AddHandler fcgid-script .php
        #FcgidWrapper "/php-cgi.exe" .php
            DirectoryIndex index.html index.htm index.php default.php index.jsp
            AllowOverride All
            Order Deny,Allow
            Allow from all
        </Directory>
    </VirtualHost>

    apache还是启动不了

    -------------------------

    回 2楼感觉2017的帖子
    老师,看看,哪里出错了,很揪心

    -------------------------

    回 楼主dongshan8的帖子
    老师,看看,哪里出错了,很揪心!!!!!!

    -------------------------

    回 5楼dongshan8的帖子
    tarting the Apache2.2 service
    The Apache2.2 service is running.
    rmine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Mon Oct 23 20:06:44 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Mon Oct 23 20:06:44 2017] [notice] Apache/2.2.22 (Win32) mod_fcgid/2.3.6 mod_jk/1.2.33 configured -- resuming normal operations
    [Mon Oct 23 20:06:44 2017] [notice] Server built: Jan 28 2012 11:16:39
    [Mon Oct 23 20:06:44 2017] [notice] Parent: Created child process 632
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Mon Oct 23 20:06:44 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Mon Oct 23 20:06:44 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Mon Oct 23 20:06:44 2017] [notice] Child 632: Child process is running
    [Mon Oct 23 20:06:44 2017] [notice] Child 632: Acquired the start mutex.
    [Mon Oct 23 20:06:44 2017] [notice] Child 632: Starting 64 worker threads.
    [Mon Oct 23 20:06:44 2017] [notice] Child 632: Starting thread to listen on port 81.
    [Mon Oct 23 20:06:44 2017] [notice] Child 632: Starting thread to listen on port 999.
    [Mon Oct 23 20:06:44 2017] [notice] Child 632: Starting thread to listen on port 80.
    The Apache2.2 service is restarting.
    The Apache2.2 service has restarted.
    arent: Received restart signal -- Restarting the server.
    [Mon Oct 23 20:07:56 2017] [notice] Child 632: Exit event signaled. Child process is ending.
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Mon Oct 23 20:07:56 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Mon Oct 23 20:07:56 2017] [notice] Apache/2.2.22 (Win32) mod_fcgid/2.3.6 mod_jk/1.2.33 configured -- resuming normal operations
    [Mon Oct 23 20:07:56 2017] [notice] Server built: Jan 28 2012 11:16:39
    [Mon Oct 23 20:07:56 2017] [notice] Parent: Created child process 3368
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Mon Oct 23 20:07:56 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Mon Oct 23 20:07:56 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Mon Oct 23 20:07:56 2017] [notice] Child 3368: Child process is running
    [Mon Oct 23 20:07:57 2017] [notice] Child 3368: Acquired the start mutex.
    [Mon Oct 23 20:07:57 2017] [notice] Child 3368: Starting 64 worker threads.
    [Mon Oct 23 20:07:57 2017] [notice] Child 632: Released the start mutex
    [Mon Oct 23 20:07:58 2017] [notice] Child 632: All worker threads have exited.
    [Mon Oct 23 20:07:58 2017] [notice] Child 3368: Starting thread to listen on port 81.
    [Mon Oct 23 20:07:58 2017] [notice] Child 3368: Starting thread to listen on port 999.
    [Mon Oct 23 20:07:58 2017] [notice] Child 3368: Starting thread to listen on port 80.
    [Mon Oct 23 20:07:58 2017] [notice] Child 632: Child process is exiting
    The Apache2.2 service is restarting.
    The Apache2.2 service has restarted.
    arent: Received restart signal -- Restarting the server.
    [Mon Oct 23 20:08:53 2017] [notice] Child 3368: Exit event signaled. Child process is ending.
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Mon Oct 23 20:08:53 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Mon Oct 23 20:08:53 2017] [notice] Apache/2.2.22 (Win32) mod_fcgid/2.3.6 mod_jk/1.2.33 configured -- resuming normal operations
    [Mon Oct 23 20:08:53 2017] [notice] Server built: Jan 28 2012 11:16:39
    [Mon Oct 23 20:08:53 2017] [notice] Parent: Created child process 3116
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Mon Oct 23 20:08:53 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Mon Oct 23 20:08:53 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Mon Oct 23 20:08:53 2017] [notice] Child 3116: Child process is running
    [Mon Oct 23 20:08:54 2017] [notice] Child 3116: Acquired the start mutex.
    [Mon Oct 23 20:08:54 2017] [notice] Child 3116: Starting 64 worker threads.
    [Mon Oct 23 20:08:54 2017] [notice] Child 3368: Released the start mutex
    [Mon Oct 23 20:08:55 2017] [notice] Child 3368: All worker threads have exited.
    [Mon Oct 23 20:08:55 2017] [notice] Child 3116: Starting thread to listen on port 443.
    [Mon Oct 23 20:08:55 2017] [notice] Child 3116: Starting thread to listen on port 81.
    [Mon Oct 23 20:08:55 2017] [notice] Child 3116: Starting thread to listen on port 999.
    [Mon Oct 23 20:08:55 2017] [notice] Child 3116: Starting thread to listen on port 80.
    [Mon Oct 23 20:08:56 2017] [notice] Child 3368: Child process is exiting
    [Mon Oct 23 20:12:23 2017] [error] [client 140.205.201.31] File does not exist: C:/HwsApacheMaster/Apache/htdocs/jnydtpzkmagb
    [Mon Oct 23 20:12:23 2017] [error] [client 140.205.201.31] File does not exist: C:/HwsApacheMaster/Apache/htdocs/jnydtpzkmagb
    [Mon Oct 23 20:15:36 2017] [notice] Parent: Received shutdown signal -- Shutting down the server.
    [Mon Oct 23 20:15:36 2017] [notice] Child 3116: Exit event signaled. Child process is ending.
    [Mon Oct 23 20:15:37 2017] [notice] Child 3116: Released the start mutex
    [Mon Oct 23 20:15:38 2017] [notice] Child 3116: All worker threads have exited.
    [Mon Oct 23 20:15:39 2017] [notice] Child 3116: Child process is exiting
    [Mon Oct 23 20:15:39 2017] [notice] Parent: Child process exited successfully.


    老师,看下,能给出具体解决办法吗,最好傻瓜式的,复制那种的,专业术语真不懂,谢谢

    -------------------------

    回 5楼dongshan8的帖子
    老师,看出是哪里出问题没

    -------------------------

    回 8楼dongshan8的帖子
    这个是什么,装好护卫神默认就没有的啊,是文件夹吗

    -------------------------

    回 8楼dongshan8的帖子
    Starting the Apache2.2 service
    The Apache2.2 service is running.
    rmine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Tue Oct 24 09:57:54 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Tue Oct 24 09:57:55 2017] [notice] Apache/2.2.22 (Win32) mod_fcgid/2.3.6 mod_jk/1.2.33 configured -- resuming normal operations
    [Tue Oct 24 09:57:55 2017] [notice] Server built: Jan 28 2012 11:16:39
    [Tue Oct 24 09:57:55 2017] [notice] Parent: Created child process 2652
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Tue Oct 24 09:57:55 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Tue Oct 24 09:57:55 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Tue Oct 24 09:57:55 2017] [notice] Child 2652: Child process is running
    [Tue Oct 24 09:57:55 2017] [notice] Child 2652: Acquired the start mutex.
    [Tue Oct 24 09:57:55 2017] [notice] Child 2652: Starting 64 worker threads.
    [Tue Oct 24 09:57:55 2017] [notice] Child 2652: Starting thread to listen on port 81.
    [Tue Oct 24 09:57:55 2017] [notice] Child 2652: Starting thread to listen on port 999.
    [Tue Oct 24 09:57:55 2017] [notice] Child 2652: Starting thread to listen on port 80.
    The Apache2.2 service is restarting.
    The Apache2.2 service has restarted.
    arent: Received restart signal -- Restarting the server.
    [Tue Oct 24 09:59:23 2017] [notice] Child 2652: Exit event signaled. Child process is ending.
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Tue Oct 24 09:59:23 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Tue Oct 24 09:59:23 2017] [notice] Apache/2.2.22 (Win32) mod_fcgid/2.3.6 mod_jk/1.2.33 configured -- resuming normal operations
    [Tue Oct 24 09:59:23 2017] [notice] Server built: Jan 28 2012 11:16:39
    [Tue Oct 24 09:59:23 2017] [notice] Parent: Created child process 2360
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Tue Oct 24 09:59:23 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Tue Oct 24 09:59:23 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Tue Oct 24 09:59:23 2017] [notice] Child 2360: Child process is running
    [Tue Oct 24 09:59:24 2017] [notice] Child 2360: Acquired the start mutex.
    [Tue Oct 24 09:59:24 2017] [notice] Child 2360: Starting 64 worker threads.
    [Tue Oct 24 09:59:24 2017] [notice] Child 2652: Released the start mutex
    [Tue Oct 24 09:59:25 2017] [notice] Child 2652: All worker threads have exited.
    [Tue Oct 24 09:59:25 2017] [notice] Child 2360: Starting thread to listen on port 81.
    [Tue Oct 24 09:59:25 2017] [notice] Child 2360: Starting thread to listen on port 999.
    [Tue Oct 24 09:59:25 2017] [notice] Child 2360: Starting thread to listen on port 80.
    [Tue Oct 24 09:59:25 2017] [notice] Child 2652: Child process is exiting
    The Apache2.2 service is restarting.
    The Apache2.2 service has restarted.
    arent: Received restart signal -- Restarting the server.
    [Tue Oct 24 10:00:45 2017] [notice] Child 2360: Exit event signaled. Child process is ending.
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Tue Oct 24 10:00:45 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Tue Oct 24 10:00:45 2017] [notice] Apache/2.2.22 (Win32) mod_fcgid/2.3.6 mod_jk/1.2.33 configured -- resuming normal operations
    [Tue Oct 24 10:00:45 2017] [notice] Server built: Jan 28 2012 11:16:39
    [Tue Oct 24 10:00:45 2017] [notice] Parent: Created child process 3636
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Tue Oct 24 10:00:45 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    httpd.exe: Could not reliably determine the server's fully qualified domain name, using 172.16.157.70 for ServerName
    [Tue Oct 24 10:00:45 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Tue Oct 24 10:00:45 2017] [notice] Child 3636: Child process is running
    [Tue Oct 24 10:00:46 2017] [notice] Child 3636: Acquired the start mutex.
    [Tue Oct 24 10:00:46 2017] [notice] Child 3636: Starting 64 worker threads.
    [Tue Oct 24 10:00:46 2017] [notice] Child 2360: Released the start mutex
    [Tue Oct 24 10:00:47 2017] [notice] Child 2360: All worker threads have exited.
    [Tue Oct 24 10:00:47 2017] [notice] Child 3636: Starting thread to listen on port 443.
    [Tue Oct 24 10:00:47 2017] [notice] Child 3636: Starting thread to listen on port 81.
    [Tue Oct 24 10:00:47 2017] [notice] Child 3636: Starting thread to listen on port 999.
    [Tue Oct 24 10:00:47 2017] [notice] Child 3636: Starting thread to listen on port 80.
    [Tue Oct 24 10:00:48 2017] [notice] Child 2360: Child process is exiting
    [Tue Oct 24 10:27:25 2017] [error] [client 123.126.113.134] File does not exist: C:/HwsApacheMaster/Apache/htdocs/product.php
    [Tue Oct 24 10:27:35 2017] [error] [client 123.126.113.134] File does not exist: C:/HwsApacheMaster/Apache/htdocs/catalog.php
    [Tue Oct 24 10:28:55 2017] [notice] Parent: Received shutdown signal -- Shutting down the server.
    [Tue Oct 24 10:28:55 2017] [notice] Child 3636: Exit event signaled. Child process is ending.
    [Tue Oct 24 10:28:56 2017] [notice] Child 3636: Released the start mutex
    [Tue Oct 24 10:28:57 2017] [notice] Child 3636: All worker threads have exited.
    [Tue Oct 24 10:28:58 2017] [notice] Child 3636: Child process is exiting
    [Tue Oct 24 10:28:58 2017] [notice] Parent: Child process exited successfully.

    -------------------------

    回 8楼dongshan8的帖子
    老师,你看看什么情况

    -------------------------

    回 12楼dongshan8的帖子
    好的,谢谢,我换别的软件看看,非常感谢!
    2017-10-23 13:07:33
    赞同 展开评论 打赏
滑动查看更多
问答排行榜
最热
最新

相关电子书

更多
Apache Flink技术进阶 立即下载
Apache Spark: Cloud and On-Prem 立即下载
Hybrid Cloud and Apache Spark 立即下载

相关镜像