<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Computer, Electron and Technology &#187; openssl</title>
	<atom:link href="http://www.donevii.com/post/tag/openssl/feed" rel="self" type="application/rss+xml" />
	<link>http://www.donevii.com</link>
	<description>关注技术、移动互联网以及一切 GEEK &#38; NERD 的事情</description>
	<lastBuildDate>Wed, 21 Dec 2011 10:49:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>redhad下的openssl(安装和卸载)</title>
		<link>http://www.donevii.com/post/348.html</link>
		<comments>http://www.donevii.com/post/348.html#comments</comments>
		<pubDate>Fri, 21 Sep 2007 10:47:46 +0000</pubDate>
		<dc:creator>dengwei</dc:creator>
				<category><![CDATA[doc]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.donevii.com/?p=348</guid>
		<description><![CDATA[转至: http://blog.csdn.net/baitianhai/archive/2004/10/27/155461.aspx 最近在鼓捣redhat linux，想自己以源代码方式安装软件，不想用rpm方式安装。 首先从httpd开始，先卸载在安装倒是比较容易，不过后来像添加... ]]></description>
			<content:encoded><![CDATA[<p>转至: http://<a href="http://www.donevii.com/post/tag/blog" class="st_tag internal_tag" rel="tag" title="Posts tagged with blog">blog</a>.csdn.net/baitianhai/archive/2004/10/27/155461.aspx</p>
<p>最近在鼓捣redhat <a href="http://www.donevii.com/post/tag/linux" class="st_tag internal_tag" rel="tag" title="Posts tagged with linux">linux</a>，想自己以源代码方式安装软件，不想用rpm方式安装。</p>
<p>首先从httpd开始，先卸载在安装倒是比较容易，不过后来像添加ssl功能，发现编译的时候需要用openssl的安装目录，本人比较愚笨，一顿好找也没有找到，于是就想把openssl也以源代码方式安装。先卸载，此时出现问题，系统好多东西依赖于openssl的库，我查了好多资料也没找到什么办法，于是我最后一狠心，用rpm -e &#8211;nodeps给卸载了，然后手动安装了openssl，然后重新启动，这下坏了，好多服务都起不来了，smb,ssh等等，图形模式也起不来了，我欲哭无泪。</p>
<p>因为我是在虚拟机上安装的，smb起不来了，我只能重新安装系统了。这次安装我大多数东西都没选择，一路安装完毕，结果在文本方式发现vi编辑没有颜色了，哎，也不知道是少装了那个东西弄得（各位谁知道麻烦告诉告诉我一下），只能按照猜测重新安装了又添加了一些东西。不过幸运的vi高亮显示功能又有了，遗憾的是具体是那个软件我还是不清楚。有了上次的教训我不敢轻易卸掉系统原来的openssl了，我从网上搜索到了一篇安装openssl的英文文章，地址在 http://www.devside.net/<a href="http://www.donevii.com/post/tag/web" class="st_tag internal_tag" rel="tag" title="Posts tagged with web">web</a>/<a href="http://www.donevii.com/post/tag/server" class="st_tag internal_tag" rel="tag" title="Posts tagged with server">server</a>/linux/<a href="http://www.donevii.com/post/tag/openssl" class="st_tag internal_tag" rel="tag" title="Posts tagged with openssl">openssl</a> 我按照上面说的安装了zlib,<a href="http://www.donevii.com/post/tag/openssl" class="st_tag internal_tag" rel="tag" title="Posts tagged with openssl">openssl</a>。步骤简介如下（怕以后忘了）</p>
<p>安装zlib</p>
<p>Home : http://www.gzip.org/zlib/</p>
<p>Package(linux source) : http://www.gzip.org/zlib/</p>
<p>Our Configuration</p>
<p>Install to : /usr/local</p>
<p>Module types : dynamically and staticly loaded modules, *.so and *.a</p>
<p>Build Instructions</p>
<p>zlib library files are placed into /usr/local/lib and zlib header files are placed into /usr/local/include, by default.</p>
<p>Build static libraries</p>
<p>&#8230;/zlib-1.2.1]# ./configure</p>
<p>&#8230;/zlib-1.2.1]# make test</p>
<p>&#8230;/zlib-1.2.1]# make install</p>
<p>Build shared libraries</p>
<p>&#8230;/zlib-1.2.1]# make clean</p>
<p>&#8230;/zlib-1.2.1]# ./configure &#8211;shared</p>
<p>&#8230;/zlib-1.2.1]# make test</p>
<p>&#8230;/zlib-1.2.1]# make install</p>
<p>&#8230;/zlib-1.2.1]# cp zutil.h /usr/local/include</p>
<p>&#8230;/zlib-1.2.1]# cp zutil.c /usr/local/include</p>
<p>/usr/local/lib should now contain&#8230;</p>
<p>libz.a</p>
<p>libz.so -&gt; libz.so.1.2.1</p>
<p>libz.so.1 -&gt; libz.so.1.2.1</p>
<p>libz.so.1.2.1</p>
<p>/usr/local/include should now contain&#8230;</p>
<p>zconf.h</p>
<p>zlib.h</p>
<p>zutil.h</p>
<p>[Optional] Instructions for non-standard placement of zlib</p>
<p>Create the directory that will contain zlib</p>
<p>&#8230;/zlib-1.2.1]# mkdir /usr/local/zlib</p>
<p>Follow the given procedure above, except</p>
<p>&#8230;/zlib-1.2.1]# ./configure &#8211;prefix=/usr/local/zlib</p>
<p>Update the Run-Time Linker</p>
<p>/etc/ld.so.<a href="http://www.donevii.com/post/tag/cache" class="st_tag internal_tag" rel="tag" title="Posts tagged with cache">cache</a> will need to be updated with the new zlib shared lib: libz.so.1.2.1</p>
<p>For standard zlib installation&#8230;</p>
<p>Add /usr/local/lib to /etc/ld.so.conf, if specified path is not present</p>
<p>/etc]# ldconfig</p>
<p>If zlib was installed with a prefix&#8230;</p>
<p>Add /usr/local/zlib/lib to /etc/ld.so.conf</p>
<p>/etc]# ldconfig</p>
<p>安装openssl</p>
<p>Download</p>
<p>Home : http://www.openssl.org/</p>
<p>Package(source) : openssl-0.9.7d.tar.gz</p>
<p>Our Configuration</p>
<p>install to : /usr/local/ssl</p>
<p>module types : dynamically and staticly loaded modules, *.so *.a</p>
<p>Build Instructions</p>
<p>&#8230;/openssl-0.9.7d]# ./config</p>
<p>&#8211;prefix=/usr/local/ssl</p>
<p>[default location]</p>
<p>shared</p>
<p>[in addition to the usual static libraries, create shared libraries]</p>
<p>zlib-dynamic</p>
<p>[like "zlib", but has OpenSSL load the zlib library dynamically when needed]</p>
<p>&#8230;/openssl-0.9.7d]# ./config -t</p>
<p>[display guess on system made by ./config]</p>
<p>&#8230;/openssl-0.9.7d]# make</p>
<p>&#8230;/openssl-0.9.7d]# make test</p>
<p>&#8230;/openssl-0.9.7d]# make install</p>
<p>Update the Run-time Linker</p>
<p>ld.so.cache will need to be updated with the location of the new OpenSSL shared libs: libcrypto.so.0.9.7 and libssl.so.0.9.7</p>
<p>Sometimes it is sufficient to just add these two files to /lib, but we recommend you follow these instructions instead.</p>
<p>Edit /etc/ld.so.conf</p>
<p>Add /usr/local/ssl/lib to the bottom.</p>
<p>&#8230;]# ldconfig</p>
<p>Update the PATH</p>
<p>Edit /root/.bash_profile</p>
<p>Add /usr/local/ssl/bin to the PATH variable.</p>
<p>Re-login</p>
<p>Testing</p>
<p>&#8230;]# openssl version</p>
<p>Should display OpenSSL 0.9.7d 17 Mar 2004</p>
<p>If an older version is shown, your system contains a previously installed OpenSSL.</p>
<p>Repeate the steps in Update the PATH, except place the specified location at the start of the PATH variable.</p>
<p>[the older openssl, on most systems, is located under /usr/bin]</p>
<p>[the command 'which openssl' should display the path of the openssl that your system is using]</p>
<p>/usr/local/ssl/bin]# ./openssl version should display the correct version.</p>
<p>但是我最后没有得到想要的结果，系统原来的openssl还是没能卸载掉，我该怎么做那？我继续搜索资料，哈，幸运的我找了，在一个国内论坛上是这么说的</p>
<p>cd /usr/local/ssl/lib</p>
<p>ln -s libcrypto.so.0.9.7 libcrypto.so.2</p>
<p>ln -s libssl.so.0.9.7 libssl.so.2</p>
<p>//最后要刷新系统的动态连接库配置</p>
<p>echo /usr/local/ssl/lib &gt;&gt; /etc/ld.so.conf</p>
<p>ldconfig -v</p>
<p>这下子我豁然开朗，原来依赖的那2个文件是个软链接啊，我把它修改为我现在真正的openssl库文件不是就行了吗？于是一顿忙碌后，我终于执行了 rpm -e -nodeps ，然后重新启动系统，一路运行下去，全是绿灯。一时间感觉自己好幸福啊</p>
<p>为了这个问题我查了国内的几个比较大的unix/linux网站都没找到资料，不过从这里http://bbs.netbuddy.org/<a href="http://www.donevii.com/post/tag/unix" class="st_tag internal_tag" rel="tag" title="Posts tagged with unix">unix</a>/737.html还是找到了（国外的E文大概意思能看懂，但是查找起来还是没找到，也不知道这方面好点的网站），</p>
]]></content:encoded>
			<wfw:commentRss>http://www.donevii.com/post/348.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

