如何设置apache openssl 的加密算法
答案:2 悬赏:30 手机版
解决时间 2021-02-20 04:05
- 提问者网友:龅牙恐龙妹
- 2021-02-19 13:58
如何设置apache openssl 的加密算法
最佳答案
- 五星知识达人网友:不甚了了
- 2021-02-19 15:09
使用VS2005下的Visual Studio 2005 Command Prompt进入控制台模式(这个模式会自动设置各种环境变量)
、解压缩openssl的包,进入openssl的目录
、perl configure VC-WIN32
尽量在这个目录下执行该命令,否则找不到Configure文件,或者指定完整的Configure文件路径。
、ms\do_ms
在解压目录下执行ms\do_ms命令
、nmake -f ms\ntdll.mak编译后在openssl解压目录下执行,完成编译后。输出的文件在out32dll里面,包括应用程序的可执行文件、lib文件和dll文件
注意:在运行第五步时,cl编译器会抱怨说.\crypto\des\enc_read.c文件的read是The POSIX name for this item is deprecated(不被推荐的),建议使用_read。呵呵,我可不想将OpenSSL中的所有的read函数修改为_read。再看cl的错误代码 error C2220,于是上MSDN上查找:
warning treated as error - no object file generated
/WX tells the compiler to treat all warnings as errors. Since an error occurred, no object or executable file was generated.
是由于设置了/WX选项,将所有的警告都作为错误对待,所以。。。
于是打开OpenSSL目录下的MS目录下的ntdll.mak文件,将CFLAG的/WX选项去掉,存盘。
、解压缩openssl的包,进入openssl的目录
、perl configure VC-WIN32
尽量在这个目录下执行该命令,否则找不到Configure文件,或者指定完整的Configure文件路径。
、ms\do_ms
在解压目录下执行ms\do_ms命令
、nmake -f ms\ntdll.mak编译后在openssl解压目录下执行,完成编译后。输出的文件在out32dll里面,包括应用程序的可执行文件、lib文件和dll文件
注意:在运行第五步时,cl编译器会抱怨说.\crypto\des\enc_read.c文件的read是The POSIX name for this item is deprecated(不被推荐的),建议使用_read。呵呵,我可不想将OpenSSL中的所有的read函数修改为_read。再看cl的错误代码 error C2220,于是上MSDN上查找:
warning treated as error - no object file generated
/WX tells the compiler to treat all warnings as errors. Since an error occurred, no object or executable file was generated.
是由于设置了/WX选项,将所有的警告都作为错误对待,所以。。。
于是打开OpenSSL目录下的MS目录下的ntdll.mak文件,将CFLAG的/WX选项去掉,存盘。
全部回答
- 1楼网友:第四晚心情
- 2021-02-19 16:01
原先以为要额外安装openssl这东西,但原来apache的安装档案,一早已有现成包含了openssl套件。01. 进入apache.org网站,下载httpd-2.2.17-win32-x86-openssl-0.9.8o.msi档案。
02. 安装後,打开windows的命令提示符(command prompt),执行以下命令
set openssl_conf=c:\program files\apache software foundation\apache2.2\conf\openssl.cnf03. 切换路径至c:\program files\apache software foundation\apache2.2\bin位置。并建立openssl证书。
cd c:\program files\apache software foundation\apache2.2\bin
openssl req -new -out server.csr04. 移除server.csr档案内的passphrase,并储存为server.key档案。并删除.rnd档案。
openssl rsa -in privkey.pem -out server.key
del .rnd05. 建立证书可使用期限,既然是家里使用,就设定为10年。
openssl x509 -in server.csr -out server.cert -req -signkey server.key -days 365006. 将server.cert档案及server.key档案,搬到c:\program files\apache software foundation\apache2.2\conf资料夹。
07. 编辑c:\program files\apache software foundation\apache2.2\conf\httpd.conf档案。将:
#loadmodule ssl_module modules/mod_ssl.so更改为:loadmodule ssl_module modules/mod_ssl.so将:
#include conf/extra/httpd-ssl.conf更改为:include conf/extra/httpd-ssl.conf08. 编辑c:\program files\apache software foundation\apache2.2\conf\extra\httpd-ssl.conf档案。确认sslcertificatefile及sslcertificatekeyfile指向刚才复制档案名称。sslcertificatefile "c:/program files/apache software foundation/apache2.2/conf/server.cert"
sslcertificatekeyfile "c:/program files/apache software foundation/apache2.2/conf/server.key"09. 更改documentroot位置,指向网站位置。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯