我正在学习如何在Apache2.4 get服务器上启动和运行ssl (Windows 2012)。我让web服务器和PHP在没有SSL的情况下运行得很好。
LoadModule ssl_module模块/mod_ssl.so包括C:/Apache24 24/conf/openssl.cnf
SSLCertificateFile "c:/Apache24/conf/server.crt" SSLCertificateKeyFile "c:/Apache24/conf/server.key" DocumentRoot "c:/Apache24/htdocs"
Variable Name: OPENSSL_CONF Variable Value: C:\Apache24\conf\openssl.cnf
由于以下错误,我遇到了apache无法启动的问题。
在powershell中运行httpd -t将得到如下结果:
: Syntax error on line 8 of C:/Apache24/conf/openssl.cnf:
Invalid command 'HOME', perhaps misspelled or defined by a module not included in the server configuration下面是openssl.cnf的第6行到第9行(我没有修改这个文件)。)
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
RANDFILE = $ENV::HOME/.rnd任何帮助都是非常感谢的。谢谢!
发布于 2017-12-05 09:33:22
基本上,您试图在httpd配置中包含一个第三方配置文件,这永远不会产生好的结果,因为Apache将永远不会识别其中的内容。删除包含的内容。
如果要添加系统变量,可以使用来自PassEnv模块的mod_env指令。
要让SSL启动并运行,您所需要的只是一个SSL虚拟主机,如下所示:
在服务器配置中,如下所示:
LoadModule ssl_module modules/mod_ssl.so
<IfModule mod_ssl.c>
Listen 443
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
SSLProtocol all -SSLv3
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
SSLHonorCipherOrder on
SSLCompression off
SSLSessionTickets off
SSLRandomSeed startup file:/dev/urandom 2048 # perhaps this need to be adapted for windows
SSLRandomSeed connect file:/dev/urandom 2048 # same with this
SSLSessionCache shmcb:/path/to/logs/ssl_gcache_data(512000)
</IfModule>而虚拟主机:
<Virtualhost *:443>
ServerName myssllvh.example.com
DocumentRoot /filesystem/path/to/docroot
CustomLog /path/to/logs/mysslvh.log combined
ErrorLog /path/to/logs/mysslvh-error.log
SSLEngine on
SSLCertificateFile /path/to/certs/mysslvh.crt
SSLCertificateKeyFile /path/to/certs/mysslvh.key
# Other stuff here
</VirtualHost>https://stackoverflow.com/questions/47643421
复制相似问题