<?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/"
	>

<channel>
	<title>Yousri's Blog</title>
	<atom:link href="http://qingxianyan.cn/feed" rel="self" type="application/rss+xml" />
	<link>http://qingxianyan.cn</link>
	<description>沙漠之俊</description>
	<pubDate>Fri, 21 Aug 2009 09:15:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Say Goodbye To Independent Blog</title>
		<link>http://qingxianyan.cn/2009/08/13/say-goodbye-to-independent-blog.html</link>
		<comments>http://qingxianyan.cn/2009/08/13/say-goodbye-to-independent-blog.html#comments</comments>
		<pubDate>Thu, 13 Aug 2009 12:52:03 +0000</pubDate>
		<dc:creator>yanqingxian.openid.35.com</dc:creator>
		
		<category><![CDATA[不想分类]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=353</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160; 前天傍晚下班后在公车上照往常一样想用手机访问搭建在自己国外空间的Dabr（大波）使用Twitter，发现竟然无法访问，赶快试了下自己博客的手机版，同样失败。。。后来使用opear mini国际版的浏览器测试了下访问正常，那一刻自己基本可以断定没啥救了肯定是空间服务器IP被封了。虽然合租空间11月也快到期了就是，但看来得提前离开了，故先将上面的空间数据和数据库数据拷贝回来到本地。
&#160;&#160;&#160;&#160; 本来想找@belltoy朋友借空间暂放下！后来想想感觉貌似没啥必要，一方面，一直以来自己写的根本不是博客而是无聊而已，而且也很久没有更新过日志文章，感觉是种浪费别人的空间；另一方面，自己偶尔会比较愤的记录一些本该沉默的东西，而招来难免之灾，因为有时都怀疑此次IP被封会不会因为与自己博客文章敏感度的几篇文章有关而带来的（但始终还是觉得自己肯定没那么&#8220;伟大&#8221;），所以为了避免再牵连无辜，就省了吧。所以决定，特地在此开启两个新账号，暂时迁移到Yo2（优博）来先放放吧。从此暂与独立博客说再见！
&#160;&#160;&#160;&#160; 镜像地址：LifeBlog（需翻墙） ---> http://yousrilife.yo2.cn&#160;&#160; Yousri's Blog（需翻墙） ---> http://yousri.yo2.cn&#160; 其实比较可惜遗憾的是yousri.org 和 qingxianyan.cn 两个域名的白白浪费哈&#160; 叹息///&#160; 所以哪天激情来时，肯定还会再独立的！
&#160;&#160;&#160;&#160;订阅地址：http://feeds.feedburner.com/qingxianyan
&#160;&#160;&#160;&#160; ps：同时也借此文测试下看Yo2上的某个插件是否能实现将文章烧制原来的Feed地址上！
]]></description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp; 前天傍晚下班后在公车上照往常一样想用手机访问搭建在自己国外空间的Dabr（大波）使用Twitter，发现竟然无法访问，赶快试了下自己博客的手机版，同样失败。。。后来使用opear mini国际版的浏览器测试了下访问正常，那一刻自己基本可以断定没啥救了肯定是空间服务器IP被封了。虽然合租空间11月也快到期了就是，但看来得提前离开了，故先将上面的空间数据和数据库数据拷贝回来到本地。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 本来想找<a href="https://twitter.com/belltoy" target="_blank">@belltoy</a>朋友借空间暂放下！后来想想感觉貌似没啥必要，一方面，一直以来自己写的根本不是博客而是无聊而已，而且也很久没有更新过日志文章，感觉是种浪费别人的空间；另一方面，自己偶尔会比较愤的记录一些本该沉默的东西，而招来难免之灾，因为有时都怀疑此次IP被封会不会因为与自己博客文章敏感度的几篇文章有关而带来的（但始终还是觉得自己肯定没那么&ldquo;伟大&rdquo;），所以为了避免再牵连无辜，就省了吧。所以决定，特地在此开启两个新账号，暂时迁移到Yo2（优博）来先放放吧。从此暂与独立博客说再见！</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 镜像地址：<a href="http://blog.qingxianyan.cn" target="_blank">LifeBlog</a>（需翻墙） ---> <a href="http://yousrilife.yo2.cn" target="_self">http://yousrilife.yo2.cn</a>&nbsp;&nbsp; <a href="http://qingxianyan.cn" target="_blank">Yousri's Blog</a>（需翻墙） ---> <a href="http://yousri.yo2.cn" target="_blank">http://yousri.yo2.cn</a>&nbsp; 其实比较可惜遗憾的是yousri.org 和 qingxianyan.cn 两个域名的白白浪费哈&nbsp; 叹息///&nbsp; 所以哪天激情来时，肯定还会再独立的！</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;订阅地址：<a href="http://feeds.feedburner.com/yousriblog" target="_blank">http://feeds.feedburner.com/qingxianyan</a></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; ps：同时也借此文测试下看Yo2上的某个插件是否能实现将文章烧制原来的Feed地址上！</p>
]]></content:encoded>
			<wfw:commentRss>http://qingxianyan.cn/2009/08/13/say-goodbye-to-independent-blog.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>个人常用的两招翻墙访问Twitter</title>
		<link>http://qingxianyan.cn/2009/07/27/%e4%b8%aa%e4%ba%ba%e5%b8%b8%e7%94%a8%e7%9a%84%e4%b8%a4%e6%8b%9b%e7%bf%bb%e5%a2%99%e8%ae%bf%e9%97%aetwitter.html</link>
		<comments>http://qingxianyan.cn/2009/07/27/%e4%b8%aa%e4%ba%ba%e5%b8%b8%e7%94%a8%e7%9a%84%e4%b8%a4%e6%8b%9b%e7%bf%bb%e5%a2%99%e8%ae%bf%e9%97%aetwitter.html#comments</comments>
		<pubDate>Mon, 27 Jul 2009 09:25:03 +0000</pubDate>
		<dc:creator>yanqingxian.openid.35.com</dc:creator>
		
		<category><![CDATA[网络信息]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=349</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;如今在天朝的关心照顾下国内微博客已陷入非常时期，众多曾沉溺于国内微博客（主要是饭否）的朋友们都苦恼于如何比较简单方便的使用Twitter/// 其实关于如何翻墙上Twitter的教程已是遍满整个互联网随处可见。。。但发现貌似身边的貌似还有不少还是觉得自己对计算机不熟不是做这行不懂，其实说白了是没去尝试而想天真的觉得有多复杂，但其中的设置、翻墙起来一点都不难哈，所以此篇文章只是针对自己所常用翻墙访问被&#8220;强奸&#8221;的网站的两招记录下来分享给自己身边需要的朋友而已，懂得如何翻墙的可以绕过无视之或可以提供更好快捷简单的方法分享下。废话到此，大致步骤如下：
&#160;&#160;&#160;&#160;&#160;一、修改本地hosts文件实现翻墙(关键寻找可用IP）
&#160;&#160;&#160;&#160;1、使用记事本或其他文本编辑器打开C:\WINDOWS\system32\drivers\etc目录下的Hosts配置文件(这里个人使用vim编辑器，建议使用记事本Notepad系统自带编辑器）可能默认文件如图：
&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;2、添加twitter、facebook、youtube等站点对应的可用IP（此IP得网上搜集）记录修改Hosts配置文件
&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;&#160;(来自twitpic：http://twitpic.com/bfdw6)
&#160;&#160;&#160;&#160;注意：IP地址前面不要有空格，ip地址和域名之间，要有至少1个空格或tab分隔符。以上IP个人测试皆可用
&#160;&#160;&#160;&#160;3、保存配置文件hosts退出。若无法提示无法保存文件（正常vista才比较可能遇到）可以查看官方说明及解决措施：http://support.microsoft.com/kb/923947/zh-cn 。
&#160;&#160;&#160;&#160;4、现在可以使用浏览器使用加密的https:// 协议打开以上各站点进行访问即可啦。
&#160;&#160;&#160;&#160;补充：此处就只介绍微软windows系列系统的环境下的，因为此次提供给的用户是身边认识需要的朋友基本都是xp或vista的系统，再者使用linux系统的想必都比我这种菜鸟还NB还在行，这种小伎俩不在话下。
&#160;&#160;&#160;&#160; 二、强烈推荐使用UltraVPN免费VPN实现翻墙。
&#160;&#160;&#160;&#160;之前有听过此款免费VPN的好用，因为自己一直使用的是第一种方法的，也懒得去使用开启那么多客户端之类的程序，所以就一直没有试用过，直到上周想上FriendFeed无解，所以决定安装UltraVPN试用看看，而后感觉确实挺不错的而且速度还可以接受啊。所以推荐需要的话可以首选其作为免费vpn，只需注册个账号即免费使用。
&#160;&#160;&#160;&#160;1、下载UltraVPN：点击这里
&#160;&#160;&#160;&#160;2、安装软件，过程中可能会出现一个安装虚拟网卡的对话窗口，如下图，点击仍然继续。
&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;3、打开 C:\Program Files\UltraVPN\config 文件夹（默认安装目录），将client.ovpn改名为 ultra.ovpn。可以下载其他可用的OpenVPN的配置文件，比如 alonweb 的配置文件在这里，解压到这个文件夹，将alonweb.conf 改名为 alonweb.ovpn；其他VPN服务的配置也是如此。
&#160;&#160;&#160; &#160;&#160;
&#160;&#160;&#160;&#160;4、双击运行ultravpn软件，任务栏右下角会有多出一个vpn链接图标，如图所示（右键选择对应的vpn链接）
&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;5、要求你输入用户名密码。

UltraVPN获取免费用户名密码
AlonWeb获取免费用户名密码


&#160;&#160;&#160;&#160;&#160;
&#160;&#160;&#160;&#160;6、输入注册的账号和密码登陆，等待一会，右下角的UltraVPN图标颜色由红色-->绿色就表示已经链接成功。这里就不截图啦/// 有什么问题再说吧！
&#160;&#160;&#160;&#160;好啦，关于自己如何翻墙上Twitter或者使用UltraVPN免费VPN使用国外（本人ultravpn得到的是法国的IP地址）网络访问被墙在外的网站的，如相识的现实朋友想上Twitter微博客的话可以这两措施试试修改访问看看，如果还有什么不明白的可以私下与鄙人联系，尽自己微薄之力助你一臂之力 嗯！
&#160;&#160;&#160;&#160;Ps:N久没更新啦，就趁为了帮某些朋友整理篇大众文章意思更新下吧，最近没心情写博了。。。
]]></description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;如今在天朝的关心照顾下国内微博客已陷入非常时期，众多曾沉溺于国内微博客（主要是饭否）的朋友们都苦恼于如何比较简单方便的使用Twitter/// 其实关于如何翻墙上Twitter的教程已是遍满整个互联网随处可见。。。但发现貌似身边的貌似还有不少还是觉得自己对计算机不熟不是做这行不懂，其实说白了是没去尝试而想天真的觉得有多复杂，但其中的设置、翻墙起来一点都不难哈，所以此篇文章只是针对自己所常用翻墙访问被&ldquo;强奸&rdquo;的网站的两招记录下来分享给自己身边需要的朋友而已，懂得如何翻墙的可以绕过无视之或可以提供更好快捷简单的方法分享下。废话到此，大致步骤如下：</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一、修改本地hosts文件实现翻墙(关键寻找可用IP）<br />
&nbsp;&nbsp;&nbsp;&nbsp;1、使用记事本或其他文本编辑器打开C:\WINDOWS\system32\drivers\etc目录下的Hosts配置文件(这里个人使用vim编辑器，建议使用记事本Notepad系统自带编辑器）可能默认文件如图：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://i3.6.cn/cvbnm/e7/a2/2c/eb404f601909ce2a8c35e597d57a6571.jpg" border="0" alt="" /><br />
&nbsp;&nbsp;&nbsp;&nbsp;2、添加twitter、facebook、youtube等站点对应的可用IP（此IP得网上搜集）记录修改Hosts配置文件<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://i3.6.cn/cvbnm/da/0f/c8/20c167ad18532ff6c0ba8775874c73ba.jpg" border="0" alt="" /><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://i3.6.cn/cvbnm/98/9e/e8/2d61b5483f200db5ab776a57fd23b371.jpg" border="0" alt="" />(来自twitpic：http://twitpic.com/bfdw6)<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000">注意</span>：IP地址前面不要有空格，ip地址和域名之间，要有至少1个空格或tab分隔符。以上IP个人测试皆可用<br />
&nbsp;&nbsp;&nbsp;&nbsp;3、保存配置文件hosts退出。若无法提示无法保存文件（正常vista才比较可能遇到）可以查看官方说明及解决措施：<a href="http://support.microsoft.com/kb/923947/zh-cn" target="_blank">http://support.microsoft.com/kb/923947/zh-cn</a> 。<br />
&nbsp;&nbsp;&nbsp;&nbsp;4、现在可以使用浏览器使用加密的https:// 协议打开以上各站点进行访问即可啦。<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000">补充</span>：此处就只介绍微软windows系列系统的环境下的，因为此次提供给的用户是身边认识需要的朋友基本都是xp或vista的系统，再者使用linux系统的想必都比我这种菜鸟还NB还在行，这种小伎俩不在话下。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 二、强烈推荐使用UltraVPN免费VPN实现翻墙。<br />
&nbsp;&nbsp;&nbsp;&nbsp;之前有听过此款免费VPN的好用，因为自己一直使用的是第一种方法的，也懒得去使用开启那么多客户端之类的程序，所以就一直没有试用过，直到上周想上FriendFeed无解，所以决定安装UltraVPN试用看看，而后感觉确实挺不错的而且速度还可以接受啊。所以推荐需要的话可以首选其作为免费vpn，只需注册个账号即免费使用。<br />
&nbsp;&nbsp;&nbsp;&nbsp;1、下载UltraVPN：<a href="https://www.ultravpn.fr/download/ultravpn-install.exe" target="_blank">点击这里</a><br />
&nbsp;&nbsp;&nbsp;&nbsp;2、安装软件，过程中可能会出现一个安装虚拟网卡的对话窗口，如下图，点击仍然继续。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://i3.6.cn/cvbnm/d6/dd/c7/260eef0c0d121bbbe5097659f2cf19af.jpg" border="0" alt="" /><br />
&nbsp;&nbsp;&nbsp;&nbsp;3、打开 C:\Program Files\UltraVPN\config 文件夹（默认安装目录），将client.ovpn改名为 ultra.ovpn。可以下载其他可用的OpenVPN的配置文件，比如 <a rel="nofollow" href="http://static.alonweb.com/downloads/alonweb.tar.gz" target="_blank">alonweb 的配置文件在这里</a>，解压到这个文件夹，将alonweb.conf 改名为 alonweb.ovpn；其他VPN服务的配置也是如此。<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<img src="http://i3.6.cn/cvbnm/6c/c2/22/a3ce144609f975ce4bb23c0b2b8b927c.jpg" border="0" alt="" /><br />
&nbsp;&nbsp;&nbsp;&nbsp;4、双击运行ultravpn软件，任务栏右下角会有多出一个vpn链接图标，如图所示（右键选择对应的vpn链接）<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://i3.6.cn/cvbnm/39/3e/42/e73954bb56ed91fe1876ecd59b5ba700.jpg" border="0" alt="" /><br />
&nbsp;&nbsp;&nbsp;&nbsp;5、要求你输入用户名密码。</p>
<ul>
<li><a rel="nofollow" href="http://www.ultravpn.fr/account.htm" target="_blank">UltraVPN获取免费用户名密码</a></li>
<li><a rel="nofollow" href="http://alonweb.com/?q=user/register" target="_blank">AlonWeb获取免费用户名密码</a></li>
</ul>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://i3.6.cn/cvbnm/fb/79/96/15001b96c79323de24c41f343c857477.jpg" border="0" alt="" /><br />
&nbsp;&nbsp;&nbsp;&nbsp;6、输入注册的账号和密码登陆，等待一会，右下角的UltraVPN图标颜色由红色-->绿色就表示已经链接成功。这里就不截图啦/// 有什么问题再说吧！<br />
&nbsp;&nbsp;&nbsp;&nbsp;好啦，关于自己如何翻墙上Twitter或者使用UltraVPN免费VPN使用国外（本人ultravpn得到的是法国的IP地址）网络访问被墙在外的网站的，如相识的现实朋友想上Twitter微博客的话可以这两措施试试修改访问看看，如果还有什么不明白的可以私下与鄙人联系，尽自己微薄之力助你一臂之力 嗯！</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Ps:N久没更新啦，就趁为了帮某些朋友整理篇大众文章意思更新下吧，最近没心情写博了。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://qingxianyan.cn/2009/07/27/%e4%b8%aa%e4%ba%ba%e5%b8%b8%e7%94%a8%e7%9a%84%e4%b8%a4%e6%8b%9b%e7%bf%bb%e5%a2%99%e8%ae%bf%e9%97%aetwitter.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Wordpress变换IP或新域名及实现子目录安装根目录访问设置</title>
		<link>http://qingxianyan.cn/2009/06/17/wordpress%e5%8f%98%e6%8d%a2ip%e6%88%96%e6%96%b0%e5%9f%9f%e5%90%8d%e5%8f%8a%e5%ae%9e%e7%8e%b0%e5%ad%90%e7%9b%ae%e5%bd%95%e5%ae%89%e8%a3%85%e6%a0%b9%e7%9b%ae%e5%bd%95%e8%ae%bf%e9%97%ae%e8%ae%be%e7%bd%ae.html</link>
		<comments>http://qingxianyan.cn/2009/06/17/wordpress%e5%8f%98%e6%8d%a2ip%e6%88%96%e6%96%b0%e5%9f%9f%e5%90%8d%e5%8f%8a%e5%ae%9e%e7%8e%b0%e5%ad%90%e7%9b%ae%e5%bd%95%e5%ae%89%e8%a3%85%e6%a0%b9%e7%9b%ae%e5%bd%95%e8%ae%bf%e9%97%ae%e8%ae%be%e7%bd%ae.html#comments</comments>
		<pubDate>Wed, 17 Jun 2009 07:08:35 +0000</pubDate>
		<dc:creator>yanqingxian.openid.35.com</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=341</guid>
		<description><![CDATA[一、WordPress博客程序更换访问IP地址或新域名相关修改设置：
&#160;&#160; &#160;&#160;&#160;&#160;由于是在本地虚拟机测试安装WordPress博客程序，没想到当初虚拟机用的是DHCP分配IP经常变动(或者更改新的域名地址），所以wordpress博客访问IP地址（或者域名地址）跟着变动而出现异常，主要是需要修改数据库中 siteurl 和 home 这两项对应的访问链接地址。借助phpmyadmin图形数据库管理稍作修改即可
&#160;&#160; &#160;&#160;&#160;&#160;phpmyadmin-->wordpress_db_name-->wp-option--->option_name=siteurl&#038;home
&#160;&#160; &#160;&#160;&#160;&#160;将数据库表wp-option中option_name值为siteurl及home的编辑修改为新的IP地址(或者域名地址），搞定！如：原先使用本地动态IP:192.168.0.99搭建WordPress程序，由于变动手动设置静态IP为192.168.0.230故导致访问出现异常。将siteurl&#038;home值http://192.168.0.99/wordpress-->http://192.168.0.230/wordpress即可
二、将WordPress程序安装至子目录中而访问博客显示为根目录
&#160;&#160; &#160;&#160;&#160;&#160;WordPress允许你把WordPress文件放在一个子目录，而根目录可以留着放自己设计制作独特的个性主页，但在此之前依旧想让访问博客显示在站点的根目录中。
&#160;&#160; &#160;&#160;&#160;&#160;1、创建用于存放WordPress安装程序的子目录（如本地以/blog为例，并全新安装博客
&#160;&#160; &#160;&#160;&#160;&#160;2、完成安装后进入控制面板-->设置--常规选项。
&#160;&#160; &#160;&#160;&#160;&#160;3、查找 WordPress 地址（URL）这个选项：把后面的地址改成刚创建存放WordPress安装程序的文件夹地址。比如：http://192.168.0.230/blog
&#160;&#160; &#160;&#160;&#160;&#160;4、找到Blog 地址（URL）这个选项：把此地址改为访问博客的根目录的URL。例如：http://192.168.0.230
&#160;&#160; &#160;&#160;
&#160;&#160; &#160;&#160;&#160;&#160;5、保存更新设置
&#160;&#160; &#160;&#160;&#160;&#160;6、将/blog子目录下的index.php和.htaccess文件(如果不存在则手动创建)转移到根目录（即Blog address对应目录）中。
&#160;&#160; &#160;&#160;&#160;&#160;7、打开并编辑根目录下”index.php”这个文件。
&#160;&#160; &#160;&#160;&#160;&#160;8、找到如下代码，修改并保存：找到
&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;require(’./wp-blog-header.php’);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;把地址改为你WordPress目录下的文件：
&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;require(’./blog/wp-blog-header.php’);
&#160;&#160;&#160;&#160;&#160;&#160;9、登陆控制面板，新的控制面板地址为http://192.168.0.230/blog/wp-admin/
&#160;&#160;&#160;&#160;&#160;&#160;10、如果你设置了结构化链接地址（Permalinks），打开永久链接选项面板更新Permalinks结构。如果.htaccess有正确的权限设置的话WordPress会自动更新你的.htaccess文件。如果 WordPress不能写入你的.htaccess文件，就会显示新的rewrite规则，因此你就需要手动把rewrite规则复制到.htaccess文件中（和index.php同目录)，如在本地测试得到结果:

123456&#160;RewriteEngine OnRewriteBase /RewriteCond %&#123;REQUEST_FILENAME&#125; !-fRewriteCond %&#123;REQUEST_FILENAME&#125; !-dRewriteRule . /index.php &#91;L&#93;


&#160;&#160;&#160;&#160;&#160;&#160;官方文档：http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
]]></description>
			<content:encoded><![CDATA[<p>一、WordPress博客程序更换访问IP地址或新域名相关修改设置：<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;由于是在本地虚拟机测试安装WordPress博客程序，没想到当初虚拟机用的是DHCP分配IP经常变动(或者更改新的域名地址），所以wordpress博客访问IP地址（或者域名地址）跟着变动而出现异常，主要是需要修改数据库中 siteurl 和 home 这两项对应的访问链接地址。借助phpmyadmin图形数据库管理稍作修改即可<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;phpmyadmin-->wordpress_db_name-->wp-option--->option_name=siteurl&#038;home<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;将数据库表wp-option中option_name值为siteurl及home的编辑修改为新的IP地址(或者域名地址），搞定！如：原先使用本地动态IP:192.168.0.99搭建WordPress程序，由于变动手动设置静态IP为192.168.0.230故导致访问出现异常。将siteurl&#038;home值http://192.168.0.99/wordpress-->http://192.168.0.230/wordpress即可</p>
<p>二、将WordPress程序安装至子目录中而访问博客显示为根目录<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;WordPress允许你把WordPress文件放在一个子目录，而根目录可以留着放自己设计制作独特的个性主页，但在此之前依旧想让访问博客显示在站点的根目录中。<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;1、创建用于存放WordPress安装程序的子目录（如本地以/blog为例，并全新安装博客<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;2、完成安装后进入控制面板-->设置--常规选项。<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;3、查找 WordPress 地址（URL）这个选项：把后面的地址改成刚创建存放WordPress安装程序的文件夹地址。比如：http://192.168.0.230/blog<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;4、找到Blog 地址（URL）这个选项：把此地址改为访问博客的根目录的URL。例如：http://192.168.0.230<br />
&nbsp;&nbsp; &nbsp;&nbsp;<a href="http://tu.6.cn/pic/show/id/3684817"><img src="http://i3.6.cn/cvbnm/2b/00/d9/0cfaa04781cea0d8c84658838a434663.jpg" alt="" /></a><br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;5、保存更新设置<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;6、将/blog子目录下的index.php和.htaccess文件(如果不存在则手动创建)转移到根目录（即Blog address对应目录）中。<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;7、打开并编辑根目录下”index.php”这个文件。<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;8、找到如下代码，修改并保存：找到<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;require(’./wp-blog-header.php’);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;把地址改为你WordPress目录下的文件：<br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;require(’./blog/wp-blog-header.php’);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9、登陆控制面板，新的控制面板地址为http://192.168.0.230/blog/wp-admin/<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10、如果你设置了结构化链接地址（Permalinks），打开永久链接选项面板更新Permalinks结构。如果.htaccess有正确的权限设置的话WordPress会自动更新你的.htaccess文件。如果 WordPress不能写入你的.htaccess文件，就会显示新的rewrite规则，因此你就需要手动把rewrite规则复制到.htaccess文件中（和index.php同目录)，如在本地测试得到结果:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li></ol></pre></td><td class="code"><pre class="apache"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">&nbsp;</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #00007f;">RewriteBase</span> /</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #00007f;">RewriteCond</span> %<span style="color: #66cc66;">&#123;</span>REQUEST_FILENAME<span style="color: #66cc66;">&#125;</span> !-f</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #00007f;">RewriteCond</span> %<span style="color: #66cc66;">&#123;</span>REQUEST_FILENAME<span style="color: #66cc66;">&#125;</span> !-d</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #00007f;">RewriteRule</span> . /index.php <span style="color: #66cc66;">&#91;</span>L<span style="color: #66cc66;">&#93;</span></div></li></ol></pre></td></tr></table></div>

<p><a href="http://tu.6.cn/pic/show/id/3684816"><img src="http://i3.6.cn/cvbnm/45/a8/1b/b6ab4ce47018d1cf8417c715a1fffbc6.jpg" alt="" /></a><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;官方文档：<a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory" target="_blank">http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory</a></p>
]]></content:encoded>
			<wfw:commentRss>http://qingxianyan.cn/2009/06/17/wordpress%e5%8f%98%e6%8d%a2ip%e6%88%96%e6%96%b0%e5%9f%9f%e5%90%8d%e5%8f%8a%e5%ae%9e%e7%8e%b0%e5%ad%90%e7%9b%ae%e5%bd%95%e5%ae%89%e8%a3%85%e6%a0%b9%e7%9b%ae%e5%bd%95%e8%ae%bf%e9%97%ae%e8%ae%be%e7%bd%ae.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Dokuwiki重写URL配置</title>
		<link>http://qingxianyan.cn/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html</link>
		<comments>http://qingxianyan.cn/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html#comments</comments>
		<pubDate>Wed, 27 May 2009 15:28:03 +0000</pubDate>
		<dc:creator>yanqingxian.openid.35.com</dc:creator>
		
		<category><![CDATA[服务配置]]></category>

		<category><![CDATA[Apache]]></category>

		<category><![CDATA[dokuwiki]]></category>

		<category><![CDATA[htaccess]]></category>

		<category><![CDATA[URL重写]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=334</guid>
		<description><![CDATA[默认情况下，DokuWiki不做任何的URL重写，它的原始URL是这样的：1. http://wiki.qingxianyan.cn/doku.php?id=page这样默认的URL不利于有些搜索引擎不收录，而且也不易于记忆
通过设置DokuWiki的配置设置里面的高级设置的userwrite配置选项它可以支持两种URL重写方法：&#160;&#160;&#160;&#160;&#160; 一个是利用服务器的mod_rewrite，&#160;&#160;&#160;&#160;&#160; 另一个是在DokuWiki内部自己处理URL重写。下面是userewrite选项值的列表及其对应的URL格式：&#160;&#160;&#160;&#160;&#160; 1、默认值没有URL重写 http://wiki.qingxianyan.cn/doku.php?id=wiki:syntax&#160;&#160;&#160;&#160;&#160; 2、htaccess服务器处理 http://wiki.qingxianyan.cn/wiki:syntax&#160;&#160;&#160;&#160;&#160; 3、DokuWiki处理 http://wiki.qingxianyan.cn/doku.php/wiki:syntax使用服务器处理　　先在/wiki/conf/dokuwiki.php中设置：&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $conf['userewrite'] = 1;
Apache服务器开启Rewrite功能
　　apache的URL重写是使用mod_rewrite模块。在apache的配置文件中添加如下这行：

1LoadModule rewrite_module modules/mod_rewrite.so

　　然后使用mod_rewrte的指令来配置URL重写规则。这些规则可以放在apache的全局配置文件内，也可以放在DokuWiki的根目录下的.htaccess文件内，事实上DokuWiki已经为了写好了这些规则放在.htaccess.dist中，修改删除部分“#”注释即可  内容如下：

123456789      RewriteEngine on      RewriteBase /dokuwiki      RewriteRule ^_media/&#40;.*&#41;              lib/exe/fetch.php?media=$1  &#91;QSA,L&#93;  [...]]]></description>
			<content:encoded><![CDATA[<p>默认情况下，DokuWiki不做任何的URL重写，它的原始URL是这样的：<br />1. http://wiki.qingxianyan.cn/doku.php?id=page<br />这样默认的URL不利于有些搜索引擎不收录，而且也不易于记忆<br />
通过设置DokuWiki的配置设置里面的高级设置的userwrite配置选项它可以支持两种URL重写方法：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 一个是利用服务器的mod_rewrite，<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 另一个是在DokuWiki内部自己处理URL重写。<br />下面是userewrite选项值的列表及其对应的URL格式：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1、默认值没有URL重写 http://wiki.qingxianyan.cn/doku.php?id=wiki:syntax<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2、htaccess服务器处理 http://wiki.qingxianyan.cn/wiki:syntax<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3、DokuWiki处理 http://wiki.qingxianyan.cn/doku.php/wiki:syntax<br />使用服务器处理<br />　　先在/wiki/conf/dokuwiki.php中设置：<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $conf['userewrite'] = 1;<br />
Apache服务器开启Rewrite功能<br />
　　apache的URL重写是使用mod_rewrite模块。在apache的配置文件中添加如下这行：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="apache"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #00007f;">LoadModule</span> rewrite_module modules/mod_rewrite.so</div></li></ol></pre></td></tr></table></div>

<p>　　然后使用mod_rewrte的指令来配置URL重写规则。这些规则可以放在apache的全局配置文件内，也可以放在DokuWiki的根目录下的.htaccess文件内，事实上DokuWiki已经为了写好了这些规则放在.htaccess.dist中，修改删除部分“#”注释即可  内容如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">7</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">8</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">9</div></li></ol></pre></td><td class="code"><pre class="apache"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">      <span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">on</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">      <span style="color: #00007f;">RewriteBase</span> /dokuwiki</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">      <span style="color: #00007f;">RewriteRule</span> ^_media/<span style="color: #66cc66;">&#40;</span>.*<span style="color: #66cc66;">&#41;</span>              lib/exe/fetch.php?media=$<span style="color: #ff0000;">1</span>  <span style="color: #66cc66;">&#91;</span>QSA,L<span style="color: #66cc66;">&#93;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">      <span style="color: #00007f;">RewriteRule</span> ^_detail/<span style="color: #66cc66;">&#40;</span>.*<span style="color: #66cc66;">&#41;</span>             lib/exe/detail.php?media=$<span style="color: #ff0000;">1</span>  <span style="color: #66cc66;">&#91;</span>QSA,L<span style="color: #66cc66;">&#93;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">      <span style="color: #00007f;">RewriteRule</span> ^_export/<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>^/<span style="color: #66cc66;">&#93;</span>+<span style="color: #66cc66;">&#41;</span>/<span style="color: #66cc66;">&#40;</span>.*<span style="color: #66cc66;">&#41;</span>     doku.php?do=export_$<span style="color: #ff0000;">1</span>&amp;id=$<span style="color: #ff0000;">2</span>  <span style="color: #66cc66;">&#91;</span>QSA,L<span style="color: #66cc66;">&#93;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">      <span style="color: #00007f;">RewriteRule</span> ^$                        doku.php  <span style="color: #66cc66;">&#91;</span>L<span style="color: #66cc66;">&#93;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">      <span style="color: #00007f;">RewriteCond</span> %<span style="color: #66cc66;">&#123;</span>REQUEST_FILENAME<span style="color: #66cc66;">&#125;</span>       !-f</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">      <span style="color: #00007f;">RewriteCond</span> %<span style="color: #66cc66;">&#123;</span>REQUEST_FILENAME<span style="color: #66cc66;">&#125;</span>       !-d</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">      <span style="color: #00007f;">RewriteRule</span> <span style="color: #66cc66;">&#40;</span>.*<span style="color: #66cc66;">&#41;</span>                      doku.php?id=$<span style="color: #ff0000;">1</span>  <span style="color: #66cc66;">&#91;</span>QSA,L<span style="color: #66cc66;">&#93;</span></div></li></ol></pre></td></tr></table></div>

<p>　　在RewriteBase /dokuwiki这一行，你需要根据实际情况做修改成指向你的DokuWiki目录的路径，Dokuwik就在站点根目录或者已经使用子域名解析到相应目录时，需将.htaccess 文件中的 RewriteBase /dokuwiki 行使用首字符“#”将其注释</p>
]]></content:encoded>
			<wfw:commentRss>http://qingxianyan.cn/2009/05/27/dokuwiki%e9%87%8d%e5%86%99url%e9%85%8d%e7%bd%ae.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>安装配置基于KBS程序的BBS系统</title>
		<link>http://qingxianyan.cn/2009/05/16/%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%ae%e5%9f%ba%e4%ba%8ekbs%e7%a8%8b%e5%ba%8f%e7%9a%84bbs%e7%b3%bb%e7%bb%9f.html</link>
		<comments>http://qingxianyan.cn/2009/05/16/%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%ae%e5%9f%ba%e4%ba%8ekbs%e7%a8%8b%e5%ba%8f%e7%9a%84bbs%e7%b3%bb%e7%bb%9f.html#comments</comments>
		<pubDate>Sat, 16 May 2009 15:00:55 +0000</pubDate>
		<dc:creator>yanqingxian.openid.35.com</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[服务配置]]></category>

		<category><![CDATA[bbs]]></category>

		<category><![CDATA[kbs]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=328</guid>
		<description><![CDATA[注：此文备录 相关信息来自网络 记录备用下并时刻更新
操作系统环境：VM虚拟机下的Ubuntu8.04 Server 只安装OpenSSH服务
KBS BBS： kbs svn上最新的源代码
Apache：apache1.3.41.tar.gz (下载：http://www.apache.org）
PHP：php5.2.6.tar.gz（下载：http://www.php.net）
代码目录:/home/bbs/src/ 
安装前准备工作：更新安装时可能所需要的包：

12345678910111213# apt-get install automake1.9# apt-get install php5-dev# apt-get install libmysqlclient15-dev# apt-get install sendmail# apt-get install libesmtp5# apt-get install byacc# apt-get install libgmp3-dev# apt-get install flex# apt-get install libxml2-dev# apt-get install libjpeg62-dev# apt-get install libpng12-dev# apt-get install libfreetype6-dev# apt-get install subversion

创建bbs用户：

1    # adduser bbs

安装apache服务：

12345# [...]]]></description>
			<content:encoded><![CDATA[<p>注：此文备录 相关信息来自网络 记录备用下并时刻更新<br />
操作系统环境：VM虚拟机下的Ubuntu8.04 Server 只安装OpenSSH服务<br />
KBS BBS： kbs svn上最新的源代码<br />
Apache：apache1.3.41.tar.gz (下载：<a href="http://www.apache.org">http://www.apache.org</a>）<br />
PHP：php5.2.6.tar.gz（下载：<a href="http://www.php.net">http://www.php.net</a>）<br />
代码目录:/home/bbs/src/ </p>
<p>安装前准备工作：更新安装时可能所需要的包：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">7</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">8</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">9</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">10</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">11</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">12</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">13</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install automake1.9</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install php5-dev</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install libmysqlclient15-dev</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install sendmail</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install libesmtp5</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install byacc</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install libgmp3-dev</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install flex</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install libxml2-dev</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install libjpeg62-dev</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install libpng12-dev</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install libfreetype6-dev</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># apt-get install subversion</span></div></li></ol></pre></td></tr></table></div>

<p>创建bbs用户：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #666666; font-style: italic;"># adduser bbs</span></div></li></ol></pre></td></tr></table></div>

<p>安装apache服务：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># tar xvf apache_1.3.41.tar.gz</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd apache_1.3.41</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># CC=&quot;gcc&quot; OPTIM=&quot;-O2&quot; ./configure --prefix=/home/bbs/www --enable-module=so</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># make</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># make install</span></div></li></ol></pre></td></tr></table></div>

<p>编辑apache的配置文件，User和Group都改成bbs，Port改成想要的端口。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd /home/bbs/www/conf</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># vim httpd.conf</span></div></li></ol></pre></td></tr></table></div>

<p>安装PHP</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">7</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># tar xvf php-5.2.6.tar.gz</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd php-5.2.6</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./configure --with-mysql --with-apxs=/home/bbs/www/bin/apxs \\</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">--with-gd --with-png-dir --with-iconv --with-jpeg-dir \\</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">--with-zlib --with-ttf --with-freetype-dir --enable-gd-native-ttf</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># make</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># make install</span></div></li></ol></pre></td></tr></table></div>

<p>编辑apache的配置文件/home/bbs/www/conf/httpd.conf，在里面加入这样一行：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="apache"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #00007f;">AddType</span> application/x-httpd-php .php</div></li></ol></pre></td></tr></table></div>

<p>下载安装KBS<br />
从kbs的svn服务器上下载最新的kbs源代码。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd /home/bbs/src</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># svn co http://svn.kcn.cn/repos/kbs/trunk/kbs_bbs</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># svn co http://svn.kcn.cn/repos/kbs/trunk/www2</span></div></li></ol></pre></td></tr></table></div>

<p>查看bbs用户的gid和uid是多少。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cat /etc/passwd | grep bbs</span></div></li></ol></pre></td></tr></table></div>

<p>到kbs的站点定义目录下，建造一份自己的站点的定义文件，比如站点叫做Yousri。尤其要修改Yousri.h中的BBSUID和BBSGID为刚才看到的bbs用户的编号。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">7</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">8</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">9</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">10</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd /home/bbs/src/kbs_bbs/site</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cp fb2k-v2.h yousri.h</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cp fb2k-v2.c yousri.c</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># vim yousri.h</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">运行autogen.<span style="color: #c20cb9; font-weight: bold;">sh</span>。</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #000000; font-weight: bold;">&lt;</span>pre <span style="color: #007800;">lang=</span><span style="color: #ff0000;">&quot;bash&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd /home/bbs/src/kbs_bbs</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./autogen.sh</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd sshbbsd</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./autogen.sh</span></div></li></ol></pre></td></tr></table></div>

<p>编译安装kbs。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd /home/bbs/src/kbs_bbs</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./configure --prefix=/home/bbs --enable-site=yousri \\</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">--with-php --with-mysql --enable-ssh --enable-ssl \\</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">--with-<span style="color: #007800;">openssl=</span><span style="color: #000000; font-weight: bold;">/</span>usr --with-libesmtp --enable-innbbsd <span style="color: #007800;">CFLAGS=</span><span style="color: #ff0000;">&quot;-O3 -g&quot;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># make</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># make install</span></div></li></ol></pre></td></tr></table></div>

<p>如果是新建的bbs站点，还需要安装默认的站点文件。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># make install-home</span></div></li></ol></pre></td></tr></table></div>

<p>给sshbbsd生成钥匙。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd /home/bbs/etc</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># touch sshd_config</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ssh-keygen -t rsa1 -f ssh_host_key</span></div></li></ol></pre></td></tr></table></div>

<p>从php源码目录复制来一个php的配置文件，并编辑之。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd /usr/local/lib</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cp /home/bbs/src/php-5.2.6/php.ini-dist php.ini</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># vim php.ini</span></div></li></ol></pre></td></tr></table></div>

<p>修改extension_dir一行为：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="php"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">extension_dir <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/usr/local/lib/php/extensions/no-debug-non-zts-20060613/&quot;</span></div></li></ol></pre></td></tr></table></div>

<p>然后加入下面一行：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="php"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">extension<span style="color: #339933;">=</span>libphpbbslib<span style="color: #339933;">.</span>so</div></li></ol></pre></td></tr></table></div>

<p>把www2符号连接到apache的网页目录来。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd /home/bbs/www/</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># mv htdocs htdocs.default</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ln -s ../src/www2 htdocs</span></div></li></ol></pre></td></tr></table></div>

<p>因为之前很多操作需要用root执行，可能bbs的很多文件的owner和group不对，所以一并搞掉。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># chown -R bbs:bbs /home/bbs</span></div></li></ol></pre></td></tr></table></div>

<p>启动BBS:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">7</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd /home/bbs/bin</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./miscd daemon</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./bbslogd</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./bbsd -p 23</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./sshbbsd -p 22</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd ../www/bin</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./apachectl start</span></div></li></ol></pre></td></tr></table></div>

<p>如果要停止bbs的话按如下操作：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">7</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">8</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd /home/bbs/www/bin</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./apachectl stop</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># cd ../../bin</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># killall sshbbsd</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># killall bbsd</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># killall bbslogd</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># ./miscd flush</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># killall miscd</span></div></li></ol></pre></td></tr></table></div>

<p>其中期间遇到过两个比较莫名其妙的小问题<br />
到最后启动bbs的时候 执行</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">root<span style="color: #000000; font-weight: bold;">@</span>yousri:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>bbs<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #666666; font-style: italic;"># ./miscd daemon</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">Bus error</div></li></ol></pre></td></tr></table></div>

<p>这一步的时候出现如此的错误提示<br />
还有就是启动后 telnet 127.0.0.1 进入要注册出现无法注册的现象如注册SYSOP账号却提示<br />
“由于某些系统原因, 无法注册新的帐号.”<br />
然后要再次连接 telnet 127.0.0.1 就无法连接了</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">“root<span style="color: #000000; font-weight: bold;">@</span>yousri:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>bbs<span style="color: #666666; font-style: italic;"># telnet 127.0.0.1</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">  Trying <span style="color: #000000;">127.0</span><span style="color: #000000;">.0</span><span style="color: #000000;">.1</span>...</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">  Connected to <span style="color: #000000;">127.0</span><span style="color: #000000;">.0</span><span style="color: #000000;">.1</span>.</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">  Escape character is <span style="color: #ff0000;">'^]'</span>.</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">  Connection closed by foreign host.”</div></li></ol></pre></td></tr></table></div>

<p>至于执行./miscd daemon报错的问题 后来又重新编译安装了下kbs代码 倒是可行了。。。<br />
对于无法注册账号的  貌似要杀掉有关miscd及bbslogd的进程 然后重新创建才可以 即：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #c20cb9; font-weight: bold;">killall</span> miscd</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #c20cb9; font-weight: bold;">killall</span> bbslogd</div></li></ol></pre></td></tr></table></div>

<p>终于正常了。。。。<br />
其他系统使用待更新。。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://qingxianyan.cn/2009/05/16/%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%ae%e5%9f%ba%e4%ba%8ekbs%e7%a8%8b%e5%ba%8f%e7%9a%84bbs%e7%b3%bb%e7%bb%9f.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>DNS服务器调试工具dig、host、nslookup</title>
		<link>http://qingxianyan.cn/2009/04/20/dns%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%b0%83%e8%af%95%e5%b7%a5%e5%85%b7dig%e3%80%81host%e3%80%81nslookup.html</link>
		<comments>http://qingxianyan.cn/2009/04/20/dns%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%b0%83%e8%af%95%e5%b7%a5%e5%85%b7dig%e3%80%81host%e3%80%81nslookup.html#comments</comments>
		<pubDate>Sun, 19 Apr 2009 16:11:13 +0000</pubDate>
		<dc:creator>yanqingxian.openid.35.com</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[网络管理]]></category>

		<category><![CDATA[dig]]></category>

		<category><![CDATA[DNS]]></category>

		<category><![CDATA[host]]></category>

		<category><![CDATA[nslookup]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=283</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160; 先前曾经简单介绍过在CentOS5.2下搭建实现DNS服务器，可查看这里
&#160;&#160;&#160;&#160;&#160;&#160; 现在就再简单大致记录介绍三款常用于检查测试调试DNS服务器搭建是否成功的工具吧～即Dig、Host、Nslookup，介绍：
&#160;&#160;&#160;&#160;&#160;&#160;
Shell方式可以使用3种工具来查询DNS数据库：nslookup、dig和host，在BIND的软件发布中包括nslookup和dig。
Nslookup是这三个工具中最老的，而且总是随同BIND一起发布;dig是域信息的探索程序，最初由SteveHotz编写，后来
MichaelSawy针对BIND 9将它重新编写，它也和BIND一起发布;host由Eric
Wassenaar编写，是另一个开放源代码的工具，其特点是输出对用户很友好，功能是可检查区文件的语法。另外三者使用的解析器库不同：dig和
host使用BIND的解析器，而nslookup有其自身的解析器。
&#160;&#160;&#160;&#160;&#160;&#160; （1）、Dig命令

Usage:&#160; dig [@global-server] [domain] [q-type] [q-class] {q-opt}     &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {global-d-opt} host [@local-server] {local-d-opt}      &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ host [@local-server] {local-d-opt} [...]]

&#160;&#160;&#160;&#160;&#160;&#160;
以上是关于dig用法参数列表，可以通过man dig 或者 dig &#8211;h &#124; more 查看其命令相应的帮助信息～ 参数可接IP
address或domain name来获得name server所提供的相关讯息，提供不同资料记录型态，例如A、MX&#8230;等等
&#160;&#160;&#160;&#160;&#160; （2）、Host命令

[root@yanqx ~]$ host -h&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; host: illegal option &#8212; h      [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 先前曾经简单介绍过在CentOS5.2下搭建实现DNS服务器，可查看<a href="http://qingxianyan.cn/2009/02/21/centos52%E6%90%AD%E5%BB%BA%E9%85%8D%E7%BD%AEdns%E6%9C%8D%E5%8A%A1.html" target="_blank">这里</a></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 现在就再简单大致记录介绍三款常用于检查测试调试DNS服务器搭建是否成功的工具吧～即Dig、Host、Nslookup，介绍：</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
Shell方式可以使用3种工具来查询DNS数据库：nslookup、dig和host，在BIND的软件发布中包括nslookup和dig。<br />
Nslookup是这三个工具中最老的，而且总是随同BIND一起发布;dig是域信息的探索程序，最初由SteveHotz编写，后来<br />
MichaelSawy针对BIND 9将它重新编写，它也和BIND一起发布;host由Eric<br />
Wassenaar编写，是另一个开放源代码的工具，其特点是输出对用户很友好，功能是可检查区文件的语法。另外三者使用的解析器库不同：dig和<br />
host使用BIND的解析器，而nslookup有其自身的解析器。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; （1）、Dig命令</p>
<blockquote>
<p>Usage:&nbsp; dig [@global-server] [domain] [q-type] [q-class] {q-opt}     <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {global-d-opt} host [@local-server] {local-d-opt}      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ host [@local-server] {local-d-opt} [...]]</p>
</blockquote>
<p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
以上是关于dig用法参数列表，可以通过man dig 或者 dig &ndash;h | more 查看其命令相应的帮助信息～ 参数可接IP<br />
address或domain name来获得name server所提供的相关讯息，提供不同资料记录型态，例如A、MX&hellip;等等</span></p>
<p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; （2）、Host命令</span></p>
<blockquote>
<p>[root@yanqx ~]$ host -h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />host: illegal option &mdash; h      <br />Usage: host [-aCdlriTwv] [-c class] [-N ndots] [-t type] [-W time]      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-R number] hostname [server]      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -a is equivalent to -v -t *      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -c specifies query class for non-IN data      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -C compares SOA records on authoritative nameservers      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -d is equivalent to -v      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -l lists all hosts in a domain, using AXFR      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -i IP6.INT reverse lookups      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -N changes the number of dots allowed before root lookup is done      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -r disables recursive processing      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -R specifies number of retries for UDP packets      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -t specifies the query type      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -T enables TCP/IP mode      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -v enables verbose output      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -w specifies to wait forever for a reply      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -W specifies how long to wait for a reply      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -4 use IPv4 query transport only      <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -6 use IPv6 query transport only</p>
</blockquote>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 默认情况下，只是简单使用host+欲查询域名得到只是简单一些A记录或MX记录等，想了解全部信息需加上 &ndash;a 参数查看 如：</p>
<blockquote>
<p>[root@yanqx ~]$ host qingxianyan.cn     <br />qingxianyan.cn has address 74.220.219.76      <br />qingxianyan.cn mail is handled by 0 qingxianyan.cn.</p>
</blockquote>
<p><span>&nbsp;&nbsp; （3）、Nslookup命令</span></p>
<p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在linux或win下</span>输<br />
入nslookup命令后，会看到 > 提示符号，之后就可输入查询指令。一般会输入IP address或是domain<br />
name来做反向及正向的解析。而nslookup不仅提供上述2种解析，亦像dig提供DNS中其它的资料记录型态，例如A、MX、NS&hellip;等等，可在提<br />
示符号直接输入&rdquo;?&rdquo;来获得所有可以使用的参数或资料型态。</p>
<blockquote>
<p>Commands:&nbsp;&nbsp; (identifiers are shown in uppercase, [] means optional)     <br />NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - print info about the host/domain NAME using default server      <br />NAME1 NAME2&nbsp;&nbsp;&nbsp;&nbsp; - as above, but use NAME2 as server      <br />help or ?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - print info on common commands      <br />set OPTION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - set an option      <br />&nbsp;&nbsp;&nbsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - print options, current server and host      <br />&nbsp;&nbsp;&nbsp; [no]debug&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - print debugging information      <br />&nbsp;&nbsp;&nbsp; [no]d2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - print exhaustive debugging information      <br />&nbsp;&nbsp;&nbsp; [no]defname&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - append domain name to each query      <br />&nbsp;&nbsp;&nbsp; [no]recurse&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - ask for recursive answer to query      <br />&nbsp;&nbsp;&nbsp; [no]search&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - use domain search list      <br />&nbsp;&nbsp;&nbsp; [no]vc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - always use a virtual circuit      <br />&nbsp;&nbsp;&nbsp; domain=NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - set default domain name to NAME      <br />&nbsp;&nbsp;&nbsp; srchlist=N1[/N2/.../N6] - set domain to N1 and search list to N1,N2, etc.      <br />&nbsp;&nbsp;&nbsp; root=NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - set root server to NAME      <br />&nbsp;&nbsp;&nbsp; retry=X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - set number of retries to X      <br />&nbsp;&nbsp;&nbsp; timeout=X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - set initial time-out interval to X seconds      <br />&nbsp;&nbsp;&nbsp; type=X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - set query type (ex. A,ANY,CNAME,MX,NS,PTR,SOA,SRV)      <br />&nbsp;&nbsp;&nbsp; querytype=X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - same as type      <br />&nbsp;&nbsp;&nbsp; class=X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - set query class (ex. IN (Internet), ANY)      <br />&nbsp;&nbsp;&nbsp; [no]msxfr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - use MS fast zone transfer      <br />&nbsp;&nbsp;&nbsp; ixfrver=X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - current version to use in IXFR transfer request      <br />server NAME&nbsp;&nbsp;&nbsp;&nbsp; - set default server to NAME, using current default server      <br />lserver NAME&nbsp;&nbsp;&nbsp; - set default server to NAME, using initial server      <br />finger [USER]&nbsp;&nbsp; - finger the optional NAME at the current default host      <br />root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - set current default server to the root      <br />ls [opt] DOMAIN [> FILE] - list addresses in DOMAIN (optional: output to FILE)      <br />&nbsp;&nbsp;&nbsp; -a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp; list canonical names and aliases      <br />&nbsp;&nbsp;&nbsp; -d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp; list all records      <br />&nbsp;&nbsp;&nbsp; -t TYPE&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp; list records of the given type (e.g. A,CNAME,MX,NS,PTR etc.)      <br />view FILE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - sort an &lsquo;ls&rsquo; output file and view it with pg      <br />exit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - exit the program</p>
</blockquote>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 参考资料：<a title="http://docsrv.sco.com/NET_tcpip/dnsC.nslook.html" href="http://docsrv.sco.com/NET_tcpip/dnsC.nslook.html" target="_blank">http://docsrv.sco.com/NET_tcpip/dnsC.nslook.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://qingxianyan.cn/2009/04/20/dns%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%b0%83%e8%af%95%e5%b7%a5%e5%85%b7dig%e3%80%81host%e3%80%81nslookup.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>加强Apache配置的安全方法</title>
		<link>http://qingxianyan.cn/2009/04/19/%e5%8a%a0%e5%bc%baapache%e9%85%8d%e7%bd%ae%e7%9a%84%e5%ae%89%e5%85%a8%e6%96%b9%e6%b3%95%e3%80%90%e8%bd%ac%e3%80%91.html</link>
		<comments>http://qingxianyan.cn/2009/04/19/%e5%8a%a0%e5%bc%baapache%e9%85%8d%e7%bd%ae%e7%9a%84%e5%ae%89%e5%85%a8%e6%96%b9%e6%b3%95%e3%80%90%e8%bd%ac%e3%80%91.html#comments</comments>
		<pubDate>Sun, 19 Apr 2009 08:36:18 +0000</pubDate>
		<dc:creator>yanqingxian.openid.35.com</dc:creator>
		
		<category><![CDATA[服务配置]]></category>

		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=314</guid>
		<description><![CDATA[一、确保你安装的是最新的补丁
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 如果门是敞开的话，在窗户上加锁就毫无意义。同样道理，如果你没有打补丁，继续下面的操作就没有什么必要。
二、隐藏Apache的版本号及其它敏感信息
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 默认情况下，很多Apache安装时会显示版本号及操作系统版本，甚至会显示服务器上安装的是什么样的Apache模块。这些信息可以为黑客所用，并且黑客还可以从中得知你所配置的服务器上的很多设置都是默认状态。
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 这里有两条语句，你需要添加到你的httpd.conf文件中：

12    ServerSignature Off    ServerTokens Prod

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ServerSignature出现在Apache所产生的像404页面、目录列表等页面的底部。ServerTokens目录被用来判断 Apache会在Server HTTP响应包的头部填充什么信息。如果把ServerTokens设为Prod，那么HTTP响应包头就会被设置成：

1Server：Apache

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 如果你非常想尝试其它事物，你可以通过编辑源代码改成不是Apache的其它东西，或者你可以通过下面将要介绍的mod_security实现。
三、确保Apache以其自身的用户账号和组运行
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 有的Apache安装过程使得服务器以nobody的用户运行，所以，假定Apache和你的邮件服务器都是以nobody的账号运行的，那么通过Apache发起的攻击就可能同时攻击到邮件服务器，反之亦然。

12    User apache    Group apache

四、确保web根目录之外的文件没有提供服务
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 我们不让Apache访问web根目录之外的任何文件。假设你的所以web站点文件都放在一个目录下（例如/web），你可以如下设置：

123456    Order Deny,Allow    Deny from all    Options None    AllowOverride None    Order [...]]]></description>
			<content:encoded><![CDATA[<p>一、确保你安装的是最新的补丁<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果门是敞开的话，在窗户上加锁就毫无意义。同样道理，如果你没有打补丁，继续下面的操作就没有什么必要。<br />
二、隐藏Apache的版本号及其它敏感信息<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 默认情况下，很多Apache安装时会显示版本号及操作系统版本，甚至会显示服务器上安装的是什么样的Apache模块。这些信息可以为黑客所用，并且黑客还可以从中得知你所配置的服务器上的很多设置都是默认状态。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这里有两条语句，你需要添加到你的httpd.conf文件中：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li></ol></pre></td><td class="code"><pre class="apache"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #00007f;">ServerSignature</span> <span style="color: #0000ff;">Off</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #00007f;">ServerTokens</span> Prod</div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServerSignature出现在Apache所产生的像404页面、目录列表等页面的底部。ServerTokens目录被用来判断 Apache会在Server HTTP响应包的头部填充什么信息。如果把ServerTokens设为Prod，那么HTTP响应包头就会被设置成：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="apache"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">Server：Apache</div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果你非常想尝试其它事物，你可以通过编辑源代码改成不是Apache的其它东西，或者你可以通过下面将要介绍的mod_security实现。<br />
三、确保Apache以其自身的用户账号和组运行<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 有的Apache安装过程使得服务器以nobody的用户运行，所以，假定Apache和你的邮件服务器都是以nobody的账号运行的，那么通过Apache发起的攻击就可能同时攻击到邮件服务器，反之亦然。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li></ol></pre></td><td class="code"><pre class="apache"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #00007f;">User</span> apache</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #00007f;">Group</span> apache</div></li></ol></pre></td></tr></table></div>

<p>四、确保web根目录之外的文件没有提供服务<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 我们不让Apache访问web根目录之外的任何文件。假设你的所以web站点文件都放在一个目录下（例如/web），你可以如下设置：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li></ol></pre></td><td class="code"><pre class="apache"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #00007f;">Order</span> <span style="color: #00007f;">Deny</span>,<span style="color: #00007f;">Allow</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #00007f;">Deny</span> <span style="color: #00007f;">from</span> <span style="color: #00007f;">all</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #00007f;">Options</span> <span style="color: #0000ff;">None</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">None</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #00007f;">Order</span> <span style="color: #00007f;">Allow</span>,<span style="color: #00007f;">Deny</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #00007f;">Allow</span> <span style="color: #00007f;">from</span> <span style="color: #00007f;">all</span></div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 注意，因为我们设置Opitins None 和AllowOverride None，这将关闭服务器的所有Option和Override。你现在必须明确把每个目录设置成Option或者Override。<br />
五、关闭目录浏览<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;你可以在Directory标签内用Option命令来实现这个功能。设置Option为None或者－Indexes。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Options -Indexes<br />
六、关闭includes<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这也可以通过在Directory标签内使用Option命令来实现。设置Option为None或者－Includes。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Options -Includes<br />
七、关闭CGI执行程序<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果你不用CGI，那么请把它关闭。在目录标签中把选项设置成None或-ExecCGI就可以：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Options -ExecCGI<br />
八、禁止Apache遵循符号链接<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 同上，把选项设置成None或-FollowSymLinks：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Options -FollowSymLinks<br />
九、关闭多重选项<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果想关闭所有选项，很简单：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Options None<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果只想关系一些独立的选项，则通过将Options做如下设置可实现：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Options -ExecCGI -FollowSymLinks -Indexes<br />
十、关闭对.htaccess文件的支持<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在一个目录标签中实现：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    AllowOverride None<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果需要重载，则保证这些文件不能够被下载，或者把文件名改成非.htaccess文件。比如，我们可以改成.httpdoverride文件，然后像下面这样阻止所有以.ht打头的文件：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    AccessFileName .httpdoverride</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    Order allow,deny</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    Deny from all</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    Satisfy All</div></li></ol></pre></td></tr></table></div>

<p>十一、运行mod_security<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Run mod_security是O’Reilly出版社出版的Apache Security一书的作者，Ivan Ristic所写的一个非常好用的一个Apache模块。可以用它实现以下功能：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·简单过滤<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·基于过滤的常规表达式<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·URL编码验证<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·Unicode编码验证<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·审计<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·空字节攻击防止<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·上载存储限制<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·服务器身份隐藏<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·内置的Chroot支持<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    ·更多其它功能</p>
<p>十二、关闭任何不必要的模块<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Apache通常会安装几个模块，浏览Apache的module documentation，了解已安装的各个模块是做什么用的。很多情况下，你会发现并不需要激活那些模块。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 找到httpd.conf中包含LoadModule的代码。要关闭这些模块，只需要在代码行前添加一个#号。要找到正在运行的模块，可以用以下语句：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #c20cb9; font-weight: bold;">grep</span> LoadModule httpd.conf</div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 以下模块通常被激活而并无大用：mod_imap,mod_include,mod_info,mod_userdir,mod_status,mod_cgi,mod_autoindex。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 网络上学习了解收集到的～当作收藏，这东西实用性因人而异，嗯。</p>
]]></content:encoded>
			<wfw:commentRss>http://qingxianyan.cn/2009/04/19/%e5%8a%a0%e5%bc%baapache%e9%85%8d%e7%bd%ae%e7%9a%84%e5%ae%89%e5%85%a8%e6%96%b9%e6%b3%95%e3%80%90%e8%bd%ac%e3%80%91.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Apache潜在漏洞</title>
		<link>http://qingxianyan.cn/2009/04/12/apache%e6%bd%9c%e5%9c%a8%e6%bc%8f%e6%b4%9e.html</link>
		<comments>http://qingxianyan.cn/2009/04/12/apache%e6%bd%9c%e5%9c%a8%e6%bc%8f%e6%b4%9e.html#comments</comments>
		<pubDate>Sun, 12 Apr 2009 09:04:04 +0000</pubDate>
		<dc:creator>yanqingxian.openid.35.com</dc:creator>
		
		<category><![CDATA[服务配置]]></category>

		<category><![CDATA[Apache]]></category>

		<category><![CDATA[漏洞]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=321</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;很多多论坛网站，都具备有上传附件的的功能，一般都会开放rar附件上传，并可能会保留原来文件名称，这从而可能导致一个很严重的问题，test.php.rar文件可能会被Apache当作php文件来执行，造成一定程度的安全隐患。
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;如何测试? 当你将某个php程序文件后缀名修改成 test.php.rar，这时测试一下，还是按照PHP文件解析执行，Apache并不会认为这是一个rar文件，这是为什么呢？
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;其实，因为每遇到一种后双重后缀名(如test.php.rar)的文件，Apache都会去conf/mime.types文件中检查最后一个后缀，如果最后一个后缀并没有在mime.types文件中定义，则使用前一个后缀来解释，因为在默认情况下,rar并未在mime.types中定义，故 Apache会使用php后缀来解释文件，这就是漏洞的原因所在吧。
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;由此可知,如果使用test.jsp.aaa.rar则会很可能认为是jsp文件，如果修改成test.shtml.rar，则会识别成shtml文件。
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;如果没有相应修改设置，不知道有多少网站可能存在这个问题? 如何杜绝这个隐患 ?
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;修改Apache相应的配置文件httpd.conf文件内容：

123456    AddType application/rar .rar    AddType application/x-compressed .rar    AddType application/x-rar .rar    AddType application/x-rar-compressed .rar    AddType application/x-rar-compressed; application/x-compressed .rar    AddType compressed/rar; application/x-rar-compressed .rar

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;然后重新启动Apache服务
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;针对Web管理员及Web程序开发者，如何更安全
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;1.只允许上传指定后缀名的文件，当然，要禁止掉rar格式文件上传。(但这条往往行不通,一般的网站都需要上传rar文件)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.对上传后的文件名进行强制重命名，强制使用最后一个扩展名，如原始文件名为test.php.rar，上传后强制重命名为20090412.rar即可避免这个隐患
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ps：早期版本的phpcms、discuz等貌似存在这个漏洞
]]></description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;很多多论坛网站，都具备有上传附件的的功能，一般都会开放rar附件上传，并可能会保留原来文件名称，这从而可能导致一个很严重的问题，test.php.rar文件可能会被Apache当作php文件来执行，造成一定程度的安全隐患。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如何测试? 当你将某个php程序文件后缀名修改成 test.php.rar，这时测试一下，还是按照PHP文件解析执行，Apache并不会认为这是一个rar文件，这是为什么呢？<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其实，因为每遇到一种后双重后缀名(如test.php.rar)的文件，Apache都会去conf/mime.types文件中检查最后一个后缀，如果最后一个后缀并没有在mime.types文件中定义，则使用前一个后缀来解释，因为在默认情况下,rar并未在mime.types中定义，故 Apache会使用php后缀来解释文件，这就是漏洞的原因所在吧。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;由此可知,如果使用test.jsp.aaa.rar则会很可能认为是jsp文件，如果修改成test.shtml.rar，则会识别成shtml文件。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果没有相应修改设置，不知道有多少网站可能存在这个问题? 如何杜绝这个隐患 ?<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;修改Apache相应的配置文件httpd.conf文件内容：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    AddType application<span style="color: #000000; font-weight: bold;">/</span>rar .rar</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    AddType application<span style="color: #000000; font-weight: bold;">/</span>x-compressed .rar</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    AddType application<span style="color: #000000; font-weight: bold;">/</span>x-rar .rar</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    AddType application<span style="color: #000000; font-weight: bold;">/</span>x-rar-compressed .rar</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    AddType application<span style="color: #000000; font-weight: bold;">/</span>x-rar-compressed; application<span style="color: #000000; font-weight: bold;">/</span>x-compressed .rar</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    AddType compressed<span style="color: #000000; font-weight: bold;">/</span>rar; application<span style="color: #000000; font-weight: bold;">/</span>x-rar-compressed .rar</div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;然后重新启动Apache服务<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;针对Web管理员及Web程序开发者，如何更安全<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.只允许上传指定后缀名的文件，当然，要禁止掉rar格式文件上传。(但这条往往行不通,一般的网站都需要上传rar文件)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.对上传后的文件名进行强制重命名，强制使用最后一个扩展名，如原始文件名为test.php.rar，上传后强制重命名为20090412.rar即可避免这个隐患<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ps：早期版本的phpcms、discuz等貌似存在这个漏洞</p>
]]></content:encoded>
			<wfw:commentRss>http://qingxianyan.cn/2009/04/12/apache%e6%bd%9c%e5%9c%a8%e6%bc%8f%e6%b4%9e.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>查看硬件信息工具lshw及查找打开的文件工具lsof</title>
		<link>http://qingxianyan.cn/2009/03/26/%e6%9f%a5%e7%9c%8b%e7%a1%ac%e4%bb%b6%e4%bf%a1%e6%81%af%e5%b7%a5%e5%85%b7lshw%e5%8f%8a%e6%9f%a5%e6%89%be%e6%89%93%e5%bc%80%e7%9a%84%e6%96%87%e4%bb%b6%e5%b7%a5%e5%85%b7lsof.html</link>
		<comments>http://qingxianyan.cn/2009/03/26/%e6%9f%a5%e7%9c%8b%e7%a1%ac%e4%bb%b6%e4%bf%a1%e6%81%af%e5%b7%a5%e5%85%b7lshw%e5%8f%8a%e6%9f%a5%e6%89%be%e6%89%93%e5%bc%80%e7%9a%84%e6%96%87%e4%bb%b6%e5%b7%a5%e5%85%b7lsof.html#comments</comments>
		<pubDate>Thu, 26 Mar 2009 09:12:33 +0000</pubDate>
		<dc:creator>yanqingxian.openid.35.com</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[脚本编程]]></category>

		<category><![CDATA[lsof]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=323</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;介绍推荐两款命令系统工具：硬件配置信息查看工具lshw及查看打开的文件和套接字工具lsof
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;lshw硬件查看工具，它全称叫:HardWare LiSter，实现的原理应该可以说是获取使用/proc里面读取到的数据来显示相关的信息
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;下载地址：http://ezix.org/software/files/lshw-B.02.14.tar.gz
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;解压安装：tar -zxvf lshw-B.02.14.tar.gz &#038;&#038; make &#038;&#038; make install 即可
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;可以先了解查看解压后目录下的README文件信息：

1234567891011121314151617181920212223242526272829303132    1 lshw: HardWare LiSter for Linux    2 ===============================    4 lshw is a small tool to provide detailed information on the hardware confi-    5 guration of the machine. It can report exact memory configuration, [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;介绍推荐两款命令系统工具：硬件配置信息查看工具lshw及查看打开的文件和套接字工具lsof<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lshw硬件查看工具，它全称叫:HardWare LiSter，实现的原理应该可以说是获取使用/proc里面读取到的数据来显示相关的信息<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下载地址：http://ezix.org/software/files/lshw-B.02.14.tar.gz<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;解压安装：tar -zxvf lshw-B.02.14.tar.gz &#038;& make &#038;& make install 即可<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可以先了解查看解压后目录下的README文件信息：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">7</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">8</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">9</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">10</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">11</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">12</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">13</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">14</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">15</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">16</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">17</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">18</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">19</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">20</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">21</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">22</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">23</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">24</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">25</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">26</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">27</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">28</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">29</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">30</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">31</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">32</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">1</span> lshw: HardWare LiSter <span style="color: #000000; font-weight: bold;">for</span> Linux</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">2</span> ===============================</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">4</span> lshw is a small tool to provide detailed information on the hardware confi-</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">5</span> guration of the machine. It can report exact memory configuration, firmware</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">6</span> version, mainboard configuration, CPU version and speed, cache configuration,</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">7</span> bus speed, etc. on DMI-capable x86 or EFI <span style="color: #7a0874; font-weight: bold;">&#40;</span>IA<span style="color: #000000;">-64</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> systems and on some PowerPC</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">8</span> machines <span style="color: #7a0874; font-weight: bold;">&#40;</span>PowerMac G4 is known to work<span style="color: #7a0874; font-weight: bold;">&#41;</span>.</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">10</span> Information can be output <span style="color: #000000; font-weight: bold;">in</span> plain text, XML or HTML.</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">12</span> It currently supports DMI <span style="color: #7a0874; font-weight: bold;">&#40;</span>x86 and EFI only<span style="color: #7a0874; font-weight: bold;">&#41;</span>, OpenFirmware device tree</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">13</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>PowerPC only<span style="color: #7a0874; font-weight: bold;">&#41;</span>, PCI<span style="color: #000000; font-weight: bold;">/</span>AGP, ISA PnP <span style="color: #7a0874; font-weight: bold;">&#40;</span>x86<span style="color: #7a0874; font-weight: bold;">&#41;</span>, CPUID <span style="color: #7a0874; font-weight: bold;">&#40;</span>x86<span style="color: #7a0874; font-weight: bold;">&#41;</span>, IDE<span style="color: #000000; font-weight: bold;">/</span>ATA<span style="color: #000000; font-weight: bold;">/</span>ATAPI, PCMCIA</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">14</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>only tested on x86<span style="color: #7a0874; font-weight: bold;">&#41;</span>, USB and SCSI.</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">16</span>  <span style="color: #000000; font-weight: bold;">*</span> Requirements</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">17</span>     . Linux <span style="color: #000000;">2.4</span>.x or <span style="color: #000000;">2.6</span>.x <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2.2</span>.x might work, though<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">18</span>     . a PA-RISC, Alpha, IA<span style="color: #000000;">-64</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>Itanium<span style="color: #7a0874; font-weight: bold;">&#41;</span>, PowerPC or x86 based machine</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">19</span>     . an ANSI <span style="color: #7a0874; font-weight: bold;">&#40;</span>or close enough to ANSI compliance<span style="color: #7a0874; font-weight: bold;">&#41;</span> C++ compiler</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">20</span>     <span style="color: #7a0874; font-weight: bold;">&#40;</span>tested with <span style="color: #c20cb9; font-weight: bold;">g++</span> <span style="color: #000000;">2.95</span><span style="color: #000000;">.4</span> and <span style="color: #000000;">3.2</span><span style="color: #000000;">.2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">21</span>     . <span style="color: #000000; font-weight: bold;">for</span> the <span style="color: #7a0874; font-weight: bold;">&#40;</span>optional<span style="color: #7a0874; font-weight: bold;">&#41;</span> GTK+ graphical user interface, you will need a</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">22</span>     <span style="color: #7a0874; font-weight: bold;">complete</span> GTK+ <span style="color: #000000;">2.4</span> development environment <span style="color: #7a0874; font-weight: bold;">&#40;</span>gtk2-devel on RedHat<span style="color: #000000; font-weight: bold;">/</span>Fedora</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">23</span>     derivatives<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">25</span>  <span style="color: #000000; font-weight: bold;">*</span> To compile it, just use:</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">27</span>     $ <span style="color: #c20cb9; font-weight: bold;">make</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">29</span>  <span style="color: #000000; font-weight: bold;">*</span> If you want to build the optional GUI, <span style="color: #000000; font-weight: bold;">do</span>:</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">31</span>     $ <span style="color: #c20cb9; font-weight: bold;">make</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">32</span>     $ <span style="color: #c20cb9; font-weight: bold;">make</span> gui</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">34</span>  <span style="color: #000000; font-weight: bold;">*</span> the lshw home page is http:<span style="color: #000000; font-weight: bold;">//</span>lshw.org<span style="color: #000000; font-weight: bold;">/</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">35</span>  <span style="color: #000000; font-weight: bold;">*</span> send bug reports, requests <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">help</span>, feature requests, comments, etc. to</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">36</span>    bugs<span style="color: #000000; font-weight: bold;">@</span>ezix.org.  The author can be contacted directly <span style="color: #7a0874; font-weight: bold;">&#40;</span>lyonel<span style="color: #000000; font-weight: bold;">@</span>ezix.org<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">37</span>    Please <span style="color: #c20cb9; font-weight: bold;">make</span> sure you include enough information <span style="color: #000000; font-weight: bold;">in</span> your bug report:</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    XML  <span style="color: #000000;">38</span>    output from lshw is preferred over text or HTML, indicate the affected</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #000000;">39</span>    version of lshw, your platform <span style="color: #7a0874; font-weight: bold;">&#40;</span>i386, x86<span style="color: #000000;">-64</span>, PA-RISC, PowerPC, etc.<span style="color: #7a0874; font-weight: bold;">&#41;</span> and <span style="color: #000000;">40</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    your distribution.</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    and so on。。。</div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可以使用html格式输出这些信息  通过web浏览查看  如：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #666666; font-style: italic;">#lshw -html &gt;/var/www/pcinfo.html</span></div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;然后网页 http://yourdomain/pcinfo.html 查看<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;还有更多的相关lshw参数可以使用 也支持图形界面的查看，详见</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #666666; font-style: italic;">#lshw –X    //图形界面</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #666666; font-style: italic;">#man lshw   // 查看lshw工具更多参数用法</span></div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lsof轻松查看正在运行的进程可打开哪些文、目录及套接字等信息，了解应用程序打开了哪些文件或者哪个应用程序打开了特定的文件，进而了解更多关于系统的信息。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;快速查出哪个进程在使用某个特定目录（如：/root/install) ，此有助于umount（卸载）或rm（删除）某些文件系统或目录前进行确认，可尝试使用lsof工具：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>yanqx ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># lsof /root/install/</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    COMMAND   PID USER   FD   TYPE DEVICE SIZE      NODE NAME</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    bash    <span style="color: #000000;">18041</span> root  cwd    DIR   <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span> <span style="color: #000000;">4096</span> <span style="color: #000000;">188088470</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">install</span><span style="color: #000000; font-weight: bold;">/</span></div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可见得，显然是root进入到了/root/install目录中。。。。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;同样，lsof也可列举出与特地进程相关联到的文件、目录、库等等信息，如要显示与指定PI进程相关联的文件可使用-p选项：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">7</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">8</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">9</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">10</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">11</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">12</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">13</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">14</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">15</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">16</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">17</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">18</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">19</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">20</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">21</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">22</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>yanqx ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># lsof -p 9554</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    COMMAND  PID USER   FD   TYPE   DEVICE    SIZE      NODE NAME</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  cwd    DIR     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>    <span style="color: #000000;">4096</span> <span style="color: #000000;">187957388</span> <span style="color: #000000; font-weight: bold;">/</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  rtd    DIR     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>    <span style="color: #000000;">4096</span> <span style="color: #000000;">187957388</span> <span style="color: #000000; font-weight: bold;">/</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  txt    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>  <span style="color: #000000;">409560</span> <span style="color: #000000;">187988270</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>sshd</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>  <span style="color: #000000;">132304</span> <span style="color: #000000;">187973604</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">ld</span><span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">44472</span> <span style="color: #000000;">187973606</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libpam.so<span style="color: #000000;">.0</span><span style="color: #000000;">.81</span><span style="color: #000000;">.5</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">20424</span> <span style="color: #000000;">187973386</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libdl<span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span> <span style="color: #000000;">1750504</span> <span style="color: #000000;">190255826</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libcrypto.so<span style="color: #000000;">.0</span><span style="color: #000000;">.9</span><span style="color: #000000;">.8</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">15280</span> <span style="color: #000000;">187973406</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libutil<span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">83344</span> <span style="color: #000000;">187959026</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libz.so<span style="color: #000000;">.1</span><span style="color: #000000;">.2</span><span style="color: #000000;">.3</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>  <span style="color: #000000;">111480</span> <span style="color: #000000;">187973548</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libnsl<span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">45728</span> <span style="color: #000000;">187973602</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libcrypt<span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">89800</span> <span style="color: #000000;">187972006</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libresolv<span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span> <span style="color: #000000;">1698672</span> <span style="color: #000000;">187973486</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libc<span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">84400</span> <span style="color: #000000;">187973582</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libaudit.so<span style="color: #000000;">.0</span><span style="color: #000000;">.0</span><span style="color: #000000;">.0</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root  mem    REG     <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">53880</span> <span style="color: #000000;">187973574</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libnss_files<span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root    0u   CHR      <span style="color: #000000;">1</span>,<span style="color: #000000;">3</span>          <span style="color: #000000;">12392555</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root    1u   CHR      <span style="color: #000000;">1</span>,<span style="color: #000000;">3</span>          <span style="color: #000000;">12392555</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root    2u   CHR      <span style="color: #000000;">1</span>,<span style="color: #000000;">3</span>          <span style="color: #000000;">12392555</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root    3u  IPv6 <span style="color: #000000;">12393000</span>               TCP <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>LISTEN<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    sshd    <span style="color: #000000;">9554</span> root    4u  IPv4 <span style="color: #000000;">12393002</span>               TCP <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>LISTEN<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;或也可以通过使用-c参数选项，来通过进程名称来指定的进程查看：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">7</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">8</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">9</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">10</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">11</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">12</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>yanqx ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># lsof -c init</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    COMMAND PID USER   FD   TYPE DEVICE    SIZE      NODE NAME</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    init      <span style="color: #000000;">1</span> root  cwd    DIR   <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>    <span style="color: #000000;">4096</span> <span style="color: #000000;">187957388</span> <span style="color: #000000; font-weight: bold;">/</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    init      <span style="color: #000000;">1</span> root  rtd    DIR   <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>    <span style="color: #000000;">4096</span> <span style="color: #000000;">187957388</span> <span style="color: #000000; font-weight: bold;">/</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    init      <span style="color: #000000;">1</span> root  txt    REG   <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">40968</span> <span style="color: #000000;">187988546</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>init</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    init      <span style="color: #000000;">1</span> root  mem    REG   <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>          <span style="color: #000000;">96280139</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>init <span style="color: #7a0874; font-weight: bold;">&#40;</span>path <span style="color: #007800;">inode=</span><span style="color: #000000;">187988546</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    init      <span style="color: #000000;">1</span> root  mem    REG   <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>  <span style="color: #000000;">132304</span> <span style="color: #000000;">187973604</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">ld</span><span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    init      <span style="color: #000000;">1</span> root  mem    REG   <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>  <span style="color: #000000;">245264</span> <span style="color: #000000;">187973608</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libsepol.so<span style="color: #000000;">.1</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    init      <span style="color: #000000;">1</span> root  mem    REG   <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">92960</span> <span style="color: #000000;">187973474</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libselinux.so<span style="color: #000000;">.1</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    init      <span style="color: #000000;">1</span> root  mem    REG   <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span> <span style="color: #000000;">1698672</span> <span style="color: #000000;">187973486</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libc<span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    init      <span style="color: #000000;">1</span> root  mem    REG   <span style="color: #000000;">0</span>,<span style="color: #000000;">29</span>   <span style="color: #000000;">20424</span> <span style="color: #000000;">187973386</span> <span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libdl<span style="color: #000000;">-2.5</span>.so</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    init      <span style="color: #000000;">1</span> root   10u  FIFO   <span style="color: #000000;">0</span>,<span style="color: #000000;">48</span>          <span style="color: #000000;">12392766</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>initctl</div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;关于lsof这工具还可以通过相当多的不同参数进行实现不同功能  这里就不一一列举。。可自己查看工具命令帮助文档了解 嗯<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;对此两工具就简单介绍分享推荐到此////</p>
]]></content:encoded>
			<wfw:commentRss>http://qingxianyan.cn/2009/03/26/%e6%9f%a5%e7%9c%8b%e7%a1%ac%e4%bb%b6%e4%bf%a1%e6%81%af%e5%b7%a5%e5%85%b7lshw%e5%8f%8a%e6%9f%a5%e6%89%be%e6%89%93%e5%bc%80%e7%9a%84%e6%96%87%e4%bb%b6%e5%b7%a5%e5%85%b7lsof.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>删除Ubuntu的NetworkManager网络管理并手动设置静态IP</title>
		<link>http://qingxianyan.cn/2009/03/19/%e5%88%a0%e9%99%a4ubuntu%e7%9a%84networkmanager%e7%bd%91%e7%bb%9c%e7%ae%a1%e7%90%86%e5%b9%b6%e6%89%8b%e5%8a%a8%e8%ae%be%e7%bd%ae%e9%9d%99%e6%80%81ip.html</link>
		<comments>http://qingxianyan.cn/2009/03/19/%e5%88%a0%e9%99%a4ubuntu%e7%9a%84networkmanager%e7%bd%91%e7%bb%9c%e7%ae%a1%e7%90%86%e5%b9%b6%e6%89%8b%e5%8a%a8%e8%ae%be%e7%bd%ae%e9%9d%99%e6%80%81ip.html#comments</comments>
		<pubDate>Thu, 19 Mar 2009 08:27:52 +0000</pubDate>
		<dc:creator>yanqingxian.openid.35.com</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[网络管理]]></category>

		<category><![CDATA[network manager]]></category>

		<category><![CDATA[网络配置]]></category>

		<guid isPermaLink="false">http://qingxianyan.cn/?p=312</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Ubuntu操作系统安装完成后网络管理默认是用DHCP自动获取IP地址的，之前在自己住宿就一两台机使用反正也没啥差就懒得改为静态固定IP，但是最近在公司使用vm虚拟机下安装了台Ubuntu8.10玩一玩，有时基本使用SecureCRT软件SSH远程登陆使用，但是由于公司使用都是内部动态 IP地址，而且机器较多所以导致IP地址经常性更换，有点烦所以自己决定试图修改成使用静态IP，可是那个可恶的NetworkManager总是在重启后又变成默认的DHCP自动获取IP。。。故决定删除彻底NetworkManager

12    sudo apt-get –purge remove network-manager    sudo apt-get –purge remove network-manager-gnome

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;手动设置静态IP地址：编辑修改网络接口配置文件/etc/network/interfaces

123456789    sudo vim /etc/network/interfaces    auto lo    iface lo inet loopback    auto eth0    iface eth0 inet static        [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ubuntu操作系统安装完成后网络管理默认是用DHCP自动获取IP地址的，之前在自己住宿就一两台机使用反正也没啥差就懒得改为静态固定IP，但是最近在公司使用vm虚拟机下安装了台Ubuntu8.10玩一玩，有时基本使用SecureCRT软件SSH远程登陆使用，但是由于公司使用都是内部动态 IP地址，而且机器较多所以导致IP地址经常性更换，有点烦所以自己决定试图修改成使用静态IP，可是那个可恶的NetworkManager总是在重启后又变成默认的DHCP自动获取IP。。。故决定删除彻底NetworkManager</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-get –purge remove network-manager</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-get –purge remove network-manager-gnome</div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手动设置静态IP地址：编辑修改网络接口配置文件/etc/network/interfaces</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">5</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">6</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">7</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">8</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">9</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #c20cb9; font-weight: bold;">sudo</span> vim <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>network<span style="color: #000000; font-weight: bold;">/</span>interfaces</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    auto lo</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    iface lo inet loopback</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    auto eth0</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    iface eth0 inet static</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">            address <span style="color: #000000;">172.17</span><span style="color: #000000;">.4</span><span style="color: #000000;">.170</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">            netmask <span style="color: #000000;">255.255</span><span style="color: #000000;">.255</span><span style="color: #000000;">.0</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">            network  <span style="color: #000000;">172.17</span><span style="color: #000000;">.4</span><span style="color: #000000;">.1</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">            gateway <span style="color: #000000;">172.17</span><span style="color: #000000;">.4</span><span style="color: #000000;">.3</span></div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;修改设置DNS服务器配置文件/etc/resolv.conf</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">2</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">3</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">4</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    <span style="color: #c20cb9; font-weight: bold;">sudo</span> vim <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf</div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    nameserver <span style="color: #000000;">202.101</span><span style="color: #000000;">.103</span><span style="color: #000000;">.54</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    nameserver <span style="color: #000000;">202.101</span><span style="color: #000000;">.103</span><span style="color: #000000;">.55</span></div></li><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;">    nameserver <span style="color: #000000;">172.17</span><span style="color: #000000;">.4</span><span style="color: #000000;">.1</span></div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最后重启网络服务</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>networking restart</div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这样上网基本就没什么问题啦///   如果你之前没有删除NetworkManager网络管理的话，重启后/etc/resolv.conf里面的配置文件又会被修改为</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal; font-style: normal;">1</div></li></ol></pre></td><td class="code"><pre class="bash"><ol><li style="font-weight: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal; font-style: normal;"><span style="color: #666666; font-style: italic;"># Generated by NetworkManager</span></div></li></ol></pre></td></tr></table></div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;导致又是使用DHCP动态分配IP地址的。</p>
]]></content:encoded>
			<wfw:commentRss>http://qingxianyan.cn/2009/03/19/%e5%88%a0%e9%99%a4ubuntu%e7%9a%84networkmanager%e7%bd%91%e7%bb%9c%e7%ae%a1%e7%90%86%e5%b9%b6%e6%89%8b%e5%8a%a8%e8%ae%be%e7%bd%ae%e9%9d%99%e6%80%81ip.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
