<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[观夏Note]]></title> 
<link>//gm.angeldm.com/index.php</link> 
<description><![CDATA[新技术番]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[观夏Note]]></copyright>
<item>
<link>//gm.angeldm.com/post//</link>
<title><![CDATA[ Win32 平台下 Apache+SSL 配置指南]]></title> 
<author>果面 &lt;admin@yourname.com&gt;</author>
<category><![CDATA[网络应用]]></category>
<pubDate>Mon, 04 Aug 2008 12:57:14 +0000</pubDate> 
<guid>//gm.angeldm.com/post//</guid> 
<description>
<![CDATA[ 
	作者：bitifirefly<br/><br/>　本文源自 http://raibledesigns.com/wiki/Wiki.jsp?page=ApacheSSL，并作了必要的修改，补充和简化。在我的 winxp+apache1.3.31下面测试通过。<br/><br/>假定：<br/>你已经熟悉 apache 的安装和配置<br/>你对 ssl 安全连接的基本常识有一定了解<br/>你对 php 有一定了解<br/><br/>1.: 安装 Apache<br/><br/>　　从 www.apache.org 下载 apache 安装包并安装。建议安装 1.3.31 版本，对下文的配置比较方便。<br/><br/>　　不要混淆 1.3 和 2.0 版本的 apache，不同的版本对应不同的 mod_ssl。<br/><br/>　　修改httpd.conf的下列字段：<br/>　　[将所有 www.my-server.dom 换成你自己的域名!]<br/>　　注：如果你是在自己的pc上进行测试的话，可以随意在 hosts 文件中添加一行域名和本地 ip 的纪录，然后用这个域名进行测试。关于 hosts 文件知识，请自行了解。<br/><br/>Port 80 改成 # Port 80<br/>Listen 80 (标准web端口)<br/>Listen 443 (监听SSL 端口)<br/>ServerName www.my-server.dom<br/><br/>　　重启 apache 服务。<br/><br/>　　打开 http://www.my-server.dom:443/.，此时连接并没有加密但代表你的 apache 可以正常使用 443 端口。<br/><br/>2.: 取得OpenSSL 和 mod_ssl<br/><br/>　　从 http://hunter.campbus.com/ 下载并解压缩<br/><br/>Apache_2.0.49-Openssl_0.9.7d-Win32.zip<br/>Apache_1.3.31-Mod_SSL_2.8.20-Openssl_0.9.7d-Win32.zip<br/>Openssl-0.9.7d-Win32.zip<br/><br/>　　从 openssl 压缩包里拷贝ssleay32.dll 和 libeay32.dll 到 WINNT&#92;System32。大约有 70 % 的人因为没有这样做导致安装失败。<br/><br/>　　从 http://www.cygwin.com 下载并安装Cygwin。注意安装的时候要选择openssl包。<br/><br/>　　你需要一个 openssl.exe 的配置文件。如果使用 Cygwin，那么已经自动包含。否则你需要下载一个 openssl.conf&nbsp;&nbsp;http://www.securityfocus.com/data/tools/openssl.conf 。<br/><br/>3.: 建立测试证书<br/><br/>　　下列的说明来自 http://www.apache-ssl.org/#FAQ，注意：下列命令可以在 cygwin 里面运行，也可以在解压后的 Openssl-0.9.7d-Win32.zip 运行（需要拷贝openssl.conf，如果运行不正确，在命令行后面加上-conf openssl.conf）。<br/><br/>openssl req -new -out server.csr<br/>　　这个语句建立一个证书签名请求和一个私钥。当系统提示“Common Name (eg, your websites domain name)”，给出精确的 web 服务器名称 (例如 www.my-server.dom)。如果和实际的名称不符合，浏览器会报错。<br/><br/>openssl rsa -in privkey.pem -out server.key<br/>　　这个语句从私钥移除 passphrase。 server.key 只能被 apache 和&nbsp;&nbsp;administrator 管理。删除 .rnd 文件，它可能被利用来攻击私钥。<br/><br/>openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365<br/>　　这个语句建立自签名的证书，你可以使用这个直到你从权威机构得到了一个　真实证书。你可以扩大 -days 365　的参数，以避免一年以后过期。<br/><br/>　　如果你的用户使用 MS Internet Explorer 4.0+　并且希望安装证书到证书存储里(下载和打开), 你需要建立一个 a DER-encoded 版本的证书。<br/><br/>openssl x509 -in server.crt -out server.der.crt -outform DER<br/>　　建立一个目录 Apache/conf/ssl 并拷贝 server.key 和 server.crt. 对于Linux 建立两个目录　ssl.key 和 ssl.crt. 拷贝 server.crt 到 ssl.crt ；拷贝server.key 到 ssl.key。<br/><br/>4.: 配置 Apache 和 mod_ssl<br/><br/>　　从下载的 apache-mod_ssl 包里面拷贝所有的 (*.exe, *.dll, *.so) 文件到原始 apache 目录。注意不要覆盖原始的配置文件httpd.conf。<br/>　　注意：查找所有子目录里的这些后缀文件，拷贝到相应目录并覆盖。<br/><br/>　　定位 LoadModule 指令在 httpd.conf 文件的位置。增加下列指令：<br/><br/>LoadModule ssl_module modules/mod_ssl.so<br/><br/>　　在AddModule 指令部分的最后面加上：<br/><br/>AddModule mod_ssl.c<br/><br/>　　从OpenSSL 源文件里拷贝 ssl.conf 到 Apache/conf/. 也可以下载 http://www.raibledesigns.com/tomcat/ssl.conf 。<br/><br/>　　在 httpd.conf的最后增加以下指令<br/><br/># see http://www.modssl.org/docs/2.4/ssl_reference.html for more info<br/>SSLMutex sem<br/>SSLRandomSeed startup builtin<br/>SSLSessionCache none<br/><br/>ErrorLog logs/ssl.log<br/>LogLevel info<br/># You can later change "info" to "warn" if everything is OK<br/><br/><VirtualHost www.my-server.dom:443><br/>SSLEngine On<br/>SSLCertificateFile conf/ssl/server.crt<br/>SSLCertificateKeyFile conf/ssl/server.key<br/></VirtualHost><br/><br/>　　如果配置文件里 IfDefine 指令有效，则运行 apache 的时候要加上 -D SSL 参数。<br/><br/>　　注意： 使用多个虚拟主机的时候，必须用基于 ip 的配置，因为 SSL 需要配置一个指定端口 443，如果使用了基于名字的指令（对于所有端口）则 apache 服务器会报错<br/><br/>[error] VirtualHost _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results<br/><br/>　　启动 apache 服务器，如果顺利的话你会看到：<br/><br/>D:&#92;Apache>apache -D SSL<br/>[Tue Oct 19 22:18:32 2004] [warn] Loaded DSO d:/apache/php/sapi/php4apache.dll u<br/>ses plain Apache 1.3 API, this module might crash under EAPI! (please recompile<br/>it with -DEAPI)<br/>Apache/1.3.31 (Win32) mod_ssl/2.8.19 OpenSSL/0.9.7d PHP/4.3.6 running...<br/><br/>　　如果不能正确启动，仔细看屏幕提示，你会从中得到解决的办法。<br/><br/>　　如果一切顺利，那么，打开IE，访问 https://localhost<br/><br/>　　参考文档和相关链接：<br/>http://raibledesigns.com/wiki/Wiki.jsp?page=ApacheSSL<br/>http://www.yesky.com/<br/>http://hunter.campbus.com/<br/>http://www.cygwin.com/<br/>http://www.shininglightpro.com/
]]>
</description>
</item><item>
<link>//gm.angeldm.com/read.php?&amp;guid=0#topreply</link>
<title><![CDATA[[评论]  Win32 平台下 Apache+SSL 配置指南]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>//gm.angeldm.com/read.php?&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>