<?xml version="1.0" encoding="UTF-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html"><![CDATA[苦咖啡-网络安全爱好者-我不在乎自己有多少伤痕累累，我只在乎今后你让谁陪]]></title>
  <subtitle type="html"><![CDATA[网络中我能呼风唤雨,而现实中我却是寸步难行, ------------ 苦咖啡]]></subtitle>
  <id>http://www.kukafei520.net/blog/</id>
  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/" /> 
  <link rel="self" type="application/atom+xml" href="http://www.kukafei520.net/blog/atom.asp" /> 
  <generator uri="http://www.pjhome.net/" version="2.8">PJBlog3</generator> 
  <updated>2010-08-29T16:49:06+08:00</updated>

  <entry>
	  <title type="html"><![CDATA[tomcat优化方案 apr+tomcat-native [原创]]]></title>
	  <author>
		 <name>苦咖啡</name>
		 <uri>http://www.kukafei520.net/blog/</uri>
		 <email>voilet119@163.com</email>
	  </author>
	  <category term="" scheme="http://www.kukafei520.net/blog/default.asp?cateID=5" label="网络技术" /> 
	  <updated>2010-08-29T16:49:06+08:00</updated>
	  <published>2010-08-29T16:49:06+08:00</published>
		  <summary type="html"><![CDATA[使用apr和tomcat-native优化tomcat，提高tomcat的性能。<br/><br/>Apache Tomcat Native library 是干什么的呢?<br/>这是 Apache 为了提升 Tomcat 的性能搞的一套本地化 Socket, Thread, IO 组件也就是说它有高级 IO 功能, 操作系统级别的功能调用, 以及本地进程处理等等, 这些都能使 Tomcat 更像一个 Web Server(像Apache那样), 而不是只能用来解释JSP, 也就是说提升单独的 Tomcat 作为服务器的吞吐性能.<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;一般情况下，APR开发包很轻易理解为仅仅是一个开发包，不过事实上并不是。目前，完整的APR实际上包含了三个开发包：apr、apr-util以及apr-iconv，每一个开发包分别独立开发，并拥有自己的版本。<br/>apr包含了一些通用的开发组件，包括mmap，文件等等，前面已经描述过。<br/>apr-util也是包含了一些常用的开发组件。这些组件与apr目录下的相比，它与apache的关系更加密切一些。比如存储段和存储段组，加密等等。<br/>apr-iconv包中的文件主要用于实现iconv编码。目前的大部分编码转换过程都是与本地编码相关的。在进行转换之前必须能够正确地设置本地编码。因此假如两个非本地编码A和B需要转换，则转换过程大致为A-&gt;Local以及Local-&gt;B或者B-&gt;Local以及Local-&gt;A。<br/>XPG2 标准中另外定义了一组全新的函式接口ICONV，该接口是一种更广义的字集转换系统。也是一个与本地编码无关的字集转换系统。APR中也支持这种字集转换系统，为此它提供了完整的实现。Apr-iconv正是为此目的而产生。<br/><br/>此次安装在64位centos 5.5系统<br/>32位系统只需装32位jdk即可<br/><br/>所需文件<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code54592);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code54592><br/>1.&nbsp;&nbsp; jdk-6u21-linux-x64.bin<br/><a href="http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u21-linux-x64.bin?BundledLineItemUUID=H1eJ_hCyf.AAAAEqFAYUA7zE" target="_blank" rel="external">http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u21-linux-x64.bin?BundledLineItemUUID=H1eJ_hCyf.AAAAEqFAYUA7zE</a>&amp;OrderID=cFSJ_hCyoZEAAAEqAAYUA7zE&amp;ProductID=xKiJ_hCySHIAAAEpT7wzBGsB&amp;FileName=/jdk-6u21-linux-x64.bin<br/><br/>2.&nbsp;&nbsp; apr-1.4.2.tar<br/><a href="http://labs.renren.com/apache-mirror//apr/apr-1.4.2.tar.gz" target="_blank" rel="external">http://labs.renren.com/apache-mirror//apr/apr-1.4.2.tar.gz</a><br/><br/>3.&nbsp;&nbsp;&nbsp;&nbsp;apr-iconv-1.2.1.tar.gz<br/><a href="http://labs.renren.com/apache-mirror//apr/apr-iconv-1.2.1.tar.gz" target="_blank" rel="external">http://labs.renren.com/apache-mirror//apr/apr-iconv-1.2.1.tar.gz</a><br/><br/>4.&nbsp;&nbsp;&nbsp;&nbsp;apr-util-1.3.9.tar<br/><a href="http://labs.renren.com/apache-mirror//apr/apr-util-1.3.9.tar.gz" target="_blank" rel="external">http://labs.renren.com/apache-mirror//apr/apr-util-1.3.9.tar.gz</a><br/><br/>5.&nbsp;&nbsp;&nbsp;&nbsp;tomcat-native<br/><a href="http://apache.etoak.com//tomcat/tomcat-connectors/native/1.1.20/source/tomcat-native-1.1.20-src.tar.gz" target="_blank" rel="external">http://apache.etoak.com//tomcat/tomcat-connectors/native/1.1.20/source/tomcat-native-1.1.20-src.tar.gz</a><br/></div></div><br/>安装jdk<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code46306);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code46306><br/>chmod +x jdk-6u21-linux-x64.bin<br/>./jdk-6u21-linux-x64.bin<br/>mv jdk1.6.0_21/ /usr/local/<br/></div></div><br/><br/>设置环境变量<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code24280);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code24280><br/>vi /etc/profile<br/>export JAVA_HOME=/usr/local/jdk1.6.0_21<br/>export CLASSPATH=/usr/local/jdk1.6.0_21/lib/dt.jar:/usr/local/jdk1.6.0_21/lib/tools.jar<br/>export PATH=/usr/local/jdk1.6.0_21/bin:$PATH<br/>export PATH JAVA_HOME CLASSPATH<br/></div></div><br/><br/>安装tomcat<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code63801);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code63801><br/>tar zxvf apache-tomcat-7.0.2.tar.gz<br/>mv apache-tomcat-7.0.2 /usr/local/webserver/<br/>vi /usr/local/webserver/tomcat/bin/catalina.sh<br/></div></div><br/>在程序开头添加一句<br/>JAVA_HOME=/usr/local/jdk1.6.0_21<br/><br/>优化tomcat<br/>安装apr<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code45238);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code45238><br/>tar zxvf apr-1.4.2.tar<br/>cd apr-1.4.2<br/>./configure --prefix=/usr/local/apr<br/>make<br/>make install<br/></div></div><br/>安装apr-iconv<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code27484);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code27484><br/>tar -zxvf apr-iconv-1.2.1.tar.gz<br/>cd apr-iconv-1.2.1<br/>./configure --prefix=/usr/local/apr-iconv --with-apr=/usr/local/apr <br/> make<br/> make install<br/></div></div><br/>安装apr-util<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code54188);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code54188><br/>tar zxvf apr-util-1.3.9.tar.gz<br/>cd apr-util-1.3.9<br/>./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr --with-apr-iconv=/usr/local/apr-iconv/bin/apriconv <br/>make<br/>make install<br/></div></div><br/>安装tomcat-native<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code74078);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code74078><br/>tar zxvf tomcat-native-1.1.20-src.tar.gz <br/>cd tomcat-native-1.1.20-src/jni/native&nbsp;&nbsp; <br/>./configure --with-apr=/usr/local/apr --with-java-home=/usr/local/jdk1.6.0_21&nbsp;&nbsp; <br/>make <br/>make install<br/></div></div><br/>添加环境变量<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code40965);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code40965><br/>echo &#34;export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib&#34; &gt;&gt;/etc/profile&nbsp;&nbsp;&nbsp;&nbsp;<br/>source /etc/profile<br/></div></div><br/>启动tomcat<br/>/usr/local/webserver/tomcat/bin/start.sh<br/>less /usr/local/webserver/tomcat/logs/catalina.out<br/><br/>即可看到<br/>Aug 29, 2010 3:47:32 PM o&#114;g.apache.catalina.core.AprLifecycleListener init<br/>INFO: Loaded APR based Apache Tomcat Native library 1.1.20.<br/>表显已优化完成<br/><br/>&nbsp;&nbsp;]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/article.asp?id=432" /> 
	  <id>http://www.kukafei520.net/blog/default.asp?id=432</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[tomcat wrong ELF class: ELFCLASS64报错解决方法[原创]]]></title>
	  <author>
		 <name>苦咖啡</name>
		 <uri>http://www.kukafei520.net/blog/</uri>
		 <email>voilet119@163.com</email>
	  </author>
	  <category term="" scheme="http://www.kukafei520.net/blog/default.asp?cateID=5" label="网络技术" /> 
	  <updated>2010-08-29T16:24:34+08:00</updated>
	  <published>2010-08-29T16:24:34+08:00</published>
		  <summary type="html"><![CDATA[最近一直在做系统及程序优化，原32位系统升级为64位系统，在对tomcat进行优化后，启动控制台报错，现提供本人解决方法<br/>以下为报错代码<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code10022);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code10022><br/>java.lang.UnsatisfiedLinkError: /usr/local/apr/lib/libtcnative-1.so.0.1.20: /usr/local/apr/lib/libtcnative-1.so.0.1.20: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.ClassLoader$NativeLibrary.load(Native Method)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.Runtime.loadLibrary0(Runtime.java:823)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.System.loadLibrary(System.java:1030)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.tomcat.jni.Library.&lt;init&gt;(Library.java:42)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.tomcat.jni.Library.initialize(Library.java:168)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.reflect.Method.invoke(Method.java:597)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:157)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.catalina.core.AprLifecycleListener.isAprAvailable(AprLifecycleListener.java:81)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.catalina.connector.Connector.setProtocol(Connector.java:513)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.catalina.connector.Connector.&lt;init&gt;(Connector.java:69)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.catalina.startup.ConnectorCr&#101;ateRule.begin(ConnectorCr&#101;ateRule.java:62)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.tomcat.util.digester.Digester.startElement(Digester.java:1283)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.tomcat.util.digester.Digester.parse(Digester.java:1544)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.catalina.startup.Catalina.load(Catalina.java:524)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.catalina.startup.Catalina.load(Catalina.java:560)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.reflect.Method.invoke(Method.java:597)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at o&#114;g.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)<br/>Aug 29, 2010 2:47:14 PM o&#114;g.apache.catalina.core.AprLifecycleListener init<br/>INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/local/jdk1.6.0_07/jre/lib/i386/client:/usr/local/jdk1.6.0_&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 07/jre/lib/i386:/usr/local/jdk1.6.0_07/jre/../lib/i386::/usr/local/apr/lib:/usr/java/packages/lib/i386:/li&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b:/usr/lib<br/><br/></div></div><br/><br/>因更换系统后，原jdk 1.6.0_07不支持apr，故要将jdk进行升级，本人升级为jdk-6.21后圆满解决此问题<br/>以下为jdk-6.21下载地址<br/><a href="http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u21-linux-x64.bin?BundledLineItemUUID=H1eJ_hCyf.AAAAEqFAYUA7zE" target="_blank" rel="external">http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u21-linux-x64.bin?BundledLineItemUUID=H1eJ_hCyf.AAAAEqFAYUA7zE</a>&amp;OrderID=cFSJ_hCyoZEAAAEqAAYUA7zE&amp;ProductID=xKiJ_hCySHIAAAEpT7wzBGsB&amp;FileName=/jdk-6u21-linux-x64.bin<br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/article.asp?id=431" /> 
	  <id>http://www.kukafei520.net/blog/default.asp?id=431</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[当你说没有好男人时请看看 －－[转载]]]></title>
	  <author>
		 <name>苦咖啡</name>
		 <uri>http://www.kukafei520.net/blog/</uri>
		 <email>voilet119@163.com</email>
	  </author>
	  <category term="" scheme="http://www.kukafei520.net/blog/default.asp?cateID=7" label="杂七杂八" /> 
	  <updated>2010-08-22T17:41:00+08:00</updated>
	  <published>2010-08-22T17:41:00+08:00</published>
		  <summary type="html"><![CDATA[十岁以前，就不说了，无非是淘气和不懂事。<br/><br/>十三、四岁的时候，开始对女孩有好感，但是那时候他离女孩远远的，并且以讨厌女孩自居，生怕被同伴嘲笑。<br/><br/>十五岁的时候，听到大人们说某某男人好花，把女朋友甩了，女孩自杀了。他觉得这人真狠毒，自己将来一定要做个痴情的男人，一定要一生只爱一个人。<br/><br/>十六岁的时候，他喜欢上了一个女孩，但是他不敢和她说。仍然和往常一样，脏兮兮的在灰土飞扬的操场上踢球。只在女孩走出校门的时候，躲在二层的窗户上看她的背影,他觉得她一定是个天使。<br/><br/>十七岁的时候，有个女孩喜欢上了他，但是他离她很远，他心里面只有自己那个女孩， 他觉得看别的女孩都是对她的不忠。<br/><br/>十八岁的时候，看了一个MTV，感动得想哭，他想，如果自己的女孩失去了双眼，他一定 男主角会毫不犹豫的把自己的眼睛给她，让她能看到光明。<br/><br/>十九岁的时候，高考了。终于和自己暗恋的女孩分别，坐火车去学校的时候，感觉自己离她越来越远，心像被掏空了一样。还在想自己一定不会忘记她，等到自己成功以后一定要去找她。<br/><br/>二十岁的时候，听到有人讲黄色笑话，觉得这人真可耻。<br/><br/>二十一岁的时候，她的回信中告诉他，自己有了男朋友。偷偷的哭了一个晚上。<br/><br/>二十二岁的时候，他向一个女孩表白，女孩说“你是个好人，可是我还小。”他想，我的确是个好人，他说“没关系，我可以等你。”心想，我不会像那些花心的人一样，三年五年我也能等。<br/><br/>二十三岁的时候，说自己还小的女孩和一个帅哥恋爱了。他很纳闷，长大原来可以这快。<br/><br/>二十四岁的时候，他又向一个女孩表白，女孩说“你是个好人，可是我并不适合你。” 他纳闷很久，我是好人你怎么还不适合我呢？<br/><br/>二十五岁的时候，他又追求一个女孩，女孩接受了他。他开始很幸福的为未来拼搏，他 想，一时的开心只是暂时的，只有努力拼搏，他和她才能有快乐的未来，但是，半年以 后，女孩和他分手了。只是因为另外一个男孩会说让她开心的话。女孩说“你是个好人 ，是我对不起你。”他似乎明白了问题所在，他是个好人。<br/><br/>二十六岁的时候，他开始堕落，交网友。打扮得时尚而酷，而且渐渐的学习着讨好女孩 的话。不久，他有了个女朋友，虽然他对她也很好，可是，他心里知道，自己并不爱她 。<br/><br/>二十七岁的时候，他和女孩分手了。他对女孩说“你是个好女孩，是我对不起你。”<br/><br/>二十八岁的时候，他尝试了一夜情，发现别人能做的，自己也一样。<br/><br/>二十九岁的时候，他学会了讲黄色笑话，并且以看旁边的女孩子脸红为乐趣。<br/><br/>三十岁的时候，他忽然发现自己变得很有能力追求到女孩，但是却没有了爱的能力。于 是<br/><br/>他在自己QQ上写下了如下的话 *****************************************<br/><br/>其实每个男孩，本来都是想做一个感情专一的好男人的。<br/>其实每个男孩，本来看女孩子都是看脸而不是胸部的。<br/>其实每个男孩，本来都是不会讲黄色笑话的。<br/>其实每个男孩，本来都是渴望爱一个人直到永远的。<br/>只是，没有任何女孩爱这样的男孩，她们觉得这样的男孩太幼稚，太古板，没有情趣。<br/>于是男孩开始改变，变成女孩喜欢的那种 嘴角挂着坏坏的笑,玩世不恭或者幽默<br/>开始学会说甜言蜜语而不是心里想说的话 开始学会假装关心，学会给女孩送小饰物讨好她<br/><br/>学会如何追求，如何把握爱情。 或者看破红尘，游戏情场，成为女人恨恨的那种男人<br/>他们可以很容易俘获女孩子的心 但是他们也会在黑的夜里叼着烟流泪 心里有爱的时候，没有女孩.有了女孩，却永远没有了爱的感觉 在听到女人抱怨世上没有一个好男人时候 他们不会再去努力做个好男人，只是微笑着擦肩而过<br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/article.asp?id=430" /> 
	  <id>http://www.kukafei520.net/blog/default.asp?id=430</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[就算我瞎了眼---不错的歌]]></title>
	  <author>
		 <name>苦咖啡</name>
		 <uri>http://www.kukafei520.net/blog/</uri>
		 <email>voilet119@163.com</email>
	  </author>
	  <category term="" scheme="http://www.kukafei520.net/blog/default.asp?cateID=7" label="杂七杂八" /> 
	  <updated>2010-07-29T15:32:24+08:00</updated>
	  <published>2010-07-29T15:32:24+08:00</published>
		  <summary type="html"><![CDATA[这世间怕寂寞的人太多 <br/>动不动就犯错 <br/>我就是其中一个 <br/>怎么会看不懂爱情的堕落 <br/>这世界会假装的人太多 <br/>爱不爱都难受 <br/>你就是这么一个 <br/>转眼就露出了厌倦的冷漠 <br/>就算我瞎了眼 看不见 <br/>生生的被你欺骗 <br/>这该死的诺言到头来 <br/>只变成可笑的谎言 <br/>就算我瞎了眼 犯的贱 <br/>狠狠的把心撕裂 <br/>那所谓的永远到最后 <br/>只划下短暂的句点 <br/>这世界会假装的人太多 <br/>爱不爱都难受 <br/>你就是这么一个 <br/>转眼就露出了厌倦的冷漠 <br/>就算我瞎了眼 看不见 <br/>生生的被你欺骗 <br/>这该死的诺言到头来 <br/>只变成可笑的谎言 <br/>就算我瞎了眼 犯的贱 <br/>狠狠的把心撕裂 <br/>那所谓的永远到最后 <br/>只划下短暂的句点 <br/>明明已变了心 断了情 <br/>何必还装什么叹息 <br/>也只好算了命 决了定 <br/>要把你干脆的忘记 <br/>就算我瞎了眼 看不见 <br/>生生的被你欺骗 <br/>这该死的诺言到头来 <br/>只变成可笑的谎言 <br/>就算我瞎了眼 犯的贱 <br/>狠狠的把心撕裂 <br/>那所谓的永远到最后 <br/>只划下短暂的句点<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.kukafei520.net/blog/images/music.gif" alt="" style="margin:0px 2px -3px 0px" border="0"/>播放音频文件</div><div class="UBBContent"><a id="temp16907_href" href="http://www.kukafei520.net/blog/javascript:MediaShow('wma','temp16907','http://mul1.tximg.cn/music/group/bbs/mp3/81/090516/1242470997827.mp3','400','300')"><img name="temp16907_img" src="http://www.kukafei520.net/blog/images/mm_snd.gif" style="margin:0px 3px -2px 0px" border="0" alt=""/><span id="temp16907_text">在线播放</span></a><div id="temp16907"></div></div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/article.asp?id=428" /> 
	  <id>http://www.kukafei520.net/blog/default.asp?id=428</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[[转载]与智者同行，你会不同凡响；与高人为伍，你能登上巅峰]]></title>
	  <author>
		 <name>苦咖啡</name>
		 <uri>http://www.kukafei520.net/blog/</uri>
		 <email>voilet119@163.com</email>
	  </author>
	  <category term="" scheme="http://www.kukafei520.net/blog/default.asp?cateID=7" label="杂七杂八" /> 
	  <updated>2010-07-17T10:41:32+08:00</updated>
	  <published>2010-07-17T10:41:32+08:00</published>
		  <summary type="html"><![CDATA[在现实生活中，你和谁在一起的确很重要，甚至能改变你的成长轨迹，决定你的人生成败。和什么样的人在一起，就会有什么样的人生。和勤奋的人在一起，你不会懒惰；和积极的人在一起，你不会消沉；与智者同行，你会不同凡响；与高人为伍，你能登上巅峰。 <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;科学家研究认为：“人是唯一能接受暗示的动物。”积极的暗示，会对人的情绪和生理状态产生良好的影响，激发人的内在潜能，发挥人的超常水平，使人进取，催人奋进。远离消极的的人吧！否则，他们会在不知不觉中偷走你的梦想，使你渐渐颓废，变得平庸。 <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;积极的人像太阳，照到哪里哪里亮；消极的人像月亮，初一十五不一样。态度决定一切。有什么态度，就有什么样的未来；性格决定命运。有怎样的性格，就有怎样的人生。 <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;有人说，人生有三大幸运：上学时遇到好老师，工作时遇到一位好师傅，成家时遇到一个好伴侣。有时他们一个甜美的笑容，一句温馨的问候，就能使你的人生与众不同，光彩照人；生活中最不幸的是：由于你身边缺乏积极进取的人，缺少远见卓识的人，使你的人生变得平平庸庸，黯然失色。 <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;有句话说得好，你是谁并不重要，重要的是你和谁在一起。古有“孟母三迁”，足以说明和谁在一起的确很重要。雄鹰在鸡窝里长大，就会失落 去飞翔的本领，怎能博击长空，翱翔蓝天？野狼在羊群里成长，也会“爱上羊”而丧失狼性，怎能叱咤风云，驰骋大地？ <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;原本你很优秀，由于周围那些消极的人影响了你，使你缺乏向上的压力，丧失前进的动力而变得俗不可耐，如此平庸。不是有这样的观念吗？大多数人带着未演奏的乐曲走进了坟墓。 <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;如果你想像雄鹰一样翱翔天空，那你就要和群鹰一起飞翔，而不要与燕雀为伍；如果你想像野狼一样驰骋大地，那就要和野狼群一起奔跑，而不能与鹿羊同行；正所谓“画眉麻雀不同嗓，金鸡乌鸦不同窝。”这也许就是潜移默化的力量和耳濡目染的作用。如果你想聪明，那你就要和聪明的人在一起，你才会更加睿智；如果你想优秀，那你就要和优秀的人在一起，你才会出类拔萃。 <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;读好书，交高人，乃人生两大幸事。一个人的身份的高低，是由他周围的朋友决定的。朋友越多，意味着你的价值越高，对你的事业帮助越大。朋友是你一生不可缺的宝贵财富。因为朋友的激励和相助，你才会战无不胜，一往无前。人生的奥妙之处就在于与人相处，携手同行。生活的美好之处则在于送人玫瑰，手留余香。 <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;人生就是这样。想和聪明的人在一起，你就得聪明；想和优秀的人在一起，你就得优秀。善于发现别人的优点，并把它转化成自己的长处，你就会成为聪明人；善于把握人生的机遇，并把它转化成自己的机遇，你就会成为优秀者。对他人的成功像对待自己的成功一样充满热情。学最好的别人，做最好的自己。借人之智，成就自己，此乃成功之道。 <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;和不一样的人在一起，就会有不一样的人生。爱情、婚姻如此，家庭、事业也如此]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/article.asp?id=427" /> 
	  <id>http://www.kukafei520.net/blog/default.asp?id=427</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[平凡的日子郁闷的过]]></title>
	  <author>
		 <name>苦咖啡</name>
		 <uri>http://www.kukafei520.net/blog/</uri>
		 <email>voilet119@163.com</email>
	  </author>
	  <category term="" scheme="http://www.kukafei520.net/blog/default.asp?cateID=7" label="杂七杂八" /> 
	  <updated>2010-07-04T21:07:01+08:00</updated>
	  <published>2010-07-04T21:07:01+08:00</published>
		  <summary type="html"><![CDATA[最近不知道怎么了，脑子空空的，除了下班不想回家，连周末休息也都会去办公室坐坐，想着太多不该在去想的事，只是做什么事情的时候突然还是会跳出来<br/>所有的事情有谁能知道，谁能控制了，难到一切都是错的吗，真的是我太自大，太自以为事，原以为已经磨平自己的傲气，只是在别人眼中还是什么都不是，一切一切<br/>脑子很乱，不知道该说什么，或许最多的就是自己静静的听听歌，感觉要好一些吧，其实那些歌名自己是根本都不知道的，只不过是打发一下时间，郁闷的生活]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/article.asp?id=426" /> 
	  <id>http://www.kukafei520.net/blog/default.asp?id=426</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[真真假假]]></title>
	  <author>
		 <name>苦咖啡</name>
		 <uri>http://www.kukafei520.net/blog/</uri>
		 <email>voilet119@163.com</email>
	  </author>
	  <category term="" scheme="http://www.kukafei520.net/blog/default.asp?cateID=7" label="杂七杂八" /> 
	  <updated>2010-06-22T23:45:55+08:00</updated>
	  <published>2010-06-22T23:45:55+08:00</published>
		  <summary type="html"><![CDATA[好久好久没有在写日志，忙完这阵子，自己也静了这阵子，虽然用工作来压着自己不去想一些事情，确实不是那么的痛，但是日子还是自己一步步走的，中间的过程只有自己知道，我努力的做好一个最好的演员，至于评价则则别人来说吧，这是我的生活，你只可以评价无权指责，生活中的真真假假，又有多少人能够知道，有多少人能够分的清，正确的时候你没有把握，而在一个错误的时间内，你却像抓到了救命的稻草，可能生活中到处都是这样，只是看自己如去走这一步<br/>一年多来的种种事情，或许不敢回想，也有太多可圈可点的事情发生，欣慰。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/article.asp?id=425" /> 
	  <id>http://www.kukafei520.net/blog/default.asp?id=425</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[把家弄成酒吧的气氛]]></title>
	  <author>
		 <name>苦咖啡</name>
		 <uri>http://www.kukafei520.net/blog/</uri>
		 <email>voilet119@163.com</email>
	  </author>
	  <category term="" scheme="http://www.kukafei520.net/blog/default.asp?cateID=7" label="杂七杂八" /> 
	  <updated>2010-06-15T22:32:27+08:00</updated>
	  <published>2010-06-15T22:32:27+08:00</published>
		  <summary type="html"><![CDATA[最近一直都不顺，什么事情都不顺，很烦，想用工作来压着自己，时间长了感觉好压郁，好郁闷，今天去中关村买了套音箱，音质很不错，然后在去宜家买了酒吧的香味蜡烛，回家关掉家里的灯，点着蜡烛，听着音乐，喝着加了冰块的啤酒，给家里打了个电话，这才是一种生活，这才是我的生活，干吗要让自己这么累，放松下不好吗，努力的控制自己，让自己静静，或许有些事情真不是自己能控制的，唯一能做的只能是让自己平静，一个人听着音乐真的很不错，原来在家也有酒吧的气氛，这种感觉真的很好很好]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/article.asp?id=424" /> 
	  <id>http://www.kukafei520.net/blog/default.asp?id=424</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[nginx漏洞扫描]]></title>
	  <author>
		 <name>苦咖啡</name>
		 <uri>http://www.kukafei520.net/blog/</uri>
		 <email>voilet119@163.com</email>
	  </author>
	  <category term="" scheme="http://www.kukafei520.net/blog/default.asp?cateID=5" label="网络技术" /> 
	  <updated>2010-05-21T13:59:15+08:00</updated>
	  <published>2010-05-21T13:59:15+08:00</published>
		  <summary type="html"><![CDATA[#!usr/bin/perl -w<br/>#来源1： <a href="http://www.80sec.com/nginx-securit.html" target="_blank" rel="external">http://www.80sec.com/nginx-securit.html</a><br/>#来源2:&nbsp;&nbsp;<a href="http://www.honker.net/News/announcement/2010-05-21/4610.html" target="_blank" rel="external">http://www.honker.net/News/announcement/2010-05-21/4610.html</a><br/>#用处：测试nginx是否存在该漏洞<br/>use LWP;<br/>use LWP::ConnCache;<br/>my $browser = LWP::UserAgent-&gt;new;<br/>$browser-&gt;timeout( 15 );<br/>my $conncache = LWP::ConnCache-&gt;new;&#160;&#160;&#160;&#160;<br/>$browser-&gt;conn_cache($conncache);<br/><br/>#先用列表吧，没有用记事本保存列表再读再扫嘿嘿<br/>my @bbslist1;<br/>push @bbslist1,&#34;<a href="http://bbs.xxx.com/robots.txt" target="_blank" rel="external">http://bbs.xxx.com/robots.txt</a>&#34;;<br/>push @bbslist1,&#34;<a href="http://bbs.yyy.com/robots.txt" target="_blank" rel="external">http://bbs.yyy.com/robots.txt</a>&#34; ;<br/>push @bbslist1,&#39;<a href="http://bbs.pctutu.com/robots.txt" target="_blank" rel="external">http://bbs.pctutu.com/robots.txt</a>&#39;;<br/>push @bbslist1,&#39;<a href="http://bbs.yahoo.cn/robots.txt" target="_blank" rel="external">http://bbs.yahoo.cn/robots.txt</a>&#39;;<br/><br/>#Server: nginx/0.8.13<br/>#Content-Type: text/html<br/><br/>print &#34;\t\tNginx漏洞扫描程序 By x13ky\@qq.com\n\n&#34;;<br/>foreach my $url (@bbslist1){<br/>&nbsp;&nbsp;print &#34;目前正在扫描：$url\n&#34;;<br/>&#160;&#160;&#160;&#160;my&#160;&#160;&#160;&#160;$response= $browser-&gt;get( $url); <br/>&#160;&#160;&#160;&#160;$response-&gt;is_success o&#114; say(&#34;Failed to get &#39;$url&#39;:\n&#34;, $response-&gt;status_line);<br/>&#160;&#160;&#160;&#160;my $servertype = $response-&gt;server;<br/>&nbsp;&nbsp;print &#34;$servertype\n&#34;;<br/>&#160;&#160;&#160;&#160;if ($servertype=~/nginx/){<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;my $typeold=$response-&gt;content_type;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;print &#34;$typeold\n&#34;;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;my $url2=$url.&#39;/xysky.php&#39;;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;my&#160;&#160;&#160;&#160;$response2 = $browser-&gt;get( $url2); <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$response2-&gt;is_success o&#114; say(&#34;Failed to get &#39;$url2&#39;:\n&#34;, $response-&gt;status_line);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;my $typenew=$response2-&gt;content_type;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;print &#34;$typenew\n&#34;;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if ($typeold eq $typenew){<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&nbsp;&nbsp;print &#34;站点 $url 暂没有发现漏洞.\n\n&#34;;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}else{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&nbsp;&nbsp;print &#34;站点 $url 存在该漏洞.\n\n&#34;;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;}else{<br/>&#160;&#160;&#160;&#160;print &#34;站点不是nginx,Sorry!\n\n&#34;;<br/>&#160;&#160;&#160;&#160;}<br/>}<span id="down_oabunq1y9l"></span><script language="javascript" type="text/javascript">doAjax('?action=Antidown&id=162&downurl=download%2Easp%3Fid%3D162&main=%E7%82%B9%E5%87%BB%E4%B8%8B%E8%BD%BD%E6%AD%A4%E6%96%87%E4%BB%B6','down_oabunq1y9l');</script><br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/article.asp?id=423" /> 
	  <id>http://www.kukafei520.net/blog/default.asp?id=423</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[nginx文件类型错误解析漏洞]]></title>
	  <author>
		 <name>苦咖啡</name>
		 <uri>http://www.kukafei520.net/blog/</uri>
		 <email>voilet119@163.com</email>
	  </author>
	  <category term="" scheme="http://www.kukafei520.net/blog/default.asp?cateID=5" label="网络技术" /> 
	  <updated>2010-05-21T13:56:41+08:00</updated>
	  <published>2010-05-21T13:56:41+08:00</published>
		  <summary type="html"><![CDATA[漏洞介绍：nginx是一款高性能的web服务器，使用非常广泛，其不仅经常被用作反向代理，也可以非常好的支持PHP的运行。80sec发现其中存在一个较为严重的安全问题，默认情况下可能导致服务器错误的将任何类型的文件以PHP的方式进行解析，这将导致严重的安全问题，使得恶意的攻击者可能攻陷支持php的nginx服务器。<br/><br/><br/>漏洞分析：nginx默认以cgi的方式支持php的运行，譬如在配置文件当中可以以<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code38439);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code38439><br/>location ~ \.php$ {<br/>root html;<br/>fastcgi_pass 127.0.0.1:9000;<br/>fastcgi_index index.php;<br/>fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;<br/>include fastcgi_params;<br/>}<br/></div></div><br/><br/>的方式支持对php的解析，location对请求进行选择的时候会使用URI环境变量进行选择，其中传递到后端Fastcgi的关键变量SCRIPT_FILENAME由nginx生成的$fastcgi_script_name决定，而通过分析可以看到$fastcgi_script_name是直接由URI环境变量控制的，这里就是产生问题的点。而为了较好的支持PATH_INFO的提取，在PHP的配置选项里存在cgi.fix_pathinfo选项，其目的是为了从SCRIPT_FILENAME里取出真正的脚本名。<br/>那么假设存在一个<a href="http://192.168.1.198/test.jpg/test.php" target="_blank" rel="external"><a href="http://192.168.1.198/test.jpg/test.php" target="_blank" rel="external">http://192.168.1.198/test.jpg/test.php</a></a>，我们以如下的方式去访问<br/><br/><br/><a href="http://192.168.1.198/test.jpg/test.php" target="_blank" rel="external">http://192.168.1.198/test.jpg/test.php</a><br/><br/>将会得到一个URI<br/><br/><br/>/test.jpg/test.php<br/><br/>经过location指令，该请求将会交给后端的fastcgi处理，nginx为其设置环境变量SCRIPT_FILENAME，内容为<br/><br/><br/>/scripts/test.jpg/test.php<br/>而在其他的webserver如lighttpd当中，我们发现其中的SCRIPT_FILENAME被正确的设置为<br/><br/><br/>/scripts/test.php<br/><br/>所以不存在此问题。<br/>后端的fastcgi在接受到该选项时，会根据fix_pathinfo配置决定是否对SCRIPT_FILENAME进行额外的处理，一般情况下如果不对fix_pathinfo进行设置将影响使用PATH_INFO进行路由选择的应用，所以该选项一般配置开启。Php通过该选项之后将查找其中真正的脚本文件名字，查找的方式也是查看文件是否存在，这个时候将分离出SCRIPT_FILENAME和PATH_INFO分别为<br/><br/><br/>/scripts/test.jpg和test.php<br/><br/>最后，以/scripts/test.jpg作为此次请求需要执行的脚本，攻击者就可以实现让nginx以php来解析任何类型的文件了。<br/><br/><br/>其中的Content-Type的变化说明了后端负责解析的变化，该站点就可能存在漏洞。<br/><br/><a href="http://www.kukafei520.net/blog/default.asp?tag=%E6%BC%8F%E6%B4%9E" target="_blank">br/><br/><br/>漏洞分析：nginx默认以cgi的方式支持php的运行，譬如在配置文件当中可以以<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code38439);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code38439><br/>location ~ \.php$ {<br/>root html;<br/>fastcgi_pass 127.0.0.1:9000;<br/>fastcgi_index index.php;<br/>fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;<br/>include fastcgi_params;<br/>}<br/></div></div><br/><br/>的方式支持对php的解析，location对请求进行选择的时候会使用URI环境变量进行选择，其中传递到后端Fastcgi的关键变量SCRIPT_FILENAME由nginx生成的$fastcgi_script_name决定，而通过分析可以看到$fastcgi_script_name是直接由URI环境变量控制的，这里就是产生问题的点。而为了较好的支持PATH_INFO的提取，在PHP的配置选项里存在cgi.fix_pathinfo选项，其目的是为了从SCRIPT_FILENAME里取出真正的脚本名。<br/>那么假设存在一个<a href="http://192.168.1.198/test.jpg/test.php" target="_blank" rel="external"><a href="http://192.168.1.198/test.jpg/test.php" target="_blank" rel="external">http://192.168.1.198/test.jpg/test.php</a></a>，我们以如下的方式去访问<br/><br/><br/><a href="http://192.168.1.198/test.jpg/test.php" target="_blank" rel="external">http://192.168.1.198/test.jpg/test.php</a><br/><br/>将会得到一个URI<br/><br/><br/>/test.jpg/test.php<br/><br/>经过location指令，该请求将会交给后端的fastcgi处理，nginx为其设置环境变量SCRIPT_FILENAME，内容为<br/><br/><br/>/scripts/test.jpg/test.php<br/>而在其他的webserver如lighttpd当中，我们发现其中的SCRIPT_FILENAME被正确的设置为<br/><br/><br/>/scripts/test.php<br/><br/>所以不存在此问题。<br/>后端的fastcgi在接受到该选项时，会根据fix_pathinfo配置决定是否对SCRIPT_FILENAME进行额外的处理，一般情况下如果不对fix_pathinfo进行设置将影响使用PATH_INFO进行路由选择的应用，所以该选项一般配置开启。Php通过该选项之后将查找其中真正的脚本文件名字，查找的方式也是查看文件是否存在，这个时候将分离出SCRIPT_FILENAME和PATH_INFO分别为<br/><br/><br/>/scripts/test.jpg和test.php<br/><br/>最后，以/scripts/test.jpg作为此次请求需要执行的脚本，攻击者就可以实现让nginx以php来解析任何类型的文件了。<br/><br/><br/>其中的Content-Type的变化说明了后端负责解析的变化，该站点就可能存在漏洞。<br/><br/</a>厂商：<a href="http://www.nginx.org" target="_blank" rel="external">http://www.nginx.org</a><br/><br/>解决方案：<br/><br/>关闭cgi.fix_pathinfo为0<br/><br/>或者<br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code33502);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.kukafei520.net/blog/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code33502><br/><br/>if ( $fastcgi_script_name ~ \..*\/.*php ) {<br/>return 403;<br/>}<br/><br/></div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.kukafei520.net/blog/article.asp?id=422" /> 
	  <id>http://www.kukafei520.net/blog/default.asp?id=422</id>
  </entry>	
		
</feed>
