<?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>一个程序猿 &#187; linux</title>
	<atom:link href="http://www.sunboyu.cn/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sunboyu.cn</link>
	<description>时光不会倒流,脚步总要前进</description>
	<pubDate>Tue, 31 Jan 2012 10:50:34 +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>使用awstats对nginx的日志进行分析</title>
		<link>http://www.sunboyu.cn/2010/12/10/%e4%bd%bf%e7%94%a8awstats%e5%af%b9nginx%e7%9a%84%e6%97%a5%e5%bf%97%e8%bf%9b%e8%a1%8c%e5%88%86%e6%9e%90.shtml</link>
		<comments>http://www.sunboyu.cn/2010/12/10/%e4%bd%bf%e7%94%a8awstats%e5%af%b9nginx%e7%9a%84%e6%97%a5%e5%bf%97%e8%bf%9b%e8%a1%8c%e5%88%86%e6%9e%90.shtml#comments</comments>
		<pubDate>Fri, 10 Dec 2010 08:13:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

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

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

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1326</guid>
		<description><![CDATA[抛弃apache很长时间了，一直在用nginx，基于第三方的统计系统很多，故很久没有分析过web服务器的日志。最近日志突然暴增，从站长统计无法看出具体暴增的原因，故配置awstats进行分析。
awstats在nginx上运行，这个配置我没做过，所以，我依然使用apache作为awstats的服务器使用。只不过换一个端口而已。
apache配置：安装请看之前的日志，配置文件增加一行配置，具体为
&#60;directory &#34;/opt/httpd-2.2.9/cgi-bin&#34;&#62;
&#160;&#160; &#160;AddHandler cgi-script .pl .cgi&#160; #这行即可
&#160;&#160; &#160;AllowOverride None
&#160;&#160; &#160;Options None
&#160;&#160; &#160;Order allow,deny
&#160;&#160; &#160;Allow from all
&#60;/directory&#62;
配置好，基本就可以启动了。注意端口号，别跟nginx重复了。
下载awstats：http://downloads.sourceforge.net/project/awstats/AWStats/7.0/awstats-7.0.tar.gz?r=http%3A%2F%2Fawstats.sourceforge.net%2F&#038;ts=1291968393&#038;use_mirror=cdnetworks-kr-1
解压后，找到 cgi-bin classes css icon js 这几个文件夹。其中cgi-bin里的文件放到apache的 cgi-bin目录下，其他放到apache的网站根目录。
然后访问 hostname:8080/cgi-bin/awstats.pl 看是不是有结果。
配置站点：
复制 cgi-bin目录下 awstats.model.conf 文件 为 awstats.hostname.conf
修改如下几个关键点
LogFile=&#34;/home/www/log/www.google.com.log&#34; #nginx的日志
SiteDomain=&#34;www.google.com&#34;
HostAliases=&#34;localhost google.com 127.0.0.1 REGEX[myserver\.com$]&#34;
配置完这些， 基本就可以使用了。
另外，还要生成报表：命令为
/opt/httpd-2.2.9/cgi-bin/awstats.pl -update -config=hostname                为了方便，可以加到crontab里。到这里就配置完了。
]]></description>
			<content:encoded><![CDATA[<p>抛弃apache很长时间了，一直在用nginx，基于第三方的统计系统很多，故很久没有分析过web服务器的日志。最近日志突然暴增，从站长统计无法看出具体暴增的原因，故配置awstats进行分析。</p>
<p>awstats在nginx上运行，这个配置我没做过，所以，我依然使用apache作为awstats的服务器使用。只不过换一个端口而已。</p>
<p>apache配置：安装请看之前的日志，配置文件增加一行配置，具体为</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt;directory &quot;/opt/httpd-2.2.9/cgi-bin&quot;&gt;</li>
<li>&nbsp;&nbsp; &nbsp;AddHandler cgi-script .pl .cgi&nbsp; #这行即可</li>
<li>&nbsp;&nbsp; &nbsp;AllowOverride None</li>
<li>&nbsp;&nbsp; &nbsp;Options None</li>
<li>&nbsp;&nbsp; &nbsp;Order allow,deny</li>
<li>&nbsp;&nbsp; &nbsp;Allow from all</li>
<li>&lt;/directory&gt;</li></ol></div>
<p>配置好，基本就可以启动了。注意端口号，别跟nginx重复了。</p>
<p>下载awstats：http://downloads.sourceforge.net/project/awstats/AWStats/7.0/awstats-7.0.tar.gz?r=http%3A%2F%2Fawstats.sourceforge.net%2F&#038;ts=1291968393&#038;use_mirror=cdnetworks-kr-1</p>
<p>解压后，找到 cgi-bin classes css icon js 这几个文件夹。其中cgi-bin里的文件放到apache的 cgi-bin目录下，其他放到apache的网站根目录。</p>
<p>然后访问 hostname:8080/cgi-bin/awstats.pl 看是不是有结果。</p>
<p>配置站点：</p>
<p>复制 cgi-bin目录下 awstats.model.conf 文件 为 awstats.hostname.conf</p>
<p>修改如下几个关键点</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">LogFile=&quot;/home/www/log/www.google.com.log&quot; #nginx的日志</li>
<li>SiteDomain=&quot;www.google.com&quot;</li>
<li>HostAliases=&quot;localhost google.com 127.0.0.1 REGEX[myserver\.com$]&quot;</li></ol></div>
<p>配置完这些， 基本就可以使用了。</p>
<p>另外，还要生成报表：命令为</p>
<p>/opt/httpd-2.2.9/cgi-bin/awstats.pl -update -config=hostname                为了方便，可以加到crontab里。到这里就配置完了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2010/12/10/%e4%bd%bf%e7%94%a8awstats%e5%af%b9nginx%e7%9a%84%e6%97%a5%e5%bf%97%e8%bf%9b%e8%a1%8c%e5%88%86%e6%9e%90.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>Linux配置几个关键点需要注意</title>
		<link>http://www.sunboyu.cn/2009/07/15/linux%e9%85%8d%e7%bd%ae%e5%87%a0%e4%b8%aa%e5%85%b3%e9%94%ae%e7%82%b9%e9%9c%80%e8%a6%81%e6%b3%a8%e6%84%8f.shtml</link>
		<comments>http://www.sunboyu.cn/2009/07/15/linux%e9%85%8d%e7%bd%ae%e5%87%a0%e4%b8%aa%e5%85%b3%e9%94%ae%e7%82%b9%e9%9c%80%e8%a6%81%e6%b3%a8%e6%84%8f.shtml#comments</comments>
		<pubDate>Tue, 14 Jul 2009 20:30:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

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

		<category><![CDATA[机房]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=856</guid>
		<description><![CDATA[前两天机房断电，弄得兄弟我太郁闷。机房网管居然直接硬关机，这么来回弄了两三次，问技术，不是那一拨，问销售，没啥解释，人家说不知道……
一分钱一分货有道理，结果我机器挂了，机房那边说linux启动，中间卡死了。因为那个机房没有懂linux的网管，所以，我开车（捷安特）去了机房。
后发现，其实没什么问题，卡在了一个依赖python的启动进程上，另外mysql貌似也没有启动。
我用ubuntu live版的cd进入系统（有点像win下的PE的思路），修改了python设置：
原来python默认是2.3版本，我升级到了2.5，默认关联的是2.5版的，但这样会有一些问题，比如yum对版本依赖性很强，修改后则其不工作，所以我修改了yum的配置，让其寻找2.3版本。而另一下对python有依赖的模块我却没有发现，造成down机后无法启动。
mysql无法自启动，没找出是哪的问题，不过，我在ubuntu下加载了原来的分区，修改了rc.local配置,灭了mysql，系统顺利启动。
总结：ubuntu live cd的作用跟我修理xp时候的pe功能相似，系统挂掉的时候修改个配置啥的还是很好用的。
除非很了解软件之间的依赖性，否则不要随意修改那些配置，否则会造成依赖性问题。
事发现场图片

]]></description>
			<content:encoded><![CDATA[<p>前两天机房断电，弄得兄弟我太郁闷。机房网管居然直接硬关机，这么来回弄了两三次，问技术，不是那一拨，问销售，没啥解释，人家说不知道……</p>
<p>一分钱一分货有道理，结果我机器挂了，机房那边说linux启动，中间卡死了。因为那个机房没有懂linux的网管，所以，我开车（捷安特）去了机房。</p>
<p>后发现，其实没什么问题，卡在了一个依赖python的启动进程上，另外mysql貌似也没有启动。</p>
<p>我用ubuntu live版的cd进入系统（有点像win下的PE的思路），修改了python设置：</p>
<p>原来python默认是2.3版本，我升级到了2.5，默认关联的是2.5版的，但这样会有一些问题，比如yum对版本依赖性很强，修改后则其不工作，所以我修改了yum的配置，让其寻找2.3版本。而另一下对python有依赖的模块我却没有发现，造成down机后无法启动。</p>
<p>mysql无法自启动，没找出是哪的问题，不过，我在ubuntu下加载了原来的分区，修改了rc.local配置,灭了mysql，系统顺利启动。</p>
<p>总结：ubuntu live cd的作用跟我修理xp时候的pe功能相似，系统挂掉的时候修改个配置啥的还是很好用的。</p>
<p>除非很了解软件之间的依赖性，否则不要随意修改那些配置，否则会造成依赖性问题。</p>
<p>事发现场图片</p>
<p><a href="http://www.sunboyu.cn/upfiles/2009/07/server-mysql.jpg"><img class="aligncenter size-full wp-image-872" title="server-mysql" src="http://www.sunboyu.cn/upfiles/2009/07/server-mysql.jpg" alt="server-mysql" width="800" height="591" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/07/15/linux%e9%85%8d%e7%bd%ae%e5%87%a0%e4%b8%aa%e5%85%b3%e9%94%ae%e7%82%b9%e9%9c%80%e8%a6%81%e6%b3%a8%e6%84%8f.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>Centos4.7（Linux）下架设BT服务器</title>
		<link>http://www.sunboyu.cn/2009/06/09/centos47%ef%bc%88linux%ef%bc%89%e4%b8%8b%e6%9e%b6%e8%ae%bebt%e6%9c%8d%e5%8a%a1%e5%99%a8.shtml</link>
		<comments>http://www.sunboyu.cn/2009/06/09/centos47%ef%bc%88linux%ef%bc%89%e4%b8%8b%e6%9e%b6%e8%ae%bebt%e6%9c%8d%e5%8a%a1%e5%99%a8.shtml#comments</comments>
		<pubDate>Tue, 09 Jun 2009 05:21:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

		<category><![CDATA[原创技术]]></category>

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

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

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

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=768</guid>
		<description><![CDATA[穷人，就得想穷人的办法，带宽被坑，严重缩水，为了分享大量资源，最终决定使用bt发布一些大资源。
网上找了很多BitTorrent架设btserver的教程，不是版本不对，就是安装复杂，所以，我找了个比较老的版本，一次装上调通。
我使用了BitTorrent-3.9.1，官方下载地址为 http://download.bittorrent.com/dl/archive/BitTorrent-3.9.1.tar.gz
防止墙，我传到本地 bittorrent-3.9.1.tar.gz
首先你服务器要预装python，centos4.7预装python2.3，我预留，但服务器环境python使用了2.5版，2.3不能删，yum对版本依赖性比较强，还得预留。
解压 BitTorrent-3.9.1.tar.gz 后进入文件夹，按照说明进行安装：
python setup.py install
即可安装。当然中间会遇到各种问题，大部分是关于python版本或者依赖的，错误可以跟帖发一下，一起解决。
好了，首先启动服务器：
python bttrack.py --port 6969 --dfile dfile.log
其中port参数是服务的端口（一定记得调一下防火墙），dfile是日志
然后打开 http://ip:6969/  如果显示
BitTorrent download info
    * tracker version: 3.9.1
    * server time: 2009-06-09 05:12 UTC
则证明服务启动成功。
下面创建一个种子文件
btmaketorrent.py http://bt.sunboyu.cn:6969/announce /root/soft/xmlrpc-epi-0.54.tar.gz
这样，就针对 /root/soft/xmlrpc-epi-0.54.tar.gz 文件创建了一个种子文件，使用的track地址是 http://bt.sunboyu.cn:6969
生成的种子位置，是这样:如果针对一个文件，则在文件同一文件夹下，如果针对文件夹，则在文件夹同级目录。
然后发布一个种子（很多人可能对种子这个概念不了解，可以查看资料，关于bt协议的）
btdownloadheadless.py /root/soft/xmlrpc-epi-0.54.tar.gz.torrent --save_as /root/soft/xmlrpc-epi-0.54.tar.gz
发布种子有很多参数要限制，可以看命令具体参数，比如占用的端口跟限速等。
我测试了一下，linux发布的文件，就可以下载了。这只是服务器建立的阶段，要管理，还得写好多管理脚本，否则文件多的话，手工可受不了。
另外还有好多的开源web监控、管理、发布的系统，大家可以下来搭建尝试。欢迎交流。
相关资料 http://zh.wikipedia.org/wiki/BitTorrent
]]></description>
			<content:encoded><![CDATA[<p>穷人，就得想穷人的办法，带宽被坑，严重缩水，为了分享大量资源，最终决定使用bt发布一些大资源。</p>
<p>网上找了很多BitTorrent架设btserver的教程，不是版本不对，就是安装复杂，所以，我找了个比较老的版本，一次装上调通。</p>
<p>我使用了BitTorrent-3.9.1，官方下载地址为 http://download.bittorrent.com/dl/archive/BitTorrent-3.9.1.tar.gz</p>
<p>防止墙，我传到本地 <a href='http://www.sunboyu.cn/upfiles/2009/06/bittorrent-391tar.gz'>bittorrent-3.9.1.tar.gz</a></p>
<p>首先你服务器要预装python，centos4.7预装python2.3，我预留，但服务器环境python使用了2.5版，2.3不能删，yum对版本依赖性比较强，还得预留。</p>
<p>解压 BitTorrent-3.9.1.tar.gz 后进入文件夹，按照说明进行安装：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">python setup.py install</li></ol></div>
<p>即可安装。当然中间会遇到各种问题，大部分是关于python版本或者依赖的，错误可以跟帖发一下，一起解决。</p>
<p>好了，首先启动服务器：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">python bttrack.py --port 6969 --dfile dfile.log</li></ol></div>
<p>其中port参数是服务的端口（一定记得调一下防火墙），dfile是日志</p>
<p>然后打开 http://ip:6969/  如果显示</p>
<p>BitTorrent download info</p>
<p>    * tracker version: 3.9.1<br />
    * server time: 2009-06-09 05:12 UTC</p>
<p>则证明服务启动成功。</p>
<p>下面创建一个种子文件</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">btmaketorrent.py http://bt.sunboyu.cn:6969/announce /root/soft/xmlrpc-epi-0.54.tar.gz</li></ol></div>
<p>这样，就针对 /root/soft/xmlrpc-epi-0.54.tar.gz 文件创建了一个种子文件，使用的track地址是 http://bt.sunboyu.cn:6969<br />
生成的种子位置，是这样:如果针对一个文件，则在文件同一文件夹下，如果针对文件夹，则在文件夹同级目录。</p>
<p>然后发布一个种子（很多人可能对种子这个概念不了解，可以查看资料，关于bt协议的）</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">btdownloadheadless.py /root/soft/xmlrpc-epi-0.54.tar.gz.torrent --save_as /root/soft/xmlrpc-epi-0.54.tar.gz</li></ol></div>
<p>发布种子有很多参数要限制，可以看命令具体参数，比如占用的端口跟限速等。</p>
<p>我测试了一下，linux发布的文件，就可以下载了。这只是服务器建立的阶段，要管理，还得写好多管理脚本，否则文件多的话，手工可受不了。</p>
<p>另外还有好多的开源web监控、管理、发布的系统，大家可以下来搭建尝试。欢迎交流。</p>
<p>相关资料 http://zh.wikipedia.org/wiki/BitTorrent</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/06/09/centos47%ef%bc%88linux%ef%bc%89%e4%b8%8b%e6%9e%b6%e8%ae%bebt%e6%9c%8d%e5%8a%a1%e5%99%a8.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>linux内存释放</title>
		<link>http://www.sunboyu.cn/2009/04/07/linux%e5%86%85%e5%ad%98%e9%87%8a%e6%94%be.shtml</link>
		<comments>http://www.sunboyu.cn/2009/04/07/linux%e5%86%85%e5%ad%98%e9%87%8a%e6%94%be.shtml#comments</comments>
		<pubDate>Tue, 07 Apr 2009 14:32:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

		<category><![CDATA[内存]]></category>

		<category><![CDATA[释放]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=646</guid>
		<description><![CDATA[echo 1 &#62; /proc/sys/vm/drop_caches; #释放页面缓存 
echo 2 &#62; /proc/sys/vm/drop_caches; #释放dentries和inodes
echo 3 &#62; /proc/sys/vm/drop_caches; #释放1＋2
]]></description>
			<content:encoded><![CDATA[<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">echo 1 &gt; /proc/sys/vm/drop_caches; #释放页面缓存 </li>
<li>echo 2 &gt; /proc/sys/vm/drop_caches; #释放dentries和inodes</li>
<li>echo 3 &gt; /proc/sys/vm/drop_caches; #释放1＋2</li></ol></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/04/07/linux%e5%86%85%e5%ad%98%e9%87%8a%e6%94%be.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>Linux时间同步大法</title>
		<link>http://www.sunboyu.cn/2009/02/01/linux%e6%97%b6%e9%97%b4%e5%90%8c%e6%ad%a5%e5%a4%a7%e6%b3%95.shtml</link>
		<comments>http://www.sunboyu.cn/2009/02/01/linux%e6%97%b6%e9%97%b4%e5%90%8c%e6%ad%a5%e5%a4%a7%e6%b3%95.shtml#comments</comments>
		<pubDate>Sun, 01 Feb 2009 04:11:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

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

		<category><![CDATA[时间同步]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=546</guid>
		<description><![CDATA[linux时间不同步，很郁闷，装了个ntp之类的东西，还是不好使
其实使用rdate就可以，但死活不成功。
又考虑，时间协议也许不是走80端口，查看/etc/service 果然，service iptables stop, 重新运行
rdate -s time.nist.gov
果然同步成功。
本机设置为上海时间，一切OK。
]]></description>
			<content:encoded><![CDATA[<p>linux时间不同步，很郁闷，装了个ntp之类的东西，还是不好使</p>
<p>其实使用rdate就可以，但死活不成功。</p>
<p>又考虑，时间协议也许不是走80端口，查看/etc/service 果然，service iptables stop, 重新运行</p>
<p>rdate -s time.nist.gov</p>
<p>果然同步成功。</p>
<p>本机设置为上海时间，一切OK。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/02/01/linux%e6%97%b6%e9%97%b4%e5%90%8c%e6%ad%a5%e5%a4%a7%e6%b3%95.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>服务器性能负载记录工具</title>
		<link>http://www.sunboyu.cn/2009/01/14/%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%80%a7%e8%83%bd%e8%b4%9f%e8%bd%bd%e8%ae%b0%e5%bd%95%e5%b7%a5%e5%85%b7.shtml</link>
		<comments>http://www.sunboyu.cn/2009/01/14/%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%80%a7%e8%83%bd%e8%b4%9f%e8%bd%bd%e8%ae%b0%e5%bd%95%e5%b7%a5%e5%85%b7.shtml#comments</comments>
		<pubDate>Wed, 14 Jan 2009 09:15:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

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

		<category><![CDATA[工具]]></category>

		<category><![CDATA[日志]]></category>

		<category><![CDATA[负载]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=486</guid>
		<description><![CDATA[服务器突然发生了崩溃，老板开始找我了。
找了半天居然没找到问题在哪里，一咬牙，写了个性能和负载的记录工具，再出事我可有记录了－,－&#124;&#124;
备注：只能在linux下用。
&#60; ?php
date_default_timezone_set('Asia/Shanghai');
define('SLEEPTIME',10);&#160; &#160; &#160; &#160;//10秒记录一次
$memfile&#160; = &#34;/proc/meminfo&#34;;
$loadfile = &#34;/proc/loadavg&#34;;
$logfile&#160; = sprintf(&#34;/var/www/html/log/%s.log&#34;,date('Y-m-d'));
while(1)
{
	$log = getload();
	$log .= getmem();
	$log .= mymem();
	$log .= &#34;\n\r&#34;.date(&#34;Y-m-d H:i:s&#34;);
	$log .= &#34;\n\r\n\r&#34;;
	$handle = fopen($logfile,'a');
	fwrite($handle,$log);
	fclose($handle);
	sleep(SLEEPTIME);
}
&#160;
function getload()&#160; &#160; &#160; //获得负载
{
	global $loadfile;
	return file_get_contents($loadfile);
}
function getmem()&#160; &#160; &#160; //获得内存占用
{
	global $memfile;
	$mem = file($memfile);
	return $mem[0];
}
function mymem()&#160; &#160; &#160; &#160;//程序本身内存占用
{
	$pid = getmypid();
	exec(&#34;ps -eo%mem,rss,pid &#124; grep $pid&#34;, $output);
&#160;&#160; &#160; &#160; &#160;$output = explode(&#34; &#34;, [...]]]></description>
			<content:encoded><![CDATA[<p>服务器突然发生了崩溃，老板开始找我了。</p>
<p>找了半天居然没找到问题在哪里，一咬牙，写了个性能和负载的记录工具，再出事我可有记录了－,－||</p>
<p>备注：只能在linux下用。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt; ?php</li>
<li>date_default_timezone_set('Asia/Shanghai');</li>
<li>define('SLEEPTIME',10);&nbsp; &nbsp; &nbsp; &nbsp;//10秒记录一次</li>
<li>$memfile&nbsp; = &quot;/proc/meminfo&quot;;</li>
<li>$loadfile = &quot;/proc/loadavg&quot;;</li>
<li>$logfile&nbsp; = sprintf(&quot;/var/www/html/log/%s.log&quot;,date('Y-m-d'));</li>
<li>while(1)</li>
<li>{</li>
<li>	$log = getload();</li>
<li>	$log .= getmem();</li>
<li>	$log .= mymem();</li>
<li>	$log .= &quot;\n\r&quot;.date(&quot;Y-m-d H:i:s&quot;);</li>
<li>	$log .= &quot;\n\r\n\r&quot;;</li>
<li>	$handle = fopen($logfile,'a');</li>
<li>	fwrite($handle,$log);</li>
<li>	fclose($handle);</li>
<li>	sleep(SLEEPTIME);</li>
<li>}</li>
<li>&nbsp;</li>
<li>function getload()&nbsp; &nbsp; &nbsp; //获得负载</li>
<li>{</li>
<li>	global $loadfile;</li>
<li>	return file_get_contents($loadfile);</li>
<li>}</li>
<li>function getmem()&nbsp; &nbsp; &nbsp; //获得内存占用</li>
<li>{</li>
<li>	global $memfile;</li>
<li>	$mem = file($memfile);</li>
<li>	return $mem[0];</li>
<li>}</li>
<li>function mymem()&nbsp; &nbsp; &nbsp; &nbsp;//程序本身内存占用</li>
<li>{</li>
<li>	$pid = getmypid();</li>
<li>	exec(&quot;ps -eo%mem,rss,pid | grep $pid&quot;, $output);</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$output = explode(&quot; &quot;, $output[0]);</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return $output[1] * 1024;</li>
<li>}</li>
<li>?&gt;</li></ol></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/01/14/%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%80%a7%e8%83%bd%e8%b4%9f%e8%bd%bd%e8%ae%b0%e5%bd%95%e5%b7%a5%e5%85%b7.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>修改Linux用户登录的默认语言设置</title>
		<link>http://www.sunboyu.cn/2008/12/20/%e4%bf%ae%e6%94%b9linux%e7%94%a8%e6%88%b7%e7%99%bb%e5%bd%95%e7%9a%84%e9%bb%98%e8%ae%a4%e8%af%ad%e8%a8%80%e8%ae%be%e7%bd%ae.shtml</link>
		<comments>http://www.sunboyu.cn/2008/12/20/%e4%bf%ae%e6%94%b9linux%e7%94%a8%e6%88%b7%e7%99%bb%e5%bd%95%e7%9a%84%e9%bb%98%e8%ae%a4%e8%af%ad%e8%a8%80%e8%ae%be%e7%bd%ae.shtml#comments</comments>
		<pubDate>Sat, 20 Dec 2008 08:47:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

		<category><![CDATA[终端编码]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=436</guid>
		<description><![CDATA[进入linux中断，查看自己的设置，可以看下 env命令的回显
默认都是us_EN.UTF-8
有一些字符出来全是乱码，尝试修改一下
修改用户主目录下 .bash_profile 文件，增加一行 export LANG=zh_CN.gbk
然后logout，再重新登录，部分字符显示正常。
]]></description>
			<content:encoded><![CDATA[<p>进入linux中断，查看自己的设置，可以看下 env命令的回显</p>
<p>默认都是us_EN.UTF-8</p>
<p>有一些字符出来全是乱码，尝试修改一下</p>
<p>修改用户主目录下 .bash_profile 文件，增加一行 export LANG=zh_CN.gbk</p>
<p>然后logout，再重新登录，部分字符显示正常。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/12/20/%e4%bf%ae%e6%94%b9linux%e7%94%a8%e6%88%b7%e7%99%bb%e5%bd%95%e7%9a%84%e9%bb%98%e8%ae%a4%e8%af%ad%e8%a8%80%e8%ae%be%e7%bd%ae.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>sunboyu-amp-fastcgi-suexec-v22-alpha 发布</title>
		<link>http://www.sunboyu.cn/2008/12/20/sunboyu-amp-fastcgi-suexec-v22-alpha-%e5%8f%91%e5%b8%83.shtml</link>
		<comments>http://www.sunboyu.cn/2008/12/20/sunboyu-amp-fastcgi-suexec-v22-alpha-%e5%8f%91%e5%b8%83.shtml#comments</comments>
		<pubDate>Sat, 20 Dec 2008 07:06:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

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

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

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=434</guid>
		<description><![CDATA[Linux下APACHE MYSQL PHP FCgid Suexec 自动安装脚本V2.2
1、增加了m4-1.4.9
2、增加了autoconf-2.62
这两个包在安装eaccelerator-0.9.5.2的时候使用
3、增加了PHP &#8211;with-mcrypt 参数
4、增加了PHP &#8211;enable-sockets 参数
sunboyu-amp-fastcgi-suexec-v22-alpha
]]></description>
			<content:encoded><![CDATA[<p>Linux下APACHE MYSQL PHP FCgid Suexec 自动安装脚本V2.2</p>
<p>1、增加了m4-1.4.9</p>
<p>2、增加了autoconf-2.62</p>
<p>这两个包在安装eaccelerator-0.9.5.2的时候使用</p>
<p>3、增加了PHP &#8211;with-mcrypt 参数</p>
<p>4、增加了PHP &#8211;enable-sockets 参数</p>
<p><a href="http://www.sunboyu.cn/upfiles/2008/12/sunboyu-amp-fastcgi-suexec-v22-alpha.txt">sunboyu-amp-fastcgi-suexec-v22-alpha</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/12/20/sunboyu-amp-fastcgi-suexec-v22-alpha-%e5%8f%91%e5%b8%83.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>linux_apache_php_mysql_fcgid_suexec_高效安全的主机配置方案</title>
		<link>http://www.sunboyu.cn/2008/11/08/linux_apache_php_mysql_fcgid_suexec_%e9%ab%98%e6%95%88%e5%ae%89%e5%85%a8%e7%9a%84%e4%b8%bb%e6%9c%ba%e9%85%8d%e7%bd%ae%e6%96%b9%e6%a1%88.shtml</link>
		<comments>http://www.sunboyu.cn/2008/11/08/linux_apache_php_mysql_fcgid_suexec_%e9%ab%98%e6%95%88%e5%ae%89%e5%85%a8%e7%9a%84%e4%b8%bb%e6%9c%ba%e9%85%8d%e7%bd%ae%e6%96%b9%e6%a1%88.shtml#comments</comments>
		<pubDate>Sat, 08 Nov 2008 14:35:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

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

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

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

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

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

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=376</guid>
		<description><![CDATA[linux+apache+php+mysql+fcgid+suexec 高效安全主机配置
最近一直在研究web服务器的配置和安全配置，基本搞完了
window2003下
iis+php(isapi)
apache+php(mod)
linux下
apache+php(mod)
apache+php(fastcgi)
四种安装方式的安全设置。其中涉及一些性能方面的调整，但没有实际的环境来测试，所以只涉及方法，不涉及具体的应用，而在安全方面下了很大的功夫。
底下我针对比较复杂的一种安装模式apache+php(fastcgi)进行详细讲解，来介绍如何配置一个安全的虚拟主机系统。
调试环境：
CentOS5
Apache2.2.9
Mysql5.0.22
PHP5.2.6
Fcgid2.4.6
需要的脚本  sunboyu-amp-fastcgi-suexec-v20-alpha
首先用脚本 unboyu-amp-fastcgi-v20-fcgid-suexec-alpha.txt 进行安装。
注：我在我的服务器上做了一个源，如果你感觉较慢的话，可以先吧软件下载到本地，然后修改一下脚本进行安装。
整体运行完后，apache是能成功运行的，但访问的话显示权限错误，底下主要是配置权限
过程用命令来显示，比较符合技术人员的习惯
1、vi /opt/httpd-2.2.9/conf/httpd.conf
修改 User daemon
Group daemon
为 User apache
Group apache
去掉 #Include conf/extra/httpd-vhosts.conf 前边的#，使其生效
2、增加一个虚拟站点的账户
groupadd www
useradd -g www www
现在应该有个目录 /home/www
3、vi /opt/httpd-2.2.9/conf/extra/httpd-vhost.conf
屏蔽或直接删除原来的站点信息
SuexecUserGroup www www #这里一定要弄清楚是做什么用的
ServerAdmin sunboyu@gmail.com
DocumentRoot &#8220;/home/www/php-cgi&#8221;
ServerName 192.168.0.5 #我测试的ip是这个，实际应该为你的域名
ServerAlias www.dummy-host.example.com #别名
ErrorLog &#8220;logs/dummy-host.example.com-error_log&#8221; #日志，用独立的名字
CustomLog &#8220;logs/dummy-host.example.com-access_log&#8221; common
SetHandler fcgid-script #我在编译完apache，附加了两个模块，fastcgi和fcgid，后一个是国人开发的，比fastcgi更稳定和易用
FCGIWrapper /home/www/php/php-cgi .php # php-cgi 是站点下的一个文件，下边建立
Options ExecCGI
allow from all
然后: x 即可
4、建立脚本 /home/www/php/php-cgi
vi /home/www/php/php-cgi
内容为
#!/bin/sh
export PHPRC=/home/www/php-cgi
export PHP_FCGI_CHILDREN=5 #创建的fcgi进程
export PHP_FCGI_MAX_REQUESTS=5000 #最大连接数
/opt/php-5.2.6/bin/php-cgi #php-cgi程序的位置
: x
5、创建独立的php.ini配置文件
cp [...]]]></description>
			<content:encoded><![CDATA[<p>linux+apache+php+mysql+fcgid+suexec 高效安全主机配置</p>
<p>最近一直在研究web服务器的配置和安全配置，基本搞完了<br />
window2003下<br />
iis+php(isapi)<br />
apache+php(mod)<br />
linux下<br />
apache+php(mod)<br />
apache+php(fastcgi)<br />
四种安装方式的安全设置。其中涉及一些性能方面的调整，但没有实际的环境来测试，所以只涉及方法，不涉及具体的应用，而在安全方面下了很大的功夫。<br />
底下我针对比较复杂的一种安装模式apache+php(fastcgi)进行详细讲解，来介绍如何配置一个安全的虚拟主机系统。</p>
<p>调试环境：</p>
<p>CentOS5<br />
Apache2.2.9<br />
Mysql5.0.22<br />
PHP5.2.6<br />
Fcgid2.4.6</p>
<p>需要的脚本  <a href='http://www.sunboyu.cn/upfiles/2008/12/sunboyu-amp-fastcgi-suexec-v20-alpha.txt'>sunboyu-amp-fastcgi-suexec-v20-alpha</a></p>
<p>首先用脚本 unboyu-amp-fastcgi-v20-fcgid-suexec-alpha.txt 进行安装。<br />
注：我在我的服务器上做了一个源，如果你感觉较慢的话，可以先吧软件下载到本地，然后修改一下脚本进行安装。</p>
<p>整体运行完后，apache是能成功运行的，但访问的话显示权限错误，底下主要是配置权限<br />
过程用命令来显示，比较符合技术人员的习惯<br />
1、vi /opt/httpd-2.2.9/conf/httpd.conf</p>
<p>修改 User daemon<br />
Group daemon<br />
为 User apache<br />
Group apache</p>
<p>去掉 #Include conf/extra/httpd-vhosts.conf 前边的#，使其生效</p>
<p>2、增加一个虚拟站点的账户</p>
<p>groupadd www<br />
useradd -g www www</p>
<p>现在应该有个目录 /home/www</p>
<p>3、vi /opt/httpd-2.2.9/conf/extra/httpd-vhost.conf</p>
<p>屏蔽或直接删除原来的站点信息<br />
SuexecUserGroup www www #这里一定要弄清楚是做什么用的<br />
ServerAdmin sunboyu@gmail.com<br />
DocumentRoot &#8220;/home/www/php-cgi&#8221;<br />
ServerName 192.168.0.5 #我测试的ip是这个，实际应该为你的域名<br />
ServerAlias www.dummy-host.example.com #别名<br />
ErrorLog &#8220;logs/dummy-host.example.com-error_log&#8221; #日志，用独立的名字<br />
CustomLog &#8220;logs/dummy-host.example.com-access_log&#8221; common</p>
<p>SetHandler fcgid-script #我在编译完apache，附加了两个模块，fastcgi和fcgid，后一个是国人开发的，比fastcgi更稳定和易用<br />
FCGIWrapper /home/www/php/php-cgi .php # php-cgi 是站点下的一个文件，下边建立<br />
Options ExecCGI<br />
allow from all<br />
然后: x 即可</p>
<p>4、建立脚本 /home/www/php/php-cgi</p>
<p>vi /home/www/php/php-cgi<br />
内容为<br />
#!/bin/sh<br />
export PHPRC=/home/www/php-cgi<br />
export PHP_FCGI_CHILDREN=5 #创建的fcgi进程<br />
export PHP_FCGI_MAX_REQUESTS=5000 #最大连接数<br />
/opt/php-5.2.6/bin/php-cgi #php-cgi程序的位置</p>
<p>: x</p>
<p>5、创建独立的php.ini配置文件<br />
cp /opt/php-5.2.6/lib/php.ini /home/www/php-cgi/php.ini</p>
<p>6、修改PHP的open_basedir</p>
<p>在/home/www/php-cgi/php.ini中找到<br />
open_basedir , 修改为<br />
open_basedir = /home/www/php<br />
注：safe_mode_exec_dir 之类的参数如果从比较变态的安全设置来说，也是应该来设定的，但我还不变态</p>
<p>7、配置权限<br />
chgrp root /opt/httpd-2.2.9/bin/suexec<br />
chmod 4751 /opt/httpd-2.2.9/bin/suexec<br />
chown www:www -R /home/www<br />
chmod 755 -R /home/www<br />
chmod 700 -R /home/www/php-cgi/php-cgi</p>
<p>8、重启<br />
server httpd restart</p>
<p>9、如果你能看到成功页面，然后就传一个PHP木马上去测试一下权限和安全的问题.<br />
如果连启动都启动不了，那就得查httpd的error_log ，suexec_log，然后去google一下，看看是哪的权限问题。</p>
<p>总结：本人教懒，整个过程调通后，也没写文档，但看到网上此类资料不多，而且有一些都没有命中要害，比如一些权限的配置和相对详尽的说明。我的注释只是把一些网上没有的解释而我弄明白后的理解写在了上边，但真正要想明白，估计还得搬着手册和google去一条条查。而且，我不是边做边写的，而是根据原来的配置盲写了一遍，估计会不少错误，总比没有强。如果有谁发现这个安全依然有问题，可以帮我提出，因为在安全方面我对自己要求很高。<br />
如果有什么需要讨论的，可以加入这个MSN群 lampper@live.cn （加为msn好友即可）</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/11/08/linux_apache_php_mysql_fcgid_suexec_%e9%ab%98%e6%95%88%e5%ae%89%e5%85%a8%e7%9a%84%e4%b8%bb%e6%9c%ba%e9%85%8d%e7%bd%ae%e6%96%b9%e6%a1%88.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>伟大的进步</title>
		<link>http://www.sunboyu.cn/2008/11/05/%e4%bc%9f%e5%a4%a7%e7%9a%84%e8%bf%9b%e6%ad%a5.shtml</link>
		<comments>http://www.sunboyu.cn/2008/11/05/%e4%bc%9f%e5%a4%a7%e7%9a%84%e8%bf%9b%e6%ad%a5.shtml#comments</comments>
		<pubDate>Wed, 05 Nov 2008 14:09:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

		<category><![CDATA[安全]]></category>

		<category><![CDATA[虚拟主机]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=373</guid>
		<description><![CDATA[博客很久没更新，导致alexa排名暴跌，因为最近在研究linux下apache＋php的系统安全问题，这个问题困扰了好久。因为配置iis（之前有此文章）的时候，我设置了非常安全的iis站点用户和权限的隔离，但在linux下，总没有找到好的方法。
最近查阅了大量的资料，主要是了解apache的账户机制，suexec的工作原理，然后又翻看了大量的资料，终于搞清楚了一套完整的安全的lamp虚拟主机配置方法，能达到站点的权限隔离，进程账户的相对独立，以及对性能的控制。
在学习的过程中，常犯的错误，就是轻敌。总感觉这事不难，一会就搞定。但实际头疼了半个月。另外就是不看日志。到最后两天，大量的调试是在对比日志和理解日志的涵义，针对日志去进行配置。从我学linux的过程来看，看手册，翻日志，分析别人的案例，是学习的最佳途径。
关于安全配置linux虚拟主机的过程，我将另写文章。
]]></description>
			<content:encoded><![CDATA[<p>博客很久没更新，导致alexa排名暴跌，因为最近在研究linux下apache＋php的系统安全问题，这个问题困扰了好久。因为配置iis（之前有此文章）的时候，我设置了非常安全的iis站点用户和权限的隔离，但在linux下，总没有找到好的方法。</p>
<p>最近查阅了大量的资料，主要是了解apache的账户机制，suexec的工作原理，然后又翻看了大量的资料，终于搞清楚了一套完整的安全的lamp虚拟主机配置方法，能达到站点的权限隔离，进程账户的相对独立，以及对性能的控制。</p>
<p>在学习的过程中，常犯的错误，就是轻敌。总感觉这事不难，一会就搞定。但实际头疼了半个月。另外就是不看日志。到最后两天，大量的调试是在对比日志和理解日志的涵义，针对日志去进行配置。从我学linux的过程来看，看手册，翻日志，分析别人的案例，是学习的最佳途径。</p>
<p>关于安全配置linux虚拟主机的过程，我将另写文章。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/11/05/%e4%bc%9f%e5%a4%a7%e7%9a%84%e8%bf%9b%e6%ad%a5.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>Linux提交命令至后台运行</title>
		<link>http://www.sunboyu.cn/2008/09/27/linux%e6%8f%90%e4%ba%a4%e5%91%bd%e4%bb%a4%e8%87%b3%e5%90%8e%e5%8f%b0%e8%bf%90%e8%a1%8c.shtml</link>
		<comments>http://www.sunboyu.cn/2008/09/27/linux%e6%8f%90%e4%ba%a4%e5%91%bd%e4%bb%a4%e8%87%b3%e5%90%8e%e5%8f%b0%e8%bf%90%e8%a1%8c.shtml#comments</comments>
		<pubDate>Sat, 27 Sep 2008 15:01:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

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

		<category><![CDATA[后台执行]]></category>

		<category><![CDATA[后台运行]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=330</guid>
		<description><![CDATA[我经常在putty里工作,有时候如果一个命令执行太长,不得已,我得开两个窗口,如果事情再多,可能开四个五个,不过有的ssh登陆工具可以开多个窗口,但难免会出点乱子.那么我们可以把命令隐藏再后台执行,使用linux下命令  &#8220;&#38;&#8221;  这个倒霉的符号.
比如我们要执行一个命令,(暂时没想到执行时间N长的命令,假设一个shell) test.sh , 现在提交并隐藏在后台
$./test.sh &#62;&#62; test.log &#38;
意思是,执行test.sh 反馈的结构输送至 test.log , &#38;表示这个命令提交至后台执行.
执行后,返回一个进程号,可以用ps来查看.
这样,我们可以连续在同一个终端窗口上运行多个持续的命令.
然后,问题又来.我们运行这些命令至后台后,如果想退出终端窗口,那么后台的命令也随之中断.我们得想办法让进程持续运行.这里得使用此命令 nohup
重新执行上边的操作,那么我们应该这样执行
$nohup ./test.sh &#62;&#62; test.log
然后敲logout,放心,再登陆试试ps,进程依然存在!
]]></description>
			<content:encoded><![CDATA[<p>我经常在putty里工作,有时候如果一个命令执行太长,不得已,我得开两个窗口,如果事情再多,可能开四个五个,不过有的ssh登陆工具可以开多个窗口,但难免会出点乱子.那么我们可以把命令隐藏再后台执行,使用linux下命令  &#8220;&amp;&#8221;  这个倒霉的符号.</p>
<p>比如我们要执行一个命令,(暂时没想到执行时间N长的命令,假设一个shell) test.sh , 现在提交并隐藏在后台</p>
<p>$./test.sh &gt;&gt; test.log &amp;</p>
<p>意思是,执行test.sh 反馈的结构输送至 test.log , &amp;表示这个命令提交至后台执行.</p>
<p>执行后,返回一个进程号,可以用ps来查看.</p>
<p>这样,我们可以连续在同一个终端窗口上运行多个持续的命令.</p>
<p>然后,问题又来.我们运行这些命令至后台后,如果想退出终端窗口,那么后台的命令也随之中断.我们得想办法让进程持续运行.这里得使用此命令 nohup</p>
<p>重新执行上边的操作,那么我们应该这样执行</p>
<p>$nohup ./test.sh &gt;&gt; test.log</p>
<p>然后敲logout,放心,再登陆试试ps,进程依然存在!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/09/27/linux%e6%8f%90%e4%ba%a4%e5%91%bd%e4%bb%a4%e8%87%b3%e5%90%8e%e5%8f%b0%e8%bf%90%e8%a1%8c.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>Linux下与WinRar兼容的程序，rarlinux</title>
		<link>http://www.sunboyu.cn/2008/08/11/linux%e4%b8%8b%e4%b8%8ewinrar%e5%85%bc%e5%ae%b9%e7%9a%84%e7%a8%8b%e5%ba%8f%ef%bc%8crarlinux.shtml</link>
		<comments>http://www.sunboyu.cn/2008/08/11/linux%e4%b8%8b%e4%b8%8ewinrar%e5%85%bc%e5%ae%b9%e7%9a%84%e7%a8%8b%e5%ba%8f%ef%bc%8crarlinux.shtml#comments</comments>
		<pubDate>Mon, 11 Aug 2008 09:52:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

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

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

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=275</guid>
		<description><![CDATA[要做个linux下与windows兼容的加密压包与解包工具，选择了rarlinux。
从这里下载 http://www.rarlab.com/rar/rarbsd-3.8.b4.tar.gz
下载后，直接tar解压，make安装，如果想自定义安装位置，可以修改Makefile文件。如果是自定义路径，那么把路径加入到PATH中。PATH=$PATH:/path export PATH
然后可以敲命令 rar,查看帮助。
查看压缩文件列表  rar l file.rar
解压缩一个文件 rar e file.tat
压缩一个文件 rar a target.rar soursefile
压缩一个文件并且加密码 tar a -p[password] target.rar soursefile
]]></description>
			<content:encoded><![CDATA[<p>要做个linux下与windows兼容的加密压包与解包工具，选择了rarlinux。</p>
<p>从这里下载 http://www.rarlab.com/rar/rarbsd-3.8.b4.tar.gz</p>
<p>下载后，直接tar解压，make安装，如果想自定义安装位置，可以修改Makefile文件。如果是自定义路径，那么把路径加入到PATH中。PATH=$PATH:/path export PATH</p>
<p>然后可以敲命令 rar,查看帮助。</p>
<p>查看压缩文件列表  rar l file.rar</p>
<p>解压缩一个文件 rar e file.tat</p>
<p>压缩一个文件 rar a target.rar soursefile</p>
<p>压缩一个文件并且加密码 tar a -p[password] target.rar soursefile</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/08/11/linux%e4%b8%8b%e4%b8%8ewinrar%e5%85%bc%e5%ae%b9%e7%9a%84%e7%a8%8b%e5%ba%8f%ef%bc%8crarlinux.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>腾讯发布linux版本qq，第一时间抢鲜试用</title>
		<link>http://www.sunboyu.cn/2008/07/31/%e8%85%be%e8%ae%af%e5%8f%91%e5%b8%83linux%e7%89%88%e6%9c%acqq%ef%bc%8c%e7%ac%ac%e4%b8%80%e6%97%b6%e9%97%b4%e6%8a%a2%e9%b2%9c%e8%af%95%e7%94%a8.shtml</link>
		<comments>http://www.sunboyu.cn/2008/07/31/%e8%85%be%e8%ae%af%e5%8f%91%e5%b8%83linux%e7%89%88%e6%9c%acqq%ef%bc%8c%e7%ac%ac%e4%b8%80%e6%97%b6%e9%97%b4%e6%8a%a2%e9%b2%9c%e8%af%95%e7%94%a8.shtml#comments</comments>
		<pubDate>Thu, 31 Jul 2008 05:35:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[相当拍砖]]></category>

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

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

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=233</guid>
		<description><![CDATA[http://im.qq.com/qq/linux/
腾讯果然搞笑，痛快的在7月份发布了mac版本的qq和linux版本的qq。
本人在ubuntu下试用了一下，没有源代码，传统的做法，qq的一些功能被阉割。
不过用了几分钟，很稳定，多窗口，输入法，都没有出现什么问题。没有截图等花哨的功能，估计是以后要发布。
顶一个！
]]></description>
			<content:encoded><![CDATA[<p>http://im.qq.com/qq/linux/</p>
<p>腾讯果然搞笑，痛快的在7月份发布了mac版本的qq和linux版本的qq。</p>
<p>本人在ubuntu下试用了一下，没有源代码，传统的做法，qq的一些功能被阉割。</p>
<p>不过用了几分钟，很稳定，多窗口，输入法，都没有出现什么问题。没有截图等花哨的功能，估计是以后要发布。</p>
<p>顶一个！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/07/31/%e8%85%be%e8%ae%af%e5%8f%91%e5%b8%83linux%e7%89%88%e6%9c%acqq%ef%bc%8c%e7%ac%ac%e4%b8%80%e6%97%b6%e9%97%b4%e6%8a%a2%e9%b2%9c%e8%af%95%e7%94%a8.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>杀死占用80端口的进程</title>
		<link>http://www.sunboyu.cn/2008/07/27/%e6%9d%80%e6%ad%bb%e5%8d%a0%e7%94%a880%e7%ab%af%e5%8f%a3%e7%9a%84%e8%bf%9b%e7%a8%8b.shtml</link>
		<comments>http://www.sunboyu.cn/2008/07/27/%e6%9d%80%e6%ad%bb%e5%8d%a0%e7%94%a880%e7%ab%af%e5%8f%a3%e7%9a%84%e8%bf%9b%e7%a8%8b.shtml#comments</comments>
		<pubDate>Sun, 27 Jul 2008 02:33:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[技术存档]]></category>

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

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

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=225</guid>
		<description><![CDATA[just kill off the hanging processes:
# fuser 80/tcp
80/tcp:               3010  3702  4088 16754
# kill -n 9 3010
# kill -n 9 3702
# kill -n 9 4088
# kill -n 9 16754
# apachectl start
]]></description>
			<content:encoded><![CDATA[<p>just kill off the hanging processes:<br />
# fuser 80/tcp<br />
80/tcp:               3010  3702  4088 16754<br />
# kill -n 9 3010<br />
# kill -n 9 3702<br />
# kill -n 9 4088<br />
# kill -n 9 16754<br />
# apachectl start</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/07/27/%e6%9d%80%e6%ad%bb%e5%8d%a0%e7%94%a880%e7%ab%af%e5%8f%a3%e7%9a%84%e8%bf%9b%e7%a8%8b.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>继续死苛LINUX</title>
		<link>http://www.sunboyu.cn/2008/07/21/%e7%bb%a7%e7%bb%ad%e6%ad%bb%e8%8b%9blinux.shtml</link>
		<comments>http://www.sunboyu.cn/2008/07/21/%e7%bb%a7%e7%bb%ad%e6%ad%bb%e8%8b%9blinux.shtml#comments</comments>
		<pubDate>Mon, 21 Jul 2008 01:11:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[纯属蛋疼]]></category>

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

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=204</guid>
		<description><![CDATA[本来计划拿两个星期搞定LAMP，可惜在PHP编译缺一直没有通过，问题在于php总不能找到mysql的一些库文件，不断解决中，再增加一个周的时间来搞。
]]></description>
			<content:encoded><![CDATA[<p>本来计划拿两个星期搞定LAMP，可惜在PHP编译缺一直没有通过，问题在于php总不能找到mysql的一些库文件，不断解决中，再增加一个周的时间来搞。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/07/21/%e7%bb%a7%e7%bb%ad%e6%ad%bb%e8%8b%9blinux.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>打造全能优化的Linux+Apache+PHP+Mysql服务器（1）</title>
		<link>http://www.sunboyu.cn/2008/07/13/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%881%ef%bc%89.shtml</link>
		<comments>http://www.sunboyu.cn/2008/07/13/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%881%ef%bc%89.shtml#comments</comments>
		<pubDate>Sun, 13 Jul 2008 13:05:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[APACHE]]></category>

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

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

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

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

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

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

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

		<category><![CDATA[服务器]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=196</guid>
		<description><![CDATA[fastcgi   http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
apache2   http://apache.mirror.phpchina.com/httpd/httpd-2.2.9.tar.gz
mysql5    http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51b.tar.gz/from/http://mysql.mirrors.arminco.com/
php5      http://cn2.php.net/distributions/php-5.2.6.tar.gz
libxml2
gd-jpeg   ftp://192.48.96.9/graphics/jpeg/jpegsrc.v6b.tar.gz
freetype  http://voxel.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.7.tar.gz
libpng    http://voxel.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.29.tar.gz
zend      http://www.zend.com/download/55
memcached  http://www.danga.com/memcached/dist/memcached-1.2.5.tar.gz
memcache   http://pecl.php.net/get/memcache-3.0.1.tgz
libevent   http://www.monkey.org/~provos/libevent-1.2a.tar.gz
目前想到的功能大概有这些，想到再加。
目前正在研究每一个组件的性能和参数。
]]></description>
			<content:encoded><![CDATA[<p>fastcgi   http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz<br />
apache2   http://apache.mirror.phpchina.com/httpd/httpd-2.2.9.tar.gz<br />
mysql5    http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51b.tar.gz/from/http://mysql.mirrors.arminco.com/<br />
php5      http://cn2.php.net/distributions/php-5.2.6.tar.gz<br />
libxml2<br />
gd-jpeg   ftp://192.48.96.9/graphics/jpeg/jpegsrc.v6b.tar.gz<br />
freetype  http://voxel.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.7.tar.gz<br />
libpng    http://voxel.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.29.tar.gz<br />
zend      http://www.zend.com/download/55</p>
<p>memcached  http://www.danga.com/memcached/dist/memcached-1.2.5.tar.gz<br />
memcache   http://pecl.php.net/get/memcache-3.0.1.tgz<br />
libevent   http://www.monkey.org/~provos/libevent-1.2a.tar.gz</p>
<p>目前想到的功能大概有这些，想到再加。</p>
<p>目前正在研究每一个组件的性能和参数。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/07/13/%e6%89%93%e9%80%a0%e5%85%a8%e8%83%bd%e4%bc%98%e5%8c%96%e7%9a%84linuxapachephpmysql%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%881%ef%bc%89.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>linux下安装eAccelerator加速器</title>
		<link>http://www.sunboyu.cn/2008/05/24/linux%e4%b8%8b%e5%ae%89%e8%a3%85eaccelerator%e5%8a%a0%e9%80%9f%e5%99%a8.shtml</link>
		<comments>http://www.sunboyu.cn/2008/05/24/linux%e4%b8%8b%e5%ae%89%e8%a3%85eaccelerator%e5%8a%a0%e9%80%9f%e5%99%a8.shtml#comments</comments>
		<pubDate>Sat, 24 May 2008 15:16:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[技术存档]]></category>

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

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

		<category><![CDATA[加速]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=51</guid>
		<description><![CDATA[http://eaccelerator.net/   官方
http://eaccelerator.net/wiki/Release-0.9.5.3   下载最新版本即可
安装前需要安装gcc或者phpize
然后安装php-devel    yum install php-devel
./configure &#8211;enable-eaccelerator=shared-memory &#8211;with-php-config=/usr/bin/php-config &#8211;with-eaccelerator-shared-memory &#8211;with-eaccelerator-content-caching
make
注：&#8211;with-php-config 后边跟php-config的路径，根据环境确定
然后在php.ini中追加以下代码
安装为 Zend extension 模式：
zend_extension=&#8221;eaccelerator.so&#8221;   //eaccelerator.so 拷贝到 php ext 目录下
eaccelerator.shm_size=&#8221;16&#8243;
eaccelerator.cache_dir=&#8221;/tmp/eaccelerator&#8221;
eaccelerator.enable=&#8221;1&#8243;
eaccelerator.optimizer=&#8221;1&#8243;
eaccelerator.check_mtime=&#8221;1&#8243;
eaccelerator.debug=&#8221;0&#8243;
eaccelerator.log_file = &#8220;/log/httpd/eaccelerator_log&#8221;
eaccelerator.filter=&#8221;"
eaccelerator.shm_max=&#8221;0&#8243;
eaccelerator.shm_ttl=&#8221;0&#8243;
eaccelerator.shm_prune_period=&#8221;0&#8243;
eaccelerator.shm_only=&#8221;0&#8243;
eaccelerator.compress=&#8221;1&#8243;
eaccelerator.compress_level=&#8221;9&#8243;
如果你使用了thread safe模式安装的PHP，你必须使用 “zend_extension_ts” 替换第一行的 “zend_extension”.
安装为 PHP extension 模式：（这是大部分采用的方式）
extension=&#8221;eaccelerator.so&#8221;
eaccelerator.shm_size=&#8221;16&#8243;
eaccelerator.cache_dir=&#8221;/tmp/eaccelerator&#8221;
eaccelerator.enable=&#8221;1&#8243;
eaccelerator.optimizer=&#8221;1&#8243;
eaccelerator.check_mtime=&#8221;1&#8243;
eaccelerator.debug=&#8221;0&#8243;
eaccelerator.log_file = &#8220;/log/httpd/eaccelerator_log&#8221;
eaccelerator.filter=&#8221;"
eaccelerator.shm_max=&#8221;0&#8243;
eaccelerator.shm_ttl=&#8221;0&#8243;
eaccelerator.shm_prune_period=&#8221;0&#8243;
eaccelerator.shm_only=&#8221;0&#8243;
eaccelerator.compress=&#8221;1&#8243;
eaccelerator.compress_level=&#8221;9&#8243;
php ini 设置的详细文档 http://eaccelerator.net/wiki/Settings
api 文档 http://bart.eaccelerator.net/doc/phpdoc/
]]></description>
			<content:encoded><![CDATA[<p>http://eaccelerator.net/   官方</p>
<p>http://eaccelerator.net/wiki/Release-0.9.5.3   下载最新版本即可</p>
<p>安装前需要安装gcc或者phpize</p>
<p>然后安装php-devel    yum install php-devel</p>
<p>./configure &#8211;enable-eaccelerator=shared-memory &#8211;with-php-config=/usr/bin/php-config &#8211;with-eaccelerator-shared-memory &#8211;with-eaccelerator-content-caching<br />
make</p>
<p>注：&#8211;with-php-config 后边跟php-config的路径，根据环境确定</p>
<p>然后在php.ini中追加以下代码</p>
<p>安装为 Zend extension 模式：</p>
<p>zend_extension=&#8221;eaccelerator.so&#8221;   //eaccelerator.so 拷贝到 php ext 目录下<br />
eaccelerator.shm_size=&#8221;16&#8243;<br />
eaccelerator.cache_dir=&#8221;/tmp/eaccelerator&#8221;<br />
eaccelerator.enable=&#8221;1&#8243;<br />
eaccelerator.optimizer=&#8221;1&#8243;<br />
eaccelerator.check_mtime=&#8221;1&#8243;<br />
eaccelerator.debug=&#8221;0&#8243;<br />
eaccelerator.log_file = &#8220;/log/httpd/eaccelerator_log&#8221;<br />
eaccelerator.filter=&#8221;"<br />
eaccelerator.shm_max=&#8221;0&#8243;<br />
eaccelerator.shm_ttl=&#8221;0&#8243;<br />
eaccelerator.shm_prune_period=&#8221;0&#8243;<br />
eaccelerator.shm_only=&#8221;0&#8243;<br />
eaccelerator.compress=&#8221;1&#8243;<br />
eaccelerator.compress_level=&#8221;9&#8243;</p>
<p>如果你使用了thread safe模式安装的PHP，你必须使用 “zend_extension_ts” 替换第一行的 “zend_extension”.<br />
安装为 PHP extension 模式：（这是大部分采用的方式）</p>
<p>extension=&#8221;eaccelerator.so&#8221;<br />
eaccelerator.shm_size=&#8221;16&#8243;<br />
eaccelerator.cache_dir=&#8221;/tmp/eaccelerator&#8221;<br />
eaccelerator.enable=&#8221;1&#8243;<br />
eaccelerator.optimizer=&#8221;1&#8243;<br />
eaccelerator.check_mtime=&#8221;1&#8243;<br />
eaccelerator.debug=&#8221;0&#8243;<br />
eaccelerator.log_file = &#8220;/log/httpd/eaccelerator_log&#8221;<br />
eaccelerator.filter=&#8221;"<br />
eaccelerator.shm_max=&#8221;0&#8243;<br />
eaccelerator.shm_ttl=&#8221;0&#8243;<br />
eaccelerator.shm_prune_period=&#8221;0&#8243;<br />
eaccelerator.shm_only=&#8221;0&#8243;<br />
eaccelerator.compress=&#8221;1&#8243;<br />
eaccelerator.compress_level=&#8221;9&#8243;</p>
<p>php ini 设置的详细文档 http://eaccelerator.net/wiki/Settings<br />
api 文档 http://bart.eaccelerator.net/doc/phpdoc/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/05/24/linux%e4%b8%8b%e5%ae%89%e8%a3%85eaccelerator%e5%8a%a0%e9%80%9f%e5%99%a8.shtml/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

