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

<channel>
	<title>DBAlife &#187; Linux</title>
	<atom:link href="http://www.dbalife.com/archives/category/linuxunix/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dbalife.com</link>
	<description>星光照耀前方</description>
	<lastBuildDate>Wed, 14 Jul 2010 08:13:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Nginx与PCRE</title>
		<link>http://www.dbalife.com/archives/393.html</link>
		<comments>http://www.dbalife.com/archives/393.html#comments</comments>
		<pubDate>Wed, 14 Jul 2010 08:13:46 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[PRCE]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=393</guid>
		<description><![CDATA[Nginx的Urlrewrite模块依赖PCRE，而Nginx不能很好的识别到系统中的PCRE，在make时可能遇到类似这样的错误：
make -f objs/Makefile
make[1]: Entering directory `/root/nginx-0.7.65'
cd /usr/local/lib/pcre \
        &#38;&#38; if [ -f Makefile ]; then make distclean; fi \
        &#38;&#38; CC="gcc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \
        ./configure --disable-shared
/bin/sh: line 0: cd: /usr/local/lib/pcre: No such file or directory
make[1]: *** [/usr/local/lib/pcre/Makefile] Error 1
make[1]: Leaving directory `/root/nginx-0.7.65'
make: *** [build] Error 2
原因是nginx不能自动找到pcre的库文件，下载最新的pcre源码包安装后：
#mkdir -p /usr/local/lib/.libs/
# cp /usr/local/lib/libpcre.a /usr/local/lib/.libs/libpcre.a


Related posts:ubuntu7.10 JDK手动安装
PIX [...]


Related posts:<ol><li><a href='http://www.dbalife.com/archives/82.html' rel='bookmark' title='Permanent Link: ubuntu7.10 JDK手动安装'>ubuntu7.10 JDK手动安装</a></li>
<li><a href='http://www.dbalife.com/archives/135.html' rel='bookmark' title='Permanent Link: PIX Logging Architecture 2 安装教程'>PIX Logging Architecture 2 安装教程</a></li>
<li><a href='http://www.dbalife.com/archives/25.html' rel='bookmark' title='Permanent Link: 如何保持Linux服务器间的文件同步'>如何保持Linux服务器间的文件同步</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Nginx的Urlrewrite模块依赖PCRE，而Nginx不能很好的识别到系统中的PCRE，在make时可能遇到类似这样的错误：</p>
<p>make -f objs/Makefile<br />
make[1]: Entering directory `/root/nginx-0.7.65'<br />
cd /usr/local/lib/pcre \<br />
        &amp;&amp; if [ -f Makefile ]; then make distclean; fi \<br />
        &amp;&amp; CC="gcc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \<br />
        ./configure --disable-shared<br />
/bin/sh: line 0: cd: /usr/local/lib/pcre: No such file or directory<br />
make[1]: *** [/usr/local/lib/pcre/Makefile] Error 1<br />
make[1]: Leaving directory `/root/nginx-0.7.65'<br />
make: *** [build] Error 2</p>
<p>原因是nginx不能自动找到pcre的库文件，下载最新的pcre源码包安装后：</p>
<p>#mkdir -p /usr/local/lib/.libs/<br />
# cp /usr/local/lib/libpcre.a /usr/local/lib/.libs/libpcre.a</p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/82.html' rel='bookmark' title='Permanent Link: ubuntu7.10 JDK手动安装'>ubuntu7.10 JDK手动安装</a></li>
<li><a href='http://www.dbalife.com/archives/135.html' rel='bookmark' title='Permanent Link: PIX Logging Architecture 2 安装教程'>PIX Logging Architecture 2 安装教程</a></li>
<li><a href='http://www.dbalife.com/archives/25.html' rel='bookmark' title='Permanent Link: 如何保持Linux服务器间的文件同步'>如何保持Linux服务器间的文件同步</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/393.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>编译Google perftools的小问题</title>
		<link>http://www.dbalife.com/archives/391.html</link>
		<comments>http://www.dbalife.com/archives/391.html#comments</comments>
		<pubDate>Wed, 14 Jul 2010 08:07:50 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[perftools]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=391</guid>
		<description><![CDATA[在编译时可能会遇到这个错误：
error Cannot calculate stack trace: need either libunwind or frame-pointers
解决方法是在编译参数里增加 --enable-frame-pointers


Related posts:Nginx与PCRE



Related posts:<ol><li><a href='http://www.dbalife.com/archives/393.html' rel='bookmark' title='Permanent Link: Nginx与PCRE'>Nginx与PCRE</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>在编译时可能会遇到这个错误：</p>
<p>error Cannot calculate stack trace: need either libunwind or frame-pointers</p>
<p>解决方法是在编译参数里增加 --enable-frame-pointers</p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/393.html' rel='bookmark' title='Permanent Link: Nginx与PCRE'>Nginx与PCRE</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/391.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>64位centOS编译php5.3时的小问题</title>
		<link>http://www.dbalife.com/archives/389.html</link>
		<comments>http://www.dbalife.com/archives/389.html#comments</comments>
		<pubDate>Wed, 07 Jul 2010 05:48:33 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[libmysqlclient]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=389</guid>
		<description><![CDATA[64位CentOS5.5在编译php5.3时，提示找不到libmysqlclient，
checking for MING support... no
checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes, shared
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!
这是由于搜索路径有误，需在编译时增加一个参数： "--with-libdir=lib64"


Related posts:PIX logging Architecture所需perl module的几点注意



Related posts:<ol><li><a href='http://www.dbalife.com/archives/133.html' rel='bookmark' title='Permanent Link: PIX logging Architecture所需perl module的几点注意'>PIX logging Architecture所需perl module的几点注意</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>64位CentOS5.5在编译php5.3时，提示找不到libmysqlclient，</p>
<p>checking for MING support... no<br />
checking for mSQL support... no<br />
checking for MSSQL support via FreeTDS... no<br />
checking for MySQL support... yes, shared<br />
checking for specified location of the MySQL UNIX socket... no<br />
checking for MySQL UNIX socket location... no<br />
configure: error: Cannot find libmysqlclient under /usr.<br />
Note that the MySQL client library is not bundled anymore!</p>
<p>这是由于搜索路径有误，需在编译时增加一个参数： "--with-libdir=lib64"</p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/133.html' rel='bookmark' title='Permanent Link: PIX logging Architecture所需perl module的几点注意'>PIX logging Architecture所需perl module的几点注意</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/389.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>友好的SecureCRT日志文件设置</title>
		<link>http://www.dbalife.com/archives/366.html</link>
		<comments>http://www.dbalife.com/archives/366.html#comments</comments>
		<pubDate>Mon, 25 Jan 2010 10:17:07 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[secureCRT]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[日志]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=366</guid>
		<description><![CDATA[SecureCRT可以完整记录下所有信息，但是默认的日志文件设置并不好用。
这里给出我的日志文件配置，遵循以下原则：
1、通过浏览文件名可以获得该日志内容的主要信息
2、文件名唯一
3、每个session的日志独立
由此将Logfilename配置为：%H_%Y%M%D_%h%m_%s%t.log
其中：
%H-主机名或主机IP地址
%Y-四位年份
%M-2位月份
%D-2位日期
%h-2位小时数
%m-2位分钟数
%s-2位秒数
%t-2位毫秒数
最后，在logfile的option中，选中“Start log upon connect” 和 “Append to file”。
自此，所有在SecureCRT中显示过的信息都会如实记录在日志文件中。


No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>SecureCRT可以完整记录下所有信息，但是默认的日志文件设置并不好用。</p>
<p>这里给出我的日志文件配置，遵循以下原则：</p>
<blockquote><p>1、通过浏览文件名可以获得该日志内容的主要信息<br />
2、文件名唯一<br />
3、每个session的日志独立</p></blockquote>
<p>由此将Logfilename配置为：%H_%Y%M%D_%h%m_%s%t.log</p>
<blockquote><p>其中：<br />
%H-主机名或主机IP地址<br />
%Y-四位年份<br />
%M-2位月份<br />
%D-2位日期<br />
%h-2位小时数<br />
%m-2位分钟数<br />
%s-2位秒数<br />
%t-2位毫秒数</p></blockquote>
<p>最后，在logfile的option中，选中“Start log upon connect” 和 “Append to file”。</p>
<p>自此，所有在SecureCRT中显示过的信息都会如实记录在日志文件中。</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/366.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH连接慢</title>
		<link>http://www.dbalife.com/archives/313.html</link>
		<comments>http://www.dbalife.com/archives/313.html#comments</comments>
		<pubDate>Wed, 02 Sep 2009 09:19:00 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[GSSAPI]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[连接慢]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=313</guid>
		<description><![CDATA[修改 /etc/ssh/ssh_config，设置 GSSAPIAuthentication no
修改 /etc/ssh/sshd_config，设置 UseDNS no
重启sshd


No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>修改 /etc/ssh/ssh_config，设置 GSSAPIAuthentication no</p>
<p>修改 /etc/ssh/sshd_config，设置 UseDNS no</p>
<p>重启sshd</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/313.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux高危root提权漏洞[09年9月1日]</title>
		<link>http://www.dbalife.com/archives/303.html</link>
		<comments>http://www.dbalife.com/archives/303.html#comments</comments>
		<pubDate>Tue, 01 Sep 2009 01:46:33 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[提权]]></category>
		<category><![CDATA[漏洞]]></category>
		<category><![CDATA[高危]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=303</guid>
		<description><![CDATA[注：本文转载自http://baoz.net/linux-localroot-no-patch-again/
Linux内核漏洞最近几乎是一月一爆，在8月15号才爆了一个几乎通杀所有版本所有内核所有架构的内核漏洞；今天在学生返校的大喜日子里，竟然又爆了一个，通杀内核2.6 &#60; 2.6.19的所有32位Linux，算是google security team给祖国学生的礼物吧。
就现在的情况看，RedHat暂时还没发布官方补丁，貌似也没有什么临时修复方案，系统管理员唯一能做的就是等待再等待。
我想Linux内核的开发团队需要考虑引入微软的SDL安全开发生命周期以增强Linux内核的安全性，否则用户用着真是提心吊胆。
下面展示一下这个漏洞的威力： 

 别说我是标题党，的确是一个命令就可以获得root权限吧，在32位的RHEL4里基本上是百发百中，永不落空。
包子将密切关注RedHat、Debian、Ubuntu、Gentoo等主流发行版针对此漏洞的动向，出于对用户的保护，如果您需要了解和跟踪漏洞的细节，漏洞的重现方式和重现经验，敬请关注 http://baoz.net/linux-localroot-no-patch-again/ 以获取最新资讯
源码在http://www.milw0rm.com/exploits/9542


Related posts:Checkgmail
Linux下无法ssh Cisco PIX防火墙的解决方法
ubuntu7.10处理rsync故障一例



Related posts:<ol><li><a href='http://www.dbalife.com/archives/95.html' rel='bookmark' title='Permanent Link: Checkgmail'>Checkgmail</a></li>
<li><a href='http://www.dbalife.com/archives/86.html' rel='bookmark' title='Permanent Link: Linux下无法ssh Cisco PIX防火墙的解决方法'>Linux下无法ssh Cisco PIX防火墙的解决方法</a></li>
<li><a href='http://www.dbalife.com/archives/99.html' rel='bookmark' title='Permanent Link: ubuntu7.10处理rsync故障一例'>ubuntu7.10处理rsync故障一例</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>注：本文转载自<a href="http://baoz.net/linux-localroot-no-patch-again/">http://baoz.net/linux-localroot-no-patch-again/</a></p>
<p>Linux内核漏洞最近几乎是一月一爆，在8月15号才爆了一个几乎通杀所有版本所有内核所有架构的内核漏洞；今天在学生返校的大喜日子里，竟然又爆了一个，通杀内核2.6 &lt; 2.6.19的所有32位Linux，算是google security team给祖国学生的礼物吧。</p>
<p>就现在的情况看，RedHat暂时还没发布官方补丁，貌似也没有什么临时修复方案，系统管理员唯一能做的就是等待再等待。</p>
<p>我想Linux内核的开发团队需要考虑引入微软的SDL安全开发生命周期以增强Linux内核的安全性，否则用户用着真是提心吊胆。</p>
<p>下面展示一下这个漏洞的威力：<span id="more-3499"> </span></p>
<p><a href="http://baoz.net/wp-content/2009/09/linuxrootagain.png"><img title="linuxrootagain" src="http://baoz.net/wp-content/2009/09/linuxrootagain.png" alt="linuxrootagain" width="404" height="217" /></a></p>
<p> 别说我是标题党，的确是一个命令就可以获得root权限吧，在32位的RHEL4里基本上是百发百中，永不落空。</p>
<p>包子将密切关注RedHat、Debian、Ubuntu、Gentoo等主流发行版针对此漏洞的动向，出于对用户的保护，如果您需要了解和跟踪漏洞的细节，漏洞的重现方式和重现经验，敬请关注 <a href="http://baoz.net/linux-localroot-no-patch-again/">http://baoz.net/linux-localroot-no-patch-again/</a> 以获取最新资讯</p>
<p>源码在<a href="http://www.milw0rm.com/exploits/9542">http://www.milw0rm.com/exploits/9542</a></p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/95.html' rel='bookmark' title='Permanent Link: Checkgmail'>Checkgmail</a></li>
<li><a href='http://www.dbalife.com/archives/86.html' rel='bookmark' title='Permanent Link: Linux下无法ssh Cisco PIX防火墙的解决方法'>Linux下无法ssh Cisco PIX防火墙的解决方法</a></li>
<li><a href='http://www.dbalife.com/archives/99.html' rel='bookmark' title='Permanent Link: ubuntu7.10处理rsync故障一例'>ubuntu7.10处理rsync故障一例</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/303.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu9下flock与输入法的不兼容问题</title>
		<link>http://www.dbalife.com/archives/253.html</link>
		<comments>http://www.dbalife.com/archives/253.html#comments</comments>
		<pubDate>Mon, 22 Jun 2009 02:17:49 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/archives/253.html</guid>
		<description><![CDATA[升级到ubuntu9后，在flock中无法调出输入法，用下面这个方法可以解决问题
编辑flock脚本，在前端添加一行：
export GTK_IM_MODULE=xim
保存退出
Blogged with the Flock Browser

Tags: ubuntu, flock, xim, 输入法



Related posts:Eva在Ubuntu 8.10中崩溃的问题
Ubuntu+nvidia开启双显示器支持
ubuntu8.04安装oracle10遇到的几个小问题



Related posts:<ol><li><a href='http://www.dbalife.com/archives/188.html' rel='bookmark' title='Permanent Link: Eva在Ubuntu 8.10中崩溃的问题'>Eva在Ubuntu 8.10中崩溃的问题</a></li>
<li><a href='http://www.dbalife.com/archives/149.html' rel='bookmark' title='Permanent Link: Ubuntu+nvidia开启双显示器支持'>Ubuntu+nvidia开启双显示器支持</a></li>
<li><a href='http://www.dbalife.com/archives/145.html' rel='bookmark' title='Permanent Link: ubuntu8.04安装oracle10遇到的几个小问题'>ubuntu8.04安装oracle10遇到的几个小问题</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>升级到ubuntu9后，在flock中无法调出输入法，用下面这个方法可以解决问题</p>
<p>编辑flock脚本，在前端添加一行：</p>
<p>export GTK_IM_MODULE=xim</p>
<p>保存退出</p>
<div class="flockcredit" style="text-align: right; color: #CCC; font-size: x-small;">Blogged with the <a href="http://www.flock.com/blogged-with-flock" style="color: #999; font-weight: bold;" target="_new" title="Flock Browser">Flock Browser</a></div>
<p><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">Tags: <a href="http://technorati.com/tag/ubuntu" rel="tag">ubuntu</a>, <a href="http://technorati.com/tag/flock" rel="tag">flock</a>, <a href="http://technorati.com/tag/xim" rel="tag">xim</a>, <a href="http://technorati.com/tag/%E8%BE%93%E5%85%A5%E6%B3%95" rel="tag">输入法</a></p>
<p><!-- technorati tags end --></p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/188.html' rel='bookmark' title='Permanent Link: Eva在Ubuntu 8.10中崩溃的问题'>Eva在Ubuntu 8.10中崩溃的问题</a></li>
<li><a href='http://www.dbalife.com/archives/149.html' rel='bookmark' title='Permanent Link: Ubuntu+nvidia开启双显示器支持'>Ubuntu+nvidia开启双显示器支持</a></li>
<li><a href='http://www.dbalife.com/archives/145.html' rel='bookmark' title='Permanent Link: ubuntu8.04安装oracle10遇到的几个小问题'>ubuntu8.04安装oracle10遇到的几个小问题</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/253.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何在Linux中防御SYN型DOS攻击</title>
		<link>http://www.dbalife.com/archives/207.html</link>
		<comments>http://www.dbalife.com/archives/207.html#comments</comments>
		<pubDate>Fri, 19 Dec 2008 06:22:29 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/archives/207.html</guid>
		<description><![CDATA[&#160;&#160;&#160; 在Linux中防御SYN型DOS攻击的方法比较常见的有增大队列SYN最大半连接数,减小超时值,利用SYN cookie技术,过滤可疑的IP地址等常用方法,下面分别进行分析.

增大队列SYN最大半连接数

&#160;&#160;&#160;&#160; 在Linux中执行命令"sysctl -a&#124;grep net.ipv4.tcp_max_syn_backlog",在返回的"net.ipv4.tcp_max_syn_backlog=256"中显示 Linux队列的最大半连接容量是256.这个默认值对于Web服务器来说是远远不够的,一次简单的SYN攻击就足以将其完全占用.因此,防御DOS攻击最简单的办法就是增大这个默认值,在Linux中执行命令"sysctl -w et.ipv4.tcp_max_syn_backlog=3000",这样就可以将队列SYN最大半连接数容量值改为3000了.

减小超时值

&#160;&#160;&#160; 在Linux中建立TCP连接时,在客户端和服务器之间创建握手过程中,当服务器未收到客户端的确认包时,会重发请求包,一直到超时才将此条目从未连接队列是删除,也就是说半连接存在一定的存活时间,超过这个时间,半连接就会自动断开,在上述SYN攻击测试中,当经过较长的的时间后,就会发现一些半连接已经自动断开了.半连接存活时间实际上是系统所有重传次数等待的超时时间之和,这个值越大,半连接数占用的Backlog队列的时间就越长,系统能处理的 SYN请求就越少,因此,缩短超时时间就可以有效防御SYN攻击,这可以通过缩小重传超时时间和减少重传次数来实现.在Linux中默认的重传次数为5 次,总超时时间为3分钟,在Linux中执行命令"sysctl -w net.ipv4.tcp_synack_retries=1",将超时重传次数设置为1.

利用SYN cookie来防御DOS攻击

&#160;&#160;&#160; 除了在TCP协议栈中开辟一个内存空间来存储半连接数之外,为避免因为SYN请求数量太多,导致该队列被填满的情况下,Linux服务器仍然可以处理新的 SYN连接,可以利用SYN Cookie技术来处理SYN连接.什么是SYN Cookie呢?SYN Cookie是用一个Cookie来响应TCP SYN请求的,在正常的TCP连接过程中,当服务器接收一个SYN数据包,就会返回一个SYN -ACK包来应答,然后进入TCP -SYN -RECV(半开放连接)状态来等待最后返回的ACK包.服务器用一个数据空间来描述所有未决的连接,然而这个数据空间的大小是有限的,所以攻击者将塞满这个空间,在TCP SYN COOKIE的执行过程中,当服务器收到一个SYN包的时候,他返回一个SYN -ACK包,这个数据包的ACK序列号是经过加密的,它由TCP连接的源地址和端口号,目标地址和端口号,以及一个加密种子经过HASH计算得出的,然后服务器释放所有的状态.如果一个ACK包从客户端返回后,服务器重新计算COOKIE来判断它是不是上个SYN -ACK的返回包.如果是的话,服务器就可以直接进入TCP连接状态并打开连接.这样服务器就可以避免守候半开放连接了,在Linux中执行命令"echo "echo "1" &#62; / proc/sys/net/ipv4/tcp_syncookies"&#62; &#62; /etc/rc_local",这样即可启动SYN Cookie,并将其添加到了Linux的启动文件,这样即使系统重启也不影响SYN Cookie的激活状态.

过滤可疑的IP直址

&#160;&#160;&#160; 当客户机对服务器进行攻击时.在服务器上可以进行抓包操作,这样可以对数据包中的IP进行检测,然后再对这些可疑的潮行过滤,从而将其无法正常连接服务器.利用Linux自带的"tcpdump"命令可以实现抓包操作.执行命令"tcpdump -c 1000 -l eth 0 -n dst port 80 &#62; test.txt",就可以在当前目录下创建一个'test.txt"文件,在其中包含大量的网络数据包,通过对该文件的的分析,就很容易得到可疑的客户端IP,之后利用系统自带的"iptables"命令即可对可疑IP进行屏蔽.便如执行命令"iptables -A INPUT -s 219.29.78.79 -d 0/0 [...]


Related posts:<ol><li><a href='http://www.dbalife.com/archives/29.html' rel='bookmark' title='Permanent Link: 偶遇攻击'>偶遇攻击</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp; 在Linux中防御SYN型DOS攻击的方法比较常见的有增大队列SYN最大半连接数,减小超时值,利用SYN cookie技术,过滤可疑的IP地址等常用方法,下面分别进行分析.</p>
<ul>
<li>增大队列SYN最大半连接数</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 在Linux中执行命令"sysctl -a|grep net.ipv4.tcp_max_syn_backlog",在返回的"net.ipv4.tcp_max_syn_backlog=256"中显示 Linux队列的最大半连接容量是256.这个默认值对于Web服务器来说是远远不够的,一次简单的SYN攻击就足以将其完全占用.因此,防御DOS攻击最简单的办法就是增大这个默认值,在Linux中执行命令"sysctl -w et.ipv4.tcp_max_syn_backlog=3000",这样就可以将队列SYN最大半连接数容量值改为3000了.</p>
<ul>
<li>减小超时值</li>
</ul>
<p>&nbsp;&nbsp;&nbsp; 在Linux中建立TCP连接时,在客户端和服务器之间创建握手过程中,当服务器未收到客户端的确认包时,会重发请求包,一直到超时才将此条目从未连接队列是删除,也就是说半连接存在一定的存活时间,超过这个时间,半连接就会自动断开,在上述SYN攻击测试中,当经过较长的的时间后,就会发现一些半连接已经自动断开了.半连接存活时间实际上是系统所有重传次数等待的超时时间之和,这个值越大,半连接数占用的Backlog队列的时间就越长,系统能处理的 SYN请求就越少,因此,缩短超时时间就可以有效防御SYN攻击,这可以通过缩小重传超时时间和减少重传次数来实现.在Linux中默认的重传次数为5 次,总超时时间为3分钟,在Linux中执行命令"sysctl -w net.ipv4.tcp_synack_retries=1",将超时重传次数设置为1.</p>
<ul>
<li>利用SYN cookie来防御DOS攻击</li>
</ul>
<p>&nbsp;&nbsp;&nbsp; 除了在TCP协议栈中开辟一个内存空间来存储半连接数之外,为避免因为SYN请求数量太多,导致该队列被填满的情况下,Linux服务器仍然可以处理新的 SYN连接,可以利用SYN Cookie技术来处理SYN连接.什么是SYN Cookie呢?SYN Cookie是用一个Cookie来响应TCP SYN请求的,在正常的TCP连接过程中,当服务器接收一个SYN数据包,就会返回一个SYN -ACK包来应答,然后进入TCP -SYN -RECV(半开放连接)状态来等待最后返回的ACK包.服务器用一个数据空间来描述所有未决的连接,然而这个数据空间的大小是有限的,所以攻击者将塞满这个空间,在TCP SYN COOKIE的执行过程中,当服务器收到一个SYN包的时候,他返回一个SYN -ACK包,这个数据包的ACK序列号是经过加密的,它由TCP连接的源地址和端口号,目标地址和端口号,以及一个加密种子经过HASH计算得出的,然后服务器释放所有的状态.如果一个ACK包从客户端返回后,服务器重新计算COOKIE来判断它是不是上个SYN -ACK的返回包.如果是的话,服务器就可以直接进入TCP连接状态并打开连接.这样服务器就可以避免守候半开放连接了,在Linux中执行命令"echo "echo "1" &gt; / proc/sys/net/ipv4/tcp_syncookies"&gt; &gt; /etc/rc_local",这样即可启动SYN Cookie,并将其添加到了Linux的启动文件,这样即使系统重启也不影响SYN Cookie的激活状态.</p>
<ul>
<li>过滤可疑的IP直址</li>
</ul>
<p>&nbsp;&nbsp;&nbsp; 当客户机对服务器进行攻击时.在服务器上可以进行抓包操作,这样可以对数据包中的IP进行检测,然后再对这些可疑的潮行过滤,从而将其无法正常连接服务器.利用Linux自带的"tcpdump"命令可以实现抓包操作.执行命令"tcpdump -c 1000 -l eth 0 -n dst port 80 &gt; test.txt",就可以在当前目录下创建一个'test.txt"文件,在其中包含大量的网络数据包,通过对该文件的的分析,就很容易得到可疑的客户端IP,之后利用系统自带的"iptables"命令即可对可疑IP进行屏蔽.便如执行命令"iptables -A INPUT -s 219.29.78.79 -d 0/0 -j REJECT",即可禁止"219.29.78.79"的外部主要访问本机所有端口.其中"-j REJECT"参数表示禁止访问.
<div class="flockcredit" style="text-align: right; color: #CCC; font-size: x-small;">Blogged with the <a href="http://www.flock.com/blogged-with-flock" style="color: #999; font-weight: bold;" target="_new" title="Flock Browser">Flock Browser</a></div>
<p><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">Tags: <a href="http://technorati.com/tag/syn" rel="tag">syn</a>, <a href="http://technorati.com/tag/dos" rel="tag">dos</a>, <a href="http://technorati.com/tag/syn-cookie" rel="tag">syn-cookie</a>, <a href="http://technorati.com/tag/linux" rel="tag">linux</a></p>
<p><!-- technorati tags end --></p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/29.html' rel='bookmark' title='Permanent Link: 偶遇攻击'>偶遇攻击</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/207.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>caucho-request的范围</title>
		<link>http://www.dbalife.com/archives/200.html</link>
		<comments>http://www.dbalife.com/archives/200.html#comments</comments>
		<pubDate>Tue, 16 Dec 2008 08:20:31 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[addhandler]]></category>
		<category><![CDATA[caucho-request]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[resin]]></category>
		<category><![CDATA[sethandler]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/archives/200.html</guid>
		<description><![CDATA[在为Apache+Resin环境添加php支持的时候，php编译安装一切顺利，但是apache不能解析php页面。
发现有这样一些现象：

在任意一个404页面中，服务器信息仅显示Resin，而没有Apache
注释掉httpd.conf中的Resin条目，php可以被解析

说明apache将任意请求都发送给了Resin，而这个resin3.0不能解析php
检查httpd.conf，将SetHandler caucho-request注释掉，重启apache，php解析正常。
当前的httpd.conf中resin部分：
LoadModule caucho_module /opt/apache/modules/mod_caucho.so
ResinConfigServer localhost 6802
CauchoConfigCacheDirectory /tmp
AddHandler caucho-request jsp

在Resin非常模糊的联机文档中提到了caucho-request
"caucho-request&#160; Dispatch a request to Resin"

而在给出的例子中
&#60;Location /foo/*&#62;
&#160;&#160;  SetHandler caucho-request
&#60;/Location&#62;

将caucho-request的范围限定在/foo/
Blogged with the Flock Browser

Tags: resin, caucho-request, addhandler, sethandler, php, jsp



Related posts:Apache2与Resin2整合虚拟主机的配置
resin的优化
linux php 扩展库编译——添加cURL模块



Related posts:<ol><li><a href='http://www.dbalife.com/archives/126.html' rel='bookmark' title='Permanent Link: Apache2与Resin2整合虚拟主机的配置'>Apache2与Resin2整合虚拟主机的配置</a></li>
<li><a href='http://www.dbalife.com/archives/7.html' rel='bookmark' title='Permanent Link: resin的优化'>resin的优化</a></li>
<li><a href='http://www.dbalife.com/archives/109.html' rel='bookmark' title='Permanent Link: linux php 扩展库编译——添加cURL模块'>linux php 扩展库编译——添加cURL模块</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>在为Apache+Resin环境添加php支持的时候，php编译安装一切顺利，但是apache不能解析php页面。</p>
<p>发现有这样一些现象：</p>
<ul>
<li>在任意一个404页面中，服务器信息仅显示Resin，而没有Apache</li>
<li>注释掉httpd.conf中的Resin条目，php可以被解析</li>
</ul>
<p>说明apache将任意请求都发送给了Resin，而这个resin3.0不能解析php</p>
<p>检查httpd.conf，将SetHandler caucho-request注释掉，重启apache，php解析正常。</p>
<p>当前的httpd.conf中resin部分：</p>
<div style="margin-left: 40px;">LoadModule caucho_module /opt/apache/modules/mod_caucho.so<br />
ResinConfigServer localhost 6802<br />
CauchoConfigCacheDirectory /tmp<br />
AddHandler caucho-request jsp
</div>
<p>在Resin非常模糊的联机文档中提到了caucho-request</p>
<div style="margin-left: 40px;">"caucho-request&nbsp; Dispatch a request to Resin"
</div>
<p>而在给出的例子中</p>
<div style="margin-left: 40px;">&lt;Location /foo/*&gt;<br />
&nbsp;&nbsp;  SetHandler caucho-request<br />
&lt;/Location&gt;
</div>
<p>将caucho-request的范围限定在/foo/</p>
<div class="flockcredit" style="text-align: right; color: #CCC; font-size: x-small;">Blogged with the <a href="http://www.flock.com/blogged-with-flock" style="color: #999; font-weight: bold;" target="_new" title="Flock Browser">Flock Browser</a></div>
<p><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">Tags: <a href="http://technorati.com/tag/resin" rel="tag">resin</a>, <a href="http://technorati.com/tag/caucho-request" rel="tag">caucho-request</a>, <a href="http://technorati.com/tag/addhandler" rel="tag">addhandler</a>, <a href="http://technorati.com/tag/sethandler" rel="tag">sethandler</a>, <a href="http://technorati.com/tag/php" rel="tag">php</a>, <a href="http://technorati.com/tag/jsp" rel="tag">jsp</a></p>
<p><!-- technorati tags end --></p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/126.html' rel='bookmark' title='Permanent Link: Apache2与Resin2整合虚拟主机的配置'>Apache2与Resin2整合虚拟主机的配置</a></li>
<li><a href='http://www.dbalife.com/archives/7.html' rel='bookmark' title='Permanent Link: resin的优化'>resin的优化</a></li>
<li><a href='http://www.dbalife.com/archives/109.html' rel='bookmark' title='Permanent Link: linux php 扩展库编译——添加cURL模块'>linux php 扩展库编译——添加cURL模块</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/200.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PS状态码</title>
		<link>http://www.dbalife.com/archives/199.html</link>
		<comments>http://www.dbalife.com/archives/199.html#comments</comments>
		<pubDate>Tue, 02 Dec 2008 07:57:42 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ps]]></category>
		<category><![CDATA[stat]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/archives/ps%e7%8a%b6%e6%80%81%e7%a0%81/</guid>
		<description><![CDATA[PROCESS STATE CODES
Here are the different values that the s, stat and state output specifiers
(header "STAT" or "S") will display to describe the state of a process.
D    Uninterruptible sleep (usually IO)
R    Running or runnable (on run queue)
S    Interruptible sleep (waiting for an event to complete)
T  [...]


Related posts:<ol><li><a href='http://www.dbalife.com/archives/17.html' rel='bookmark' title='Permanent Link: Solaris系统启动过程'>Solaris系统启动过程</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: bold;">PROCESS STATE CODES</span></p>
<hr style="width: 100%; height: 2px;" />Here are the different values that the s, stat and state output specifiers<br />
(header "STAT" or "S") will display to describe the state of a process.<br />
D    Uninterruptible sleep (usually IO)<br />
R    Running or runnable (on run queue)<br />
S    Interruptible sleep (waiting for an event to complete)<br />
T    Stopped, either by a job control signal or because it is being traced.<br />
W    paging (not valid since the 2.6.xx kernel)<br />
X    dead (should never be seen)<br />
Z    Defunct ("zombie") process, terminated but not reaped by its parent.</p>
<p>For BSD formats and when the stat keyword is used, additional characters may<br />
be displayed:<br />
&lt;    high-priority (not nice to other users)<br />
N    low-priority (nice to other users)<br />
L    has pages locked into memory (for real-time and custom IO)<br />
s    is a session leader<br />
l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)<br />
+    is in the foreground process group</p>
<div class="flockcredit" style="text-align: right; color: #CCC; font-size: x-small;">Blogged with the <a style="color: #999; font-weight: bold;" title="Flock Browser" href="http://www.flock.com/blogged-with-flock" target="_new">Flock Browser</a></div>
<p><!-- technorati tags begin --></p>
<p style="font-size:10px;text-align:right;">Tags: <a rel="tag" href="http://technorati.com/tag/ps">ps</a>, <a rel="tag" href="http://technorati.com/tag/stat">stat</a>, <a rel="tag" href="http://technorati.com/tag/%E7%8A%B6%E6%80%81">状态</a></p>
<p><!-- technorati tags end --></p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/17.html' rel='bookmark' title='Permanent Link: Solaris系统启动过程'>Solaris系统启动过程</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/199.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
