<?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>st0p&#039;s blog &#187; 学·武功秘籍</title>
	<atom:link href="http://www.st0p.org/blog/category/technology/feed" rel="self" type="application/rss+xml" />
	<link>http://www.st0p.org/blog</link>
	<description>孤高之路不可走,一时的弱者,不是一辈子的弱者!</description>
	<lastBuildDate>Tue, 03 Jan 2012 10:48:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Lua 标准库</title>
		<link>http://www.st0p.org/blog/archives/lua-standard-library.html</link>
		<comments>http://www.st0p.org/blog/archives/lua-standard-library.html#comments</comments>
		<pubDate>Mon, 14 Mar 2011 17:14:01 +0000</pubDate>
		<dc:creator>st0p</dc:creator>
				<category><![CDATA[学·武功秘籍]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[标准库]]></category>

		<guid isPermaLink="false">http://www.st0p.org/blog/?p=576</guid>
		<description><![CDATA[基本函数库为Lua内置的函数库，不需要额外装载 1、assert (v [, message]) 功能：相当于C的断言， 参数： v：当表达式v为nil或false将触发错误, message：发生错误时返回的信息，默认为"assertion failed!" -------------------------------------------------------------------------------- 2、collectgarbage (opt [, arg]) 功能：是垃圾收集器的通用接口，用于操作垃圾收集器 参数： opt：操作方法标志 "Stop": 停止垃圾收集器 "Restart": 重启垃圾收集器 "Collect": 执行一次全垃圾收集循环 "Count": 返回当前Lua中使用的内存量(以KB为单位) "Step": 单步执行一个垃圾收集. 步长 "Size" 由参数arg指定　(大型的值需要多步才能完成)，如果要准确指定步长，需要多次实验以达最优效果。如果步长完成一次收集循环，将返回True "Setpause": 设置 arg/100 的值作为暂定收集的时长 "Setstepmul": 设置 arg/100 的值，作为步长的增幅(即新步长＝旧步长*arg/100) -------------------------------------------------------------------------------- 3、dofile (filename) 功能：打开并且执行一个lua块,当忽略参数filename时，将执行标准输入设备(stdin)的内容。返回所有块的返回值。当发生错误时，dofile将错误反射给调用者 注：dofile不能在保护模式下运行 -------------------------------------------------------------------------------- 4、error (message [, level]) 功能：终止正在执行的函数，并返回message的内容作为错误信息(error函数永远都不会返回) 通常情况下，error会附加一些错误位置的信息到message头部. Level参数指示获得错误的位置, Level=1[默认]：为调用error位置(文件+行号) Level=2：指出哪个调用error的函数的函数 Level=0:不添加错误位置信息 [...]]]></description>
			<content:encoded><![CDATA[<p>基本函数库为Lua内置的函数库，不需要额外装载<br />
1、assert (v [, message])<br />
功能：相当于C的断言，<br />
参数：<br />
      v：当表达式v为nil或false将触发错误,<br />
message：发生错误时返回的信息，默认为"assertion failed!"</p>
<p>--------------------------------------------------------------------------------<br />
 2、collectgarbage (opt [, arg])<br />
功能：是垃圾收集器的通用接口，用于操作垃圾收集器<br />
参数：<br />
   opt：操作方法标志<br />
      "Stop": 停止垃圾收集器<br />
      "Restart": 重启垃圾收集器<br />
      "Collect": 执行一次全垃圾收集循环<br />
      "Count": 返回当前Lua中使用的内存量(以KB为单位)<br />
      "Step": 单步执行一个垃圾收集. 步长 "Size" 由参数arg指定　(大型的值需要多步才能完成)，如果要准确指定步长，需要多次实验以达最优效果。如果步长完成一次收集循环，将返回True<br />
      "Setpause": 设置 arg/100 的值作为暂定收集的时长<br />
      "Setstepmul": 设置 arg/100 的值，作为步长的增幅(即新步长＝旧步长*arg/100)</p>
<p>--------------------------------------------------------------------------------<br />
 3、dofile (filename)<br />
功能：打开并且执行一个lua块,当忽略参数filename时，将执行标准输入设备(stdin)的内容。返回所有块的返回值。当发生错误时，dofile将错误反射给调用者<br />
注：dofile不能在保护模式下运行</p>
<p>--------------------------------------------------------------------------------<br />
 4、error (message [, level])<br />
功能：终止正在执行的函数，并返回message的内容作为错误信息(error函数永远都不会返回)<br />
     通常情况下，error会附加一些错误位置的信息到message头部.<br />
     Level参数指示获得错误的位置,<br />
     Level=1[默认]：为调用error位置(文件+行号)<br />
     Level=2：指出哪个调用error的函数的函数<br />
     Level=0:不添加错误位置信息</p>
<p>--------------------------------------------------------------------------------<br />
 5、_G全局环境表(全局变量)<br />
功能：记录全局环境的变量值的表 _G._G = _G</p>
<p>--------------------------------------------------------------------------------<br />
 6、getfenv(f)<br />
功能：返回函数f的当前环境表<br />
参数：f可以为函数或调用栈的级别，级别1[默认]为当前的函数,级别0或其它值将返回全局环境_G</p>
<p>--------------------------------------------------------------------------------<br />
 7、getmetatable(object)<br />
功能：返回指定对象的元表(若object的元表.__metatable项有值，则返回object的元表.__metatable的值)，当object没有元表时将返回nil</p>
<p><span id="more-576"></span>--------------------------------------------------------------------------------<br />
 8、ipairs (t)<br />
功能：返回三个值 迭代函数、表、0<br />
多用于穷举表的键名和键值对<br />
如：for i,v in ipairs(t) do<br />
        <body ><br />
   end<br />
每次循环将索引赋级i，键值赋给v<br />
注：本函数只能用于以数字索引访问的表 如：t={"1","cash"}</p>
<p>--------------------------------------------------------------------------------<br />
 9、load (func [, chunkname])<br />
功能：装载一个块中的函数，每次调用func将返回一个连接前一结的字串，在块结尾处将返回nil<br />
当没有发生错误时，将返回一个编译完成的块作为函数,否则返回nil加上错误信息，此函数的环境为全局环境<br />
chunkname用于错误和调试信息</p>
<p>--------------------------------------------------------------------------------<br />
 10、loadfile ([filename])<br />
功能：与load类似，但装载的是文件或当没有指定filename时装载标准输入(stdin)的内容</p>
<p>--------------------------------------------------------------------------------<br />
 11、loadstring (string [, chunkname])<br />
功能：与load类似，但装载的内容是一个字串<br />
如：assert(loadstring(s))()</p>
<p>--------------------------------------------------------------------------------<br />
 12、next (table [, index])<br />
功能：允许程序遍历表中的每一个字段，返回下一索引和该索引的值。<br />
参数：table：要遍历的表<br />
　　　index：要返回的索引的前一索中的号，当index为nil[]时，将返回第一个索引的值，当索引号为最后一个索引或表为空时将返回nil<br />
注：可以用next(t)来检测表是否为空(此函数只能用于以数字索引的表与ipairs相类似)</p>
<p>--------------------------------------------------------------------------------<br />
 13、ipairs (t)<br />
功能：返回三个值 next函数、表、0<br />
多用于穷举表的键名和键值对<br />
如：for n,v in pairs(t) do<br />
        <body ><br />
   end<br />
每次循环将索引赋级i，键值赋给v<br />
注：本函数只能用于以键名索引访问的表 如：t={id="1",name="cash"}</p>
<p>--------------------------------------------------------------------------------<br />
 14、pcall (f, arg1, ···)<br />
功能：在保护模式下调用函数(即发生的错误将不会反射给调用者)<br />
当调用函数成功能返回true,失败时将返回false加错误信息</p>
<p>--------------------------------------------------------------------------------<br />
 15、print (···)<br />
功能：简单的以tostring方式格式化输出参数的内容</p>
<p>--------------------------------------------------------------------------------<br />
 16、rawequal (v1, v2)<br />
功能：检测v1是否等于v2，此函数不会调用任何元表的方法</p>
<p>--------------------------------------------------------------------------------<br />
 17、rawget (table, index)<br />
功能：获取表中指定索引的值，此函数不会调用任何元表的方法，成功返回相应的值，当索引不存在时返回nil<br />
注：本函数只能用于以数字索引访问的表 如：t={"1","cash"}</p>
<p>--------------------------------------------------------------------------------<br />
 18、rawset (table, index, value)<br />
功能：设置表中指定索引的值，此函数不会调用任何元表的方法，此函数将返回table</p>
<p>--------------------------------------------------------------------------------<br />
 19、select (index, ···)<br />
功能：当index为数字将返回所有index大于index的参数:如：select(2,"a","b") 返回 "b"<br />
     当index为"#"，则返回参数的总个数(不包括index)</p>
<p>--------------------------------------------------------------------------------<br />
 20、setfenv (f, table)<br />
功能：设置函数f的环境表为table<br />
参数：f可以为函数或调用栈的级别，级别1[默认]为当前的函数,级别0将设置当前线程的环境表</p>
<p>--------------------------------------------------------------------------------<br />
 21、setmetatable (table, metatable)<br />
功能：为指定的table设置元表metatable，如果metatable为nil则取消table的元表，当metatable有__metatable字段时，将触发错误<br />
注：只能为LUA_TTABLE 表类型指定元表</p>
<p>--------------------------------------------------------------------------------<br />
 22、tonumber (e [, base])<br />
功能：尝试将参数e转换为数字，当不能转换时返回nil<br />
base(2~36)指出参数e当前使用的进制，默认为10进制，如tonumber(11,2)=3</p>
<p>--------------------------------------------------------------------------------<br />
 23、tostirng(e)<br />
功能：将参数e转换为字符串，此函数将会触发元表的__tostring事件</p>
<p>--------------------------------------------------------------------------------<br />
 24、type(v)<br />
功能：返回参数的类型名("nil"，"number", "string", "boolean", "table", "function", "thread", "userdata")</p>
<p>--------------------------------------------------------------------------------<br />
 25、unpack (list [, i [, j]])<br />
功能：返回指定表的索引的值,i为起始索引，j为结束索引<br />
注：本函数只能用于以数字索引访问的表,否则只会返回nil 如：t={"1","cash"}</p>
<p>--------------------------------------------------------------------------------<br />
 26、_VERSION<br />
功能：返回当前Lua的版本号"Lua 5.1". </p>
<p>--------------------------------------------------------------------------------<br />
 27、xpcall (f, err)<br />
功能：与pcall类似，在保护模式下调用函数(即发生的错误将不会反射给调用者)<br />
但可指定一个新的错误处理函数句柄<br />
当调用函数成功能返回true,失败时将返回false加err返回的结果</p>
]]></content:encoded>
			<wfw:commentRss>http://www.st0p.org/blog/archives/lua-standard-library.html/feed</wfw:commentRss>
		<slash:comments>135</slash:comments>
		</item>
		<item>
		<title>Apache 路径大全</title>
		<link>http://www.st0p.org/blog/archives/apache-path-daquan.html</link>
		<comments>http://www.st0p.org/blog/archives/apache-path-daquan.html#comments</comments>
		<pubDate>Tue, 15 Feb 2011 06:38:03 +0000</pubDate>
		<dc:creator>st0p</dc:creator>
				<category><![CDATA[学·武功秘籍]]></category>

		<guid isPermaLink="false">http://www.st0p.org/blog/?p=567</guid>
		<description><![CDATA[来源：http://wiki.apache.org/httpd/DistrosDefaultLayout 最常用的Apache路径有： /etc/httpd/conf/httpd.conf /usr/local/apache/conf/httpd.conf /usr/local/apache2/conf/httpd.conf Apache 2.2 default layout (apache.org source package): ServerRoot :: /usr/local/apache2 DocumentRoot :: /usr/local/apache2/htdocs Apache Config File :: /usr/local/apache2/conf/httpd.conf Other Config Files :: /usr/local/apache2/conf/extra/ SSL Config File :: /usr/local/apache2/conf/extra/httpd-ssl.conf ErrorLog :: /usr/local/apache2/logs/error_log AccessLog :: /usr/local/apache2/logs/access_log cgi-bin :: /usr/local/apache2/cgi-bin (enabled by default, but the bundled scripts are 644) binaries (apachectl) :: /usr/local/apache2/bin [...]]]></description>
			<content:encoded><![CDATA[<p>来源：<a  href="http://wiki.apache.org/httpd/DistrosDefaultLayout">http://wiki.apache.org/httpd/DistrosDefaultLayout</a></p>
<p><span>最常用的Apache路径有：</span></p>
<p>/etc/httpd/conf/httpd.conf</p>
<p>/usr/local/apache/conf/httpd.conf</p>
<p>/usr/local/apache2/conf/httpd.conf</p>
<h2 id="Apache_2.2_default_layout_.28apache.org_source_package.29:">Apache 2.2 default layout (apache.org source package):</h2>
<p><span id="line-11"> </span></p>
<p><span id="line-12"> </span><span id="line-13"> </span><span id="line-14"> </span><span id="line-15"> </span><span id="line-16"> </span><span id="line-17"> </span><span id="line-18"> </span><span id="line-19"> </span><span id="line-20"> </span><span id="line-21"> </span><span id="line-22"> </span></p>
<pre>ServerRoot              ::      /usr/local/apache2
DocumentRoot            ::      /usr/local/apache2/htdocs
Apache Config File      ::      /usr/local/apache2/conf/httpd.conf
Other Config Files      ::      /usr/local/apache2/conf/extra/
SSL Config File         ::      /usr/local/apache2/conf/extra/httpd-ssl.conf
ErrorLog                ::      /usr/local/apache2/logs/error_log
AccessLog               ::      /usr/local/apache2/logs/access_log
cgi-bin                 ::      /usr/local/apache2/cgi-bin (enabled by default, but the bundled scripts are 644)
binaries (apachectl)    ::      /usr/local/apache2/bin
start/stop              ::      /usr/local/apache2/bin/apachectl (start|restart|graceful|graceful-stop|stop|configtest)</pre>
<p><span id="line-23"> </span></p>
</p>
<h2 id="Apache_2.0_default_layout_.28apache.org_source_package.29:">Apache 2.0 default layout (apache.org source package):</h2>
<p><span id="line-24"> </span></p>
<p><span id="line-25"> </span><span id="line-26"> </span><span id="line-27"> </span><span id="line-28"> </span><span id="line-29"> </span><span id="line-30"> </span><span id="line-31"> </span><span id="line-32"> </span><span id="line-33"> </span><span id="line-34"> </span></p>
<pre>ServerRoot              ::      /usr/local/apache2
DocumentRoot            ::      /usr/local/apache2/htdocs
Apache Config File      ::      /usr/local/apache2/conf/httpd.conf
SSL Config              ::      /usr/local/apache2/conf/ssl.conf
ErrorLog                ::      /usr/local/apache2/logs/error_log
AccessLog               ::      /usr/local/apache2/logs/access_log
cgi-bin                 ::      /usr/local/apache2/cgi-bin (enabled by default, but the bundled scripts are 644)
binaries (apachectl)    ::      /usr/local/apache2/bin
start/stop              ::      /usr/local/apache2/bin/apachectl (start|stop|graceful|configtest)</pre>
<p><span id="line-35"> </span></p>
</p>
<h2 id="Apache_1.3_default_layout_.28apache.org_source_package.29:">Apache 1.3 default layout (apache.org source package):</h2>
<p><span id="line-36"> </span></p>
<p><span id="line-37"> </span><span id="line-38"> </span><span id="line-39"> </span><span id="line-40"> </span><span id="line-41"> </span><span id="line-42"> </span><span id="line-43"> </span><span id="line-44"> </span><span id="line-45"> </span></p>
<pre>ServerRoot              ::      /usr/local/apache
DocumentRoot            ::      /usr/local/apache/htdocs
Apache Config File      ::      /usr/local/apache/conf/httpd.conf
ErrorLog                ::      /usr/local/apache/logs/error_log
AccessLog               ::      /usr/local/apache/logs/access_log
cgi-bin                 ::      /usr/local/apache/cgi-bin (enabled by default, but the bundled scripts are 644)
binaries (apachectl)    ::      /usr/local/apache/bin
start/stop              ::      /usr/local/apache/bin/apachectl (start|stop|graceful|configtest)</pre>
<p><span id="line-46"> </span></p>
</p>
<h2 id="Debian.2C_Ubuntu_.28Apache_2.29:">Debian, Ubuntu (Apache 2):</h2>
<p><span id="line-47"> </span></p>
<p><span id="line-48"> </span><span id="line-49"> </span><span id="line-50"> </span><span id="line-51"> </span><span id="line-52"> </span><span id="line-53"> </span><span id="line-54"> </span><span id="line-55"> </span><span id="line-56"> </span><span id="line-57"> </span><span id="line-58"> </span><span id="line-59"> </span></p>
<pre>ServerRoot              ::      /etc/apache2
DocumentRoot            ::      /var/www
Apache Config Files     ::      /etc/apache2/apache2.conf
                        ::      /etc/apache2/ports.conf
Default VHost Config    ::      /etc/apache2/sites-available/default, /etc/apache2/sites-enabled/000-default
Module Locations        ::      /etc/apache2/mods-available, /etc/apache2/mods-enabled
ErrorLog                ::      /var/log/apache2/error.log
AccessLog               ::      /var/log/apache2/access.log
cgi-bin                 ::      /usr/lib/cgi-bin
binaries (apachectl)    ::      /usr/sbin
start/stop              ::      /etc/init.d/apache2 (start|stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean)</pre>
<p><span id="line-60"> </span></p>
</p>
<h3 id="Notes:">Notes:</h3>
<p><span id="line-61"> </span></p>
<ol type="1">
<li><em>The Debian/Ubuntu layout is fully documented in /usr/share/doc/apache2/README.Debian</em> <span id="line-62"> </span></li>
<li><em>Debian/Ubuntu use symlinks to enable vhosts and modules. Configuration files are created in their respective sites-available and mods-available directories. To activate vhosts and modules, symlinks are created in the respective sites-enabled and mods-enabled directories to the config files in either sites-available and mods-available. Debian provides scripts to handle this process called &#8216;a2ensite&#8217; and &#8216;a2enmod&#8217; which enables vhosts and modules.</em></li>
<li><em>The default <a  href="http://www.007hack.com/httpd/DocumentRoot">DocumentRoot</a> is specified in the default vhost config file, /etc/apache2/sites-available/default</em></li>
</ol>
<h2 id="Debian.2C_Ubuntu_.28Apache_1.3.29:">Debian, Ubuntu (Apache 1.3):</h2>
</p>
<pre>ServerRoot              ::      /etc/apache
DocumentRoot            ::      /var/www
ErrorLog                ::      /var/log/apache/error.log
AccessLog               ::      /var/log/apache/access.log
cgi-bin                 ::      /usr/lib/cgi-bin
binaries (apachectl)    ::      /usr/sbin
start/stop              ::      /etc/init.d/apache (start|stop|graceful|configtest)</pre>
</p>
<h2 id="Fedora_Core.2C_CentOS.2C_RHEL:">Fedora Core, CentOS, RHEL:</h2>
</p>
<pre>ServerRoot              ::      /etc/httpd
Primary Config Fle      ::      /etc/httpd/conf/httpd.conf
Other Config Files      ::      /etc/httpd/conf.d
Module Locations        ::      /usr/lib/httpd/modules
DocumentRoot            ::      /var/www/html
ErrorLog                ::      /var/log/httpd/error_log
AccessLog               ::      /var/log/httpd/access_log
cgi-bin                 ::      /var/www/cgi-bin (empty and disabled by default)
binary                  ::      /usr/sbin/httpd
runtime directory       ::      /etc/httpd/run
start/stop              ::      /sbin/service httpd {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}</pre>
</p>
<h3 id="Notes:-1">Notes:</h3>
<ol type="1">
<li><em>There is an extra config file in /etc/sysconfig/httpd which can be used to change to the worker mpm /usr/sbin/httpd.worker.</em></li>
<li><em>Extra config files named *.conf are loaded from /etc/httpd/conf.d. This directory is used by packages like mod_python for drop-in configs</em></li>
<li><em>If you&#8217;re having issues with authorization and your permissions are correct make sure that you try testing with SELinux turned off. Run &#8216;setenforce 0&#8242; and use &#8216;chcon&#8217; to fix permissions. Run &#8216;ls -alZ&#8217; to view the current permissions.&#8217; SELinux first appeared in Fedora Core 3, RHEL 4, and CentOS 4.</em></li>
</ol>
<h2 id="RedHat_9.0_and_older:">RedHat 9.0 and older:</h2>
</p>
<pre>ServerRoot              ::      /etc/httpd
Primary Config Fle      ::      /etc/httpd/conf/httpd.conf
DocumentRoot            ::      /var/www/html
ErrorLog                ::      /var/log/httpd/error_log
AccessLog               ::      /var/log/httpd/access_log
cgi-bin                 ::      /var/www/cgi-bin (empty and disabled by default)
binary                  ::      /usr/sbin/httpd
start/stop              ::      /sbin/service httpd {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}</pre>
</p>
<h2 id="Mandriva_.28Apache_2.2.29:">Mandriva (Apache 2.2):</h2>
</p>
<pre>ServerRoot              ::      /etc/httpd
Primary Config Fle      ::      /etc/httpd/conf/httpd.conf
DocumentRoot            ::      /var/www/html
ErrorLog                ::      /var/log/httpd/error_log
AccessLog               ::      /var/log/httpd/access_log
cgi-bin                 ::      /var/www/cgi-bin
binary                  ::      /usr/sbin/httpd
start/stop              ::      /sbin/service httpd
{start|stop|restart|reload|graceful|condreload|closelogs|update|condrestart|status|extendedstatus|configtest|configtest_vhosts|semcleanrestart|debug|show_defines}</pre>
</p>
<h2 id="Mac_OS_X_.28Leopard.2C_Apache_2.2.29:">Mac OS X (Leopard, Apache 2.2):</h2>
</p>
<pre>ServerRoot              ::      /usr
Primary Config Fle      ::      /etc/apache2/httpd.conf
DocumentRoot            ::      /Library/WebServer/Documents
ErrorLog                ::      /var/log/apache2/error_log
AccessLog               ::      /var/log/apache2/access_log
cgi-bin                 ::      /Library/WebServer/CGI-Executables (empty by default)
binary                  ::      /usr/sbin/httpd
start/stop              ::      /usr/sbin/apachectl (start|stop|restart|fullstatus|status|graceful|graceful-stop|configtest|help)</pre>
</p>
<h3 id="Notes:-2">Notes:</h3>
<ol type="1">
<li>apachectl graceful is equivalent to apachectl restart and doesn&#8217;t keep running connections alive. Similarly, graceful-stop is not graceful.</li>
<li>The <tt>/usr/sbin/envvars</tt> script is ineffective for setting environment variables. See <a  href="http://lists.apple.com/archives/web-dev/2008/Apr/msg00059.html">http://lists.apple.com/archives/web-dev/2008/Apr/msg00059.html</a></li>
</ol>
<h2 id="Mac_OS_X_.28Tiger_and_earlier.2C_Apache_1.3.29:">Mac OS X (Tiger and earlier, Apache 1.3):</h2>
</p>
<pre>ServerRoot              ::      /usr
Primary Config Fle      ::      /etc/httpd/httpd.conf
DocumentRoot            ::      /Library/WebServer/Documents
ErrorLog                ::      /var/log/httpd/error_log
AccessLog               ::      /var/log/httpd/access_log
cgi-bin                 ::      /Library/WebServer/CGI-Executables (empty by default)
binary                  ::      /usr/sbin/httpd
start/stop              ::      apachectl (start|stop|restart|fullstatus|status|graceful|configtest|help)</pre>
</p>
<h2 id="NetBSD_Apache_2.0_and_1.3_from_pkgsrc_.28layout_is_identical.29:">NetBSD Apache 2.0 and 1.3 from pkgsrc (layout is identical):</h2>
</p>
<pre>ServerRoot              ::      /usr/pkg
Config File             ::      /usr/pkg/etc/httpd/httpd.conf
DocumentRoot            ::      /usr/pkg/share/httpd/htdocs
ErrorLog                ::      /var/log/httpd/error_log
AccessLog               ::      /var/log/httpd/access_log
cgi-bin                 ::      /usr/pkg/libexec/cgi-bin
binaries (apachectl)    ::      /usr/pkg/sbin
start/stop              ::      /etc/rc.d/apache [fast|force|one](start stop restart rcvar reload status poll)
/etc/rc.conf variables  ::      apache=YES, apache_start="start" (or "startssl")</pre>
</p>
<h3 id="Notes:-3">Notes:</h3>
<ol type="1">
<li><em>The &#8220;apache&#8221; script must be copied from the installation default /usr/pkg/share/examples/rc.d to /etc/rc.d (for automatic rc.conf usage) or /usr/pkg/etc/rc.d (for advanced usage).</em></li>
</ol>
<p>><span id="more-567"></span></p>
<h2 id="FreeBSD_6.1_.28Apache_2.2.29:">FreeBSD 6.1 (Apache 2.2):</h2>
</p>
<pre>ServerRoot              ::      /usr/local
Config File             ::      /usr/local/etc/apache22/httpd.conf
DocumentRoot            ::      /usr/local/www/apache22/data
ErrorLog                ::      /var/log/httpd-error.log
AccessLog               ::      /var/log/httpd-access.log
cgi-bin                 ::      /usr/local/www/apache22/cgi-bin
binaries (apachectl)    ::      /usr/local/sbin
start/stop              ::      /usr/local/etc/rc.d/apache22.sh (start|restart|stop|reload|graceful|gracefulstop|configtest)
/etc/rc.conf variables  ::      apache22_enable="YES"</pre>
</p>
<h3 id="Notes:-4">Notes:</h3>
<ol type="1">
<li><em>Other variables to insert in rc.conf are listed in the comments at the top of the start/stop script</em></li>
<li><em>To start 2.2 on freebsd 6.1 the <a  href="http://www.007hack.com/httpd/HttpreadyAcceptFilter">accf_http</a> kernel module must be loaded. To do this once, run <tt>kldload accf_http </tt>. To do so at boot time, add accf_http_load=”YES” to /boot/loader.conf</em></li>
<li><em>Apache 2.2.6 in the FreeBSD 6.2 release will start regardless of the <a  href="http://www.007hack.com/httpd/HttpreadyAcceptFilter">accf_http</a> kernel module being loaded, and by default doesn&#8217;t use it. To reverse this, add apache22_http_accept_enable=&#8221;YES&#8221; to /etc/rc.conf (which will cause the kernel module to be loaded and Apache to use it).</em></li>
</ol>
<h2 id="FreeBSD_6.1_.28Apache_2.0.29:">FreeBSD 6.1 (Apache 2.0):</h2>
</p>
<pre>ServerRoot              ::      /usr/local
Config File             ::      /usr/local/etc/apache2/httpd.conf
DocumentRoot            ::      /usr/local/www/data
ErrorLog                ::      /var/log/httpd-error.log
AccessLog               ::      /var/log/httpd-access.log
cgi-bin                 ::      /usr/local/www/cgi-bin
binaries (apachectl)    ::      /usr/local/sbin
start/stop              ::      /usr/local/etc/rc.d/apache2.sh [fast|force|one](start|restart|stop|reload|configtest|rcvar)
/etc/rc.conf variables  ::      apache2_enable="YES"</pre>
</p>
<h3 id="Notes:-5">Notes:</h3>
<ol type="1">
<li><em>Other variables to insert in rc.conf are listed in the comments at the top of the start/stop script</em></li>
</ol>
<h2 id="FreeBSD_.28Apache_1.3.29:">FreeBSD (Apache 1.3):</h2>
</p>
<pre>ServerRoot              ::      /usr/local
Config File             ::      /usr/local/etc/apache/httpd.conf
DocumentRoot            ::      /usr/local/www/data
ErrorLog                ::      /var/log/httpd-error.log
AccessLog               ::      /var/log/httpd-access.log
cgi-bin                 ::      /usr/local/www/cgi-bin
binaries (apachectl)    ::      /usr/local/sbin
start/stop              ::      /usr/local/etc/rc.d/apache.sh
rc.conf variables       ::      apache_enable="YES"
    (other variables to insert in rc.conf are listed in the comments at the top of the start/stop script)</pre>
</p>
<h3 id="Notes:-6">Notes:</h3>
<ol type="1">
<li><em>See: <a  href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-apache.html">http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-apache.html</a></em></li>
</ol>
<h2 id="Win32_.282.2.29:">Win32 (2.2):</h2>
</p>
<pre>ServerRoot              ::      "C:/Program Files/Apache Software Foundation/Apache2.2"
Config File             ::      "C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf"
DocumentRoot            ::      "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
ErrorLog                ::      "C:/Program Files/Apache Software Foundation/Apache2.2/logs/error.log"
AccessLog               ::      "C:/Program Files/Apache Software Foundation/Apache2.2/logs/access.log"
cgi-bin                 ::      "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"
binaries (apachectl)    ::      "C:/Program Files/Apache Software Foundation/Apache2.2/bin"</pre>
</p>
<h3 id="Notes.3B">Notes;</h3>
<ol type="1">
<li><em>There are extra config files in &#8220;C:/Program Files/Apache Software Foundation/Apache2.2/conf/extra&#8221; that can be included for options such as vhosts</em></li>
</ol>
<h2 id="Solaris_10_.28Apache_2.0.29:">Solaris 10 (Apache 2.0):</h2>
</p>
<pre>ServerRoot              ::      /usr/apache2
Config File             ::      /etc/apache2/httpd.conf
DocumentRoot            ::      /var/apache2/htdocs
ErrorLog                ::      /var/apache2/logs/error_log
AccessLog               ::      /var/apache2/logs/access_log
cgi-bin                 ::      /var/apache2/cgi-bin
binaries                ::      /usr/apache2/bin</pre>
</p>
<h3 id="Notes:-7">Notes:</h3>
<ol type="1">
<li><em>Config needs to be copied from example file to httpd.conf. Apache-1.3 is the default installation in /etc/init.d and /etc/rc3.d files.</em></li>
</ol>
<h2 id="Solaris_10_.28Apache_1.3.29:">Solaris 10 (Apache 1.3):</h2>
</p>
<pre>ServerRoot              ::      /usr/apache
Config File             ::      /etc/apache/httpd.conf
DocumentRoot            ::      /var/apache/htdocs
ErrorLog                ::      /var/apache/logs/error_log
AccessLog               ::      /var/apache/logs/access_log
cgi-bin                 ::      /var/apache/cgi-bin
binaries                ::      /usr/apache/bin
start/stop              ::      /etc/init.d/apache (start|startssl|sslstart|start-SSL|restart|stop)</pre>
</p>
<h3 id="Notes:-8">Notes:</h3>
<ol type="1">
<li><em>Config needs to be copied from example file to httpd.conf.</em></li>
<li><em>Apache-1.3 is the default installation in /etc/init.d and /etc/rc3.d files. Also Apache Tomcat is included in 1.3 installation.</em></li>
</ol>
<h2 id="Slackware_10.1.2C_10.2_and_11.0_.28Apache_1.3.29:">Slackware 10.1, 10.2 and 11.0 (Apache 1.3):</h2>
</p>
<pre>ServerRoot              ::     /usr
DocumentRoot            ::     /var/www/htdocs
AccessLog               ::     /var/log/apache/access_log
ErrorLog                ::     /var/log/apache/error_log
binaries (apachectl)    ::     /usr/sbin
modules                 ::     /usr/libexec/apache
system startup script   ::     /etc/rc.d/rc.httpd (start|stop|restart|graceful)
Apache config file      ::     /etc/apache/httpd.conf
mod_ssl config file     ::     /etc/apache/mod_ssl.conf
php config file         ::     /etc/apache/mod_php.conf
cgi-bin                 ::     /var/www/cgi-bin
on-line docs ("manual") ::     /var/www/htdocs/manual
proxy cache             ::     /var/cache/proxy</pre>
</p>
<h2 id="Slackware_12.0_.28Apache_2.2.29:">Slackware 12.0 (Apache 2.2):</h2>
</p>
<pre>ServerRoot              ::     /usr
DocumentRoot            ::     /svr/httpd/htdocs
AccessLog               ::     /var/log/httpd/access_log
ErrorLog                ::     /var/log/httpd/error_log
binaries (apachectl)    ::     /usr/sbin
modules                 ::     /usr/lib/httpd
system startup script   ::     /etc/rc.d/rc.httpd (start|restart|graceful|graceful-stop|stop)
Apache config file      ::     /etc/httpd/httpd.conf
mod_ssl config file     ::     /etc/httpd/extra/httpd-ssl.conf
php config file         ::     /etc/httpd/mod_php.conf
cgi-bin                 ::     /svr/httpd/cgi-bin
on-line docs ("manual") ::     /svr/httpd/htdocs/manual</pre>
</p>
<h2 id="openSUSE_and_SLES_.28Apache_2.2.29:">openSUSE and SLES (Apache 2.2):</h2>
</p>
<pre>ServerRoot              ::      /srv/www
DocumentRoot            ::      /srv/www/htdocs
Apache Config File      ::      /etc/apache2/httpd.conf
Other Config Files      ::      /etc/sysconfig/apache2
SSL Config File         ::      /etc/apache2/ssl-global.conf
ErrorLog                ::      /var/log/apache2/error_log
AccessLog               ::      /var/log/apache2/access_log
cgi-bin                 ::      /srv/www/cgi-bin
binaries (apachectl)    ::      /usr/sbin
start/stop              ::      /etc/init.d/apache2 (start|restart|restart-graceful|reload|graceful|graceful-stop|stop|configtest)</pre>
</p>
<h3 id="Notes:-9">Notes:</h3>
<ol type="1">
<li><em>Modules are enabled in /etc/sysconfig/apache2 which is read by the startup script. The a2enmod/a2dismod tool can be used to activate/deactivate modules.</em></li>
<li><em>See /usr/share/doc/packages/apache2/README.SUSE for more information.</em></li>
</ol>
<h2 id="Gentoo_.28Apache_2.2.29:">Gentoo (Apache 2.2):</h2>
</p>
<pre>ServerRoot              ::      /usr/lib/apache2
DocumentRoot            ::      /var/www/localhost/htdocs
Apache Config File      ::      /etc/apache2/httpd.conf
Other Config Files      ::      /etc/conf.d/apache2
Default VHost Config    ::      /etc/apache2/vhosts.d/00_default_vhost.conf
Module Configuration    ::      /etc/apache2/modules.d
Module Locations        ::      /usr/lib/apache2/modules
ErrorLog                ::      /var/log/apache2/error_log
AccessLog               ::      /var/log/apache2/access_log
cgi-bin                 ::      /var/www/localhost/cgi-bin
binaries (apache2ctl)   ::      /usr/sbin
start/stop              ::      /etc/init.d/apache2 (start|restart|graceful|stop|configtest)</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.st0p.org/blog/archives/apache-path-daquan.html/feed</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>启用32位 UBUNTU 10.10 PAE 4G以上内存的解决方案</title>
		<link>http://www.st0p.org/blog/archives/enable-32-bit-ubuntu-10-10-pae-4g-of-memory-solutions-for-more-than.html</link>
		<comments>http://www.st0p.org/blog/archives/enable-32-bit-ubuntu-10-10-pae-4g-of-memory-solutions-for-more-than.html#comments</comments>
		<pubDate>Thu, 10 Feb 2011 12:40:39 +0000</pubDate>
		<dc:creator>st0p</dc:creator>
				<category><![CDATA[学·武功秘籍]]></category>
		<category><![CDATA[32位]]></category>
		<category><![CDATA[4G]]></category>
		<category><![CDATA[PAE]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[UBUNTU 10.10]]></category>
		<category><![CDATA[大内存]]></category>

		<guid isPermaLink="false">http://www.st0p.org/blog/?p=564</guid>
		<description><![CDATA[sudo apt-get install linux-generic-pae #内核包 sudo apt-get install linux-headers-generic-pae #内核header包 sudo apt-get install nvidia-current nvidia-settings #适用于N卡 特别提示。 32位系统，打开内存得映射功能后，系统将不能使用休眠功能（休眠与待机不同） Linux 系统之父Linus Torvalds此前曾经说过，在开启和关闭CONFIG_HIGHMEM4G(可让32位系统支持4GB物理内存)的系统内核之间存在25％的性能差异。Ubuntu 32位内核默认开启了CONFIG_HIGHMEM4G，但PAE模式是关闭的，这样32位内核在系统配置4GB内存的时候会有1GB保留给内核虚拟空间，用户实际可用的只有3GB，而Ubuntu PAE内核使用的是CONFIG_HIGHMEM64G，能处理最多64GB内存。]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">sudo apt-get install linux-generic-pae      #内核包
sudo apt-get install linux-headers-generic-pae     #内核header包
sudo apt-get install nvidia-current nvidia-settings #适用于N卡</pre></div></div>

<p>特别提示。<br />
32位系统，打开内存得映射功能后，系统将不能使用休眠功能（休眠与待机不同） </p>
<p>Linux 系统之父Linus Torvalds此前曾经说过，在开启和关闭CONFIG_HIGHMEM4G(可让32位系统支持4GB物理内存)的系统内核之间存在25％的性能差异。Ubuntu 32位内核默认开启了CONFIG_HIGHMEM4G，但PAE模式是关闭的，这样32位内核在系统配置4GB内存的时候会有1GB保留给内核虚拟空间，用户实际可用的只有3GB，而Ubuntu PAE内核使用的是CONFIG_HIGHMEM64G，能处理最多64GB内存。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.st0p.org/blog/archives/enable-32-bit-ubuntu-10-10-pae-4g-of-memory-solutions-for-more-than.html/feed</wfw:commentRss>
		<slash:comments>428</slash:comments>
		</item>
		<item>
		<title>Internet Information Services(IIS) 7.5 Express 试用</title>
		<link>http://www.st0p.org/blog/archives/internet-information-services-iis-7-5-express-trial.html</link>
		<comments>http://www.st0p.org/blog/archives/internet-information-services-iis-7-5-express-trial.html#comments</comments>
		<pubDate>Sun, 16 Jan 2011 07:49:43 +0000</pubDate>
		<dc:creator>st0p</dc:creator>
				<category><![CDATA[学·武功秘籍]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[IIS 7.5]]></category>
		<category><![CDATA[IIS 7.5 Express]]></category>
		<category><![CDATA[Internet Information Services]]></category>

		<guid isPermaLink="false">http://www.st0p.org/blog/?p=549</guid>
		<description><![CDATA[作者:st0p 转载请注明出处 http://www.st0p.org IIS 7.5 Express 兼具 IIS 7.5 的强大功能与轻型 Web 服务器（例如 ASP.NET 开发服务器，也称为“Cassini”）的便利，可以增强在 Windows 上开发和测试 Web 应用程序的能力。 Microsoft WebMatrix 中包含 IIS 7.5 Express，这套集成工具可以让 Windows 上的 Web 应用程序开发工作变得简单、顺畅。 IIS 7.5 Express 也可与 Visual Studio 2010 一起使用，功能强大足以代替 Cassini。 使用 IIS 7.5 Express 的好处包括： 在生产服务器上运行的同一 Web 服务器现在可以在开发计算机上使用。 在无需管理员特权的情况下，可以完成大多数任务。 IIS 7.5 Express 在 Windows XP 和所有更高版本的 Windows 上运行。 [...]]]></description>
			<content:encoded><![CDATA[<p>作者:st0p<br />
转载请注明出处 http://www.st0p.org</p>
<p>IIS 7.5 Express 兼具 IIS 7.5 的强大功能与轻型 Web 服务器（例如 ASP.NET 开发服务器，也称为“Cassini”）的便利，可以增强在 Windows 上开发和测试 Web 应用程序的能力。 Microsoft WebMatrix 中包含 IIS 7.5 Express，这套集成工具可以让 Windows 上的 Web 应用程序开发工作变得简单、顺畅。 IIS 7.5 Express 也可与 Visual Studio 2010 一起使用，功能强大足以代替 Cassini。 使用 IIS 7.5 Express 的好处包括：<br />
在生产服务器上运行的同一 Web 服务器现在可以在开发计算机上使用。<br />
在无需管理员特权的情况下，可以完成大多数任务。<br />
IIS 7.5 Express 在 Windows XP 和所有更高版本的 Windows 上运行。<br />
多位用户可在相同的计算机上独立工作。<br />
此包仅安装 IIS 7.5 Express。 对于集成的开发体验，还要安装 Microsoft WebMatrix 或 Visual Studio 2010。</p>
<p>今天在网上看到Internet Information Services(IIS) 7.5 Express这个的下载地址,就下载试用了一下....<br />
安装这个之前必须要安装.NET 4</p>
<p>Microsoft .NET Framework 4（独立安装程序）<br />
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0A391ABD-25C1-4FC0-919F-B21F31AB88B7&#038;displayLang=zh-cn" target="_blank" title="Microsoft .NET Framework 4（独立安装程序）<br />
">http://www.microsoft.com/downloads/details.aspx?FamilyID=0A391ABD-25C1-4FC0-919F-B21F31AB88B7&#038;displayLang=zh-cn</a></p>
<p>Internet Information Services (IIS) 7.5 Express<br />
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ABC59783-89DE-4ADC-B770-0A720BB21DEB&#038;displaylang=zh-cn" target="_blank" title="Internet Information Services (IIS) 7.5 Express<br />
">http://www.microsoft.com/downloads/details.aspx?FamilyID=ABC59783-89DE-4ADC-B770-0A720BB21DEB&#038;displaylang=zh-cn</a></p>
<p>安装好后,在控制面板的管理工具中不会出现IIS管理工具....<br />
运行C:\Program Files\IIS Express\iisexpress.exe<br />
会弹出窗口提示站点运行...默认是可以通过http://localhost:8080进行访问的,不过这样我们用起来比较麻烦,我们去改一下配置,由于我的测试环境是在虚拟机的Windows XP下进行的,所以需要修改的文件如下..<br />
首先关掉iisexpress.exe弹出的窗口</p>
<p>默认配置文件:C:\Documents and Settings\Administrator\My Documents\IISExpress\config\applicationhost.config</p>
<p>默认网站目录:C:\Documents and Settings\Administrator\My Documents\My Web Sites\WebSite1</p>
<p>为了方便我们修改一下站点显示名称,网站所在目录,和默认首页文件...修改内容如下图..</p>
<p><img src="http://www.st0p.org/blog/wp-content/uploads/2011/01/internet-information-services-iis-7-5-express-trial1.gif" alt="" title="internet-information-services-iis-7-5-express-trial1" width="662" height="144" class="alignnone size-full wp-image-555" /></p>
<p><img src="http://www.st0p.org/blog/wp-content/uploads/2011/01/internet-information-services-iis-7-5-express-trial2.gif" alt="" title="internet-information-services-iis-7-5-express-trial2" width="412" height="200" class="alignnone size-full wp-image-556" /></p>
<p>由于我的目录在d:\wwwroot中,在里面新建index.asp文件,内容为<%Response.Write "St0p测试于"&#038;now%><br />
运行iisexpress.exe.后弹出窗口,我们访问http://localhost</p>
<p><img src="http://www.st0p.org/blog/wp-content/uploads/2011/01/internet-information-services-iis-7-5-express-trial3.gif" alt="" title="internet-information-services-iis-7-5-express-trial3" width="822" height="258" class="alignnone size-full wp-image-558" /></p>
<p>当然你也可以新建html和aspx进行测试,而且在C:\Program Files\IIS Express\目录下也有两个命令行的管理工具可以用来管理,不过我们只是偶尔测试一下东西用,用不着他们了..有兴趣的朋友可以自己看一下.....appcmd.exe和IisExpressAdminCmd.exe的用法....</p>
]]></content:encoded>
			<wfw:commentRss>http://www.st0p.org/blog/archives/internet-information-services-iis-7-5-express-trial.html/feed</wfw:commentRss>
		<slash:comments>211</slash:comments>
		</item>
		<item>
		<title>八卦个linux非交互环境下本地提权的方法</title>
		<link>http://www.st0p.org/blog/archives/gossip-a-linux-environment-locally-provided-non-interactive-method-of-right.html</link>
		<comments>http://www.st0p.org/blog/archives/gossip-a-linux-environment-locally-provided-non-interactive-method-of-right.html#comments</comments>
		<pubDate>Sun, 16 Jan 2011 07:41:10 +0000</pubDate>
		<dc:creator>st0p</dc:creator>
				<category><![CDATA[学·武功秘籍]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[localroot]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.st0p.org/blog/?p=545</guid>
		<description><![CDATA[文章来源:http://key0.cn/?p=220 最近好多牛都在八卦webshell-root，试问一般web用户可有对/etc/cron.d/的写入权限？浮云而已~ 引用包子牛的一段话: 在iptables限制非常严格的时候，无法走icmp udp tcp的bind shell或connect back shell，又需要本地提权，root了之后关闭iptables，看看能否绕过访问控制手段（当然了，如果别人是硬件的防火墙，下文解决不了问题）。在 这一场景下，可以考虑参考下文的非交互式本地提权的方法，或许还有其他linux localroot exploit也能实现，实战出真知。 我也八卦个,没什么技术含量，关键还是思路 看图不解释，你懂的]]></description>
			<content:encoded><![CDATA[<p>文章来源:http://key0.cn/?p=220</p>
<p>最近好多牛都在八卦webshell-root，试问一般web用户可有对/etc/cron.d/的写入权限？浮云而已~</p>
<p>引用包子牛的一段话:</p>
<p>在iptables限制非常严格的时候，无法走icmp udp tcp的bind shell或connect back shell，又需要本地提权，root了之后关闭iptables，看看能否绕过访问控制手段（当然了，如果别人是硬件的防火墙，下文解决不了问题）。在 这一场景下，可以考虑参考下文的非交互式本地提权的方法，或许还有其他linux localroot exploit也能实现，实战出真知。</p>
<p>我也八卦个,没什么技术含量，关键还是思路</p>
<p>看图不解释，你懂的</p>
<p><img src="http://www.st0p.org/blog/wp-content/uploads/2011/01/gossip-a-linux-environment-locally-provided-non-interactive-method-of-right.gif" alt="" title="gossip-a-linux-environment-locally-provided-non-interactive-method-of-right" width="636" height="519" class="alignnone size-full wp-image-547" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.st0p.org/blog/archives/gossip-a-linux-environment-locally-provided-non-interactive-method-of-right.html/feed</wfw:commentRss>
		<slash:comments>211</slash:comments>
		</item>
		<item>
		<title>初使化wine</title>
		<link>http://www.st0p.org/blog/archives/initialization-of-the-wine.html</link>
		<comments>http://www.st0p.org/blog/archives/initialization-of-the-wine.html#comments</comments>
		<pubDate>Sat, 04 Dec 2010 10:33:52 +0000</pubDate>
		<dc:creator>st0p</dc:creator>
				<category><![CDATA[学·武功秘籍]]></category>
		<category><![CDATA[wine]]></category>
		<category><![CDATA[wineboot]]></category>
		<category><![CDATA[初使化]]></category>

		<guid isPermaLink="false">http://www.st0p.org/blog/?p=537</guid>
		<description><![CDATA[唉，好久没发过东西了。。。 上次在WINE下装了点东西。但发现运行起来还是不如在virtualbox下面，所以想清理一下。。。直接初使化一下得了。。。。 删除用户目录下的.wine目录，如我的为/home/st0p/.wine 然后运行wineboot 1 2 3 4 5 6 7 8 9 10 11 12 13 14 st0p@st0p-desktop:~$ rm -rf /home/st0p/.wine st0p@st0p-desktop:~$ rm -rf /home/st0p/.local/share/applications/wine* st0p@st0p-desktop:~$ rm -rf /home/st0p/.local/share/desktop-directories/wine* st0p@st0p-desktop:~$ wineboot wine: created the configuration directory '/home/st0p/.wine' fixme:msvcrt:_setmbcp trail bytes data not available for DBCS codepage 0 - assuming all bytes fixme:system:SetProcessDPIAware stub! fixme:dwmapi:DwmIsCompositionEnabled [...]]]></description>
			<content:encoded><![CDATA[<p>唉，好久没发过东西了。。。</p>
<p>上次在WINE下装了点东西。但发现运行起来还是不如在virtualbox下面，所以想清理一下。。。直接初使化一下得了。。。。</p>
<p>删除用户目录下的.wine目录，如我的为/home/st0p/.wine<br />
然后运行wineboot</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">st0p@st0p-desktop:~$ rm -rf /home/st0p/.wine
st0p@st0p-desktop:~$ rm -rf /home/st0p/.local/share/applications/wine*
st0p@st0p-desktop:~$ rm -rf /home/st0p/.local/share/desktop-directories/wine*
st0p@st0p-desktop:~$ wineboot
wine: created the configuration directory '/home/st0p/.wine'
fixme:msvcrt:_setmbcp trail bytes data not available for DBCS codepage 0 - assuming all bytes
fixme:system:SetProcessDPIAware stub!
fixme:dwmapi:DwmIsCompositionEnabled 0x33cfdc
fixme:file:MoveFileWithProgressW MOVEFILE_WRITE_THROUGH unimplemented
fixme:advapi:SetNamedSecurityInfoW L&quot;C:\\windows\\system32\\gecko\\1.0.0\\wine_gecko\\components\\xpti.dat&quot; 1 536870916 (nil) (nil) 0x1ed1d4 (nil)
fixme:iphlpapi:NotifyAddrChange (Handle 0xa62e8d8, overlapped 0xa62e8e0): stub
fixme:file:MoveFileWithProgressW MOVEFILE_WRITE_THROUGH unimplemented
fixme:advapi:SetNamedSecurityInfoW L&quot;C:\\windows\\system32\\gecko\\1.0.0\\wine_gecko\\components\\compreg.dat&quot; 1 536870916 (nil) (nil) 0x1cb6b8c (nil)
wine: configuration in '/home/st0p/.wine' has been updated.</pre></td></tr></table></div>

<p>如果在开始菜单中还存在有快捷方式。那就去/home/st0p/.local/share/applications/wine下删掉里面的内容</p>
]]></content:encoded>
			<wfw:commentRss>http://www.st0p.org/blog/archives/initialization-of-the-wine.html/feed</wfw:commentRss>
		<slash:comments>313</slash:comments>
		</item>
		<item>
		<title>DELPHI+SQLITE实现自定义公式</title>
		<link>http://www.st0p.org/blog/archives/delphi-sqlite-to-achieve-a-custom-formula.html</link>
		<comments>http://www.st0p.org/blog/archives/delphi-sqlite-to-achieve-a-custom-formula.html#comments</comments>
		<pubDate>Fri, 02 Jul 2010 16:30:23 +0000</pubDate>
		<dc:creator>st0p</dc:creator>
				<category><![CDATA[学·武功秘籍]]></category>
		<category><![CDATA[DELPHI]]></category>
		<category><![CDATA[SQLITE]]></category>
		<category><![CDATA[自定义公式]]></category>

		<guid isPermaLink="false">http://www.st0p.org/blog/?p=524</guid>
		<description><![CDATA[把前两天的门业自动计算软件想法进行了实例化,用的DELPHI,数据库采用的是SQLITE... 发几张图晒一下,可以通过自定义公式算出需要的值,然后给出对应的图片,打印出结果,测试一段时间才知道稳定性,感觉SQLITE好像有些地方并不完善,可能PHP+SQLITE的尝试会拖后....这次只是算帮朋友,价格太低,唉.... 偶的个人信息用黑了...]]></description>
			<content:encoded><![CDATA[<p>把前两天的门业自动计算软件想法进行了实例化,用的DELPHI,数据库采用的是SQLITE...<br />
发几张图晒一下,可以通过自定义公式算出需要的值,然后给出对应的图片,打印出结果,测试一段时间才知道稳定性,感觉SQLITE好像有些地方并不完善,可能PHP+SQLITE的尝试会拖后....这次只是算帮朋友,价格太低,唉....<br />
偶的个人信息用黑了...</p>
<p><a  href="http://www.st0p.org/blog/wp-content/uploads/2010/07/delphi-sqlite-to-achieve-a-custom-formula1.gif" class="thickbox no_icon" rel="gallery-524" title=""><img src="http://www.st0p.org/blog/wp-content/uploads/2010/07/delphi-sqlite-to-achieve-a-custom-formula1.gif" alt="" title="delphi-sqlite-to-achieve-a-custom-formula1" width="845" height="655" class="alignnone size-full wp-image-525" /></a></p>
<p><a  href="http://www.st0p.org/blog/wp-content/uploads/2010/07/delphi-sqlite-to-achieve-a-custom-formula2.gif" class="thickbox no_icon" rel="gallery-524" title=""><img src="http://www.st0p.org/blog/wp-content/uploads/2010/07/delphi-sqlite-to-achieve-a-custom-formula2.gif" alt="" title="delphi-sqlite-to-achieve-a-custom-formula2" width="910" height="674" class="alignnone size-full wp-image-526" /></a></p>
<p><a  href="http://www.st0p.org/blog/wp-content/uploads/2010/07/delphi-sqlite-to-achieve-a-custom-formula3.gif" class="thickbox no_icon" rel="gallery-524" title=""><img src="http://www.st0p.org/blog/wp-content/uploads/2010/07/delphi-sqlite-to-achieve-a-custom-formula3.gif" alt="" title="delphi-sqlite-to-achieve-a-custom-formula3" width="972" height="671" class="alignnone size-full wp-image-527" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.st0p.org/blog/archives/delphi-sqlite-to-achieve-a-custom-formula.html/feed</wfw:commentRss>
		<slash:comments>164</slash:comments>
		</item>
		<item>
		<title>oracle top N</title>
		<link>http://www.st0p.org/blog/archives/oracle-top-n.html</link>
		<comments>http://www.st0p.org/blog/archives/oracle-top-n.html#comments</comments>
		<pubDate>Mon, 24 May 2010 06:18:50 +0000</pubDate>
		<dc:creator>st0p</dc:creator>
				<category><![CDATA[学·武功秘籍]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[ROWNUM]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://www.st0p.org/blog/?p=508</guid>
		<description><![CDATA[文章来源：http://huibin.javaeye.com/blog/419780 1.在ORACLE中实现SELECT TOP N 由于ORACLE不支持SELECT TOP语句，所以在ORACLE中经常是用ORDER BY跟ROWNUM的组合来实现SELECT TOP N的查询。 简单地说，实现方法如下所示： SELECT　列名１．．．列名ｎ　FROM (SELECT　列名１．．．列名ｎ　FROM 表名 ORDER BY 列名１．．．列名ｎ) WHERE ROWNUM]]></description>
			<content:encoded><![CDATA[<p>文章来源：http://huibin.javaeye.com/blog/419780</p>
<p>1.在ORACLE中实现SELECT TOP N<br />
   由于ORACLE不支持SELECT TOP语句，所以在ORACLE中经常是用ORDER BY跟ROWNUM的组合来实现SELECT TOP N的查询。</p>
<p>简单地说，实现方法如下所示：</p>
<p>      SELECT　列名１．．．列名ｎ　FROM</p>
<p>        (SELECT　列名１．．．列名ｎ　FROM 表名 ORDER BY 列名１．．．列名ｎ)</p>
<p>       WHERE ROWNUM <= N（抽出记录数）</p>
<p>      ORDER BY ROWNUM ASC</p>
<p>   下面举个例子简单说明一下。</p>
<p>顾客表customer(id,name)有如下数据：</p>
<p>      ID NAME</p>
<p>       01 first</p>
<p>       02 Second</p>
<p>       03 third</p>
<p>       04 forth</p>
<p>       05 fifth</p>
<p>       06 sixth</p>
<p>       07 seventh</p>
<p>       08 eighth</p>
<p>       09 ninth</p>
<p>       10 tenth</p>
<p>       11 last</p>
<p>   则按NAME的字母顺抽出前三个顾客的SQL语句如下所示：</p>
<p>      SELECT * FROM</p>
<p>        (SELECT * FROM CUSTOMER ORDER BY NAME)</p>
<p>       WHERE ROWNUM <= 3</p>
<p>       ORDER BY ROWNUM ASC</p>
<p>   输出结果为：</p>
<p>      ID NAME</p>
<p>       08 eighth</p>
<p>       05 fifth</p>
<p>       01 first<br />
<span id="more-508"></span><br />
2.在TOP N纪录中抽出第M（M <= N）条记录</p>
<p>在得到了TOP N的数据之后，为了抽出这N条记录中的第M条记录，我们可以考虑从ROWNUM着手。我们知道，ROWNUM是记录表中数据编号的一个隐藏子段，所以可以在得到TOP N条记录的时候同时抽出记录的ROWNUM，然后再从这N条记录中抽取记录编号为M的记录，即使我们希望得到的结果。</p>
<p>从上面的分析可以很容易得到下面的SQL语句。</p>
<p>      SELECT 列名１．．．列名ｎ FROM</p>
<p>         (</p>
<p>         SELECT ROWNUM RECNO, 列名１．．．列名ｎFROM</p>
<p>           (SELECT 列名１．．．列名ｎ FROM 表名 ORDER BY 列名１．．．列名ｎ)</p>
<p>         WHERE ROWNUM <= N（抽出记录数）</p>
<p>       ORDER BY ROWNUM ASC</p>
<p>         )</p>
<p>       WHERE RECNO = M（M <= N）</p>
<p>同样以上表的数据为基础，那么得到以NAME的字母顺排序的第二个顾客的信息的SQL语句应该这样写：</p>
<p>       SELECT ID, NAME FROM</p>
<p>         (</p>
<p>          SELECT ROWNUM RECNO, ID, NAME FROM</p>
<p>            (SELECT * FROM CUSTOMER ORDER BY NAME)</p>
<p>             WHERE ROWNUM <= 3</p>
<p>             ORDER BY ROWNUM ASC )</p>
<p>           WHERE RECNO = 2</p>
<p>     结果则为：</p>
<p>       ID NAME</p>
<p>        05 fifth</p>
<p>3.抽出按某种方式排序的记录集中的第N条记录</p>
<p>   在2的说明中，当M = N的时候，即为我们的标题讲的结果。实际上，2的做法在里面N>M的部分的数据是基本上不会用到的，我们仅仅是为了说明方便而采用。</p>
<p>   如上所述，则SQL语句应为：</p>
<p>       SELECT 列名１．．．列名ｎ FROM</p>
<p>         (</p>
<p>          SELECT ROWNUM RECNO, 列名１．．．列名ｎFROM</p>
<p>            (SELECT 列名１．．．列名ｎ FROM 表名 ORDER BY 列名１．．．列名ｎ)</p>
<p>             WHERE ROWNUM <= N（抽出记录数）</p>
<p>          ORDER BY ROWNUM ASC</p>
<p>         )</p>
<p>         WHERE RECNO = N</p>
<p>     那么，2中的例子的SQL语句则为：</p>
<p>        SELECT ID, NAME FROM</p>
<p>          (</p>
<p>           SELECT ROWNUM RECNO, ID, NAME FROM</p>
<p>             (SELECT * FROM CUSTOMER ORDER BY NAME)</p>
<p>           WHERE ROWNUM <= 2</p>
<p>           ORDER BY ROWNUM ASC</p>
<p>          )</p>
<p>          WHERE RECNO = 2</p>
<p>     结果为：</p>
<p>       ID NAME</p>
<p>        05 fifth</p>
<p>4.抽出按某种方式排序的记录集中的第M条记录开始的X条记录</p>
<p>       3里所讲得仅仅是抽取一条记录的情况，当我们需要抽取多条记录的时候，此时在2中的N的取值应该是在N >= (M + X - 1)这个范围内，当让最经济的取值就是取等好的时候了的时候了。当然最后的抽取条件也不是RECNO = N了，应该是RECNO BETWEEN M AND (M + X - 1)了，所以随之而来的SQL语句则为：</p>
<p>       SELECT 列名１．．．列名ｎ FROM</p>
<p>        (</p>
<p>         SELECT ROWNUM RECNO, 列名１．．．列名ｎFROM</p>
<p>          (</p>
<p>          SELECT 列名１．．．列名ｎ FROM 表名 ORDER BY 列名１．．．列名ｎ)</p>
<p>          WHERE ROWNUM <= N （N >= (M + X - 1)）</p>
<p>        ORDER BY ROWNUM ASC</p>
<p>          )</p>
<p>         WHERE RECNO BETWEEN M AND (M + X - 1)</p>
<p>    同样以上面的数据为例，则抽取NAME的字母顺的第2条记录开始的3条记录的SQL语句为：</p>
<p>       SELECT ID, NAME FROM</p>
<p>         (</p>
<p>          SELECT ROWNUM RECNO, ID, NAME FROM</p>
<p>            (SELECT * FROM CUSTOMER ORDER BY NAME)</p>
<p>          WHERE ROWNUM <= (2 + 3 - 1)</p>
<p>          ORDER BY ROWNUM ASC</p>
<p>         )</p>
<p>         WHERE RECNO BETWEEN 2 AND (2 + 3 - 1)</p>
<p>     结果如下：</p>
<p>       ID NAME</p>
<p>        05 fifth</p>
<p>        01 first</p>
<p>        04 forth</p>
<p>    以此为基础，再扩展的话，做成存储过程，将开始记录数以及抽取记录数为参数，就可以轻松实现分页抽取数据。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.st0p.org/blog/archives/oracle-top-n.html/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>IIS源码泄露及文件类型解析错误</title>
		<link>http://www.st0p.org/blog/archives/iis-source-code-disclosure-and-file-type-parsing-error.html</link>
		<comments>http://www.st0p.org/blog/archives/iis-source-code-disclosure-and-file-type-parsing-error.html#comments</comments>
		<pubDate>Fri, 21 May 2010 15:09:54 +0000</pubDate>
		<dc:creator>st0p</dc:creator>
				<category><![CDATA[学·武功秘籍]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[文件类型]]></category>
		<category><![CDATA[源码泄露]]></category>
		<category><![CDATA[解析错误]]></category>

		<guid isPermaLink="false">http://www.st0p.org/blog/?p=506</guid>
		<description><![CDATA[文章来源：http://www.80sec.com/iis-cgifastcgi-security-hol.html 漏洞介绍：IIS是微软推出的一款webserver，使用较为广泛，在支持asp/asp.net的同时还可以较好的支持PHP等其他语言的运行。但是80sec发现在IIS的较高版本中存在一个比较严重的安全问题，在按照网络上提供的默认配置情况下可能导致服务器泄露服务器端脚本源码，也可能错误的将任何类型的文件以PHP的方式进行解析，使得恶意的攻击者可能攻陷支持PHP的IIS服务器，特别是虚拟主机用户可能受的影响较大。 漏洞分析： IIS支持以CGI的方式运行PHP，但是此种模式下，IIS处理请求的时候可能导致一些同80sec提到的nginx安全漏洞一样的问题，任何用户可以远程将任何类型的文件以PHP的方式去解析，你可以通过查看Phpinfo中对php的支持方式，其中如果为CGI/FAST-CGI就可能存在这个问题。 黑盒访问 http://www.80sec.com/robots.txt/1.php 查看文件是否存在和返回的HTTP头就可以知道是否存在此漏洞。 同时，如果服务器支持了PHP，但应用中使用的是asp就可以通过如下方式来直接查看服务端asp源码 http://www.80sec.com/some.asp/1.php 漏洞厂商：http://www.microsoft.com 解决方案： 我们已经尝试联系官方，但是此前你可以通过以下的方式来减少损失 关闭cgi.fix_pathinfo为0]]></description>
			<content:encoded><![CDATA[<p>文章来源：http://www.80sec.com/iis-cgifastcgi-security-hol.html</p>
<p>漏洞介绍：IIS是微软推出的一款webserver，使用较为广泛，在支持asp/asp.net的同时还可以较好的支持PHP等其他语言的运行。但是80sec发现在IIS的较高版本中存在一个比较严重的安全问题，在按照网络上提供的默认配置情况下可能导致服务器泄露服务器端脚本源码，也可能错误的将任何类型的文件以PHP的方式进行解析，使得恶意的攻击者可能攻陷支持PHP的IIS服务器，特别是虚拟主机用户可能受的影响较大。</p>
<p>漏洞分析：<br />
IIS支持以CGI的方式运行PHP，但是此种模式下，IIS处理请求的时候可能导致一些同80sec提到的nginx安全漏洞一样的问题，任何用户可以远程将任何类型的文件以PHP的方式去解析，你可以通过查看Phpinfo中对php的支持方式，其中如果为CGI/FAST-CGI就可能存在这个问题。</p>
<p>黑盒访问</p>
<p>http://www.80sec.com/robots.txt/1.php</p>
<p>查看文件是否存在和返回的HTTP头就可以知道是否存在此漏洞。</p>
<p>同时，如果服务器支持了PHP，但应用中使用的是asp就可以通过如下方式来直接查看服务端asp源码</p>
<p>http://www.80sec.com/some.asp/1.php</p>
<p>漏洞厂商：http://www.microsoft.com</p>
<p>解决方案：</p>
<p>我们已经尝试联系官方，但是此前你可以通过以下的方式来减少损失</p>
<p>关闭cgi.fix_pathinfo为0</p>
]]></content:encoded>
			<wfw:commentRss>http://www.st0p.org/blog/archives/iis-source-code-disclosure-and-file-type-parsing-error.html/feed</wfw:commentRss>
		<slash:comments>85</slash:comments>
		</item>
		<item>
		<title>nginx文件类型错误解析漏洞</title>
		<link>http://www.st0p.org/blog/archives/nginx-file-type-error-parsing-vulnerability.html</link>
		<comments>http://www.st0p.org/blog/archives/nginx-file-type-error-parsing-vulnerability.html#comments</comments>
		<pubDate>Fri, 21 May 2010 12:39:49 +0000</pubDate>
		<dc:creator>st0p</dc:creator>
				<category><![CDATA[学·武功秘籍]]></category>
		<category><![CDATA[cgi.fix_pathinfo]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[PATH_INFO]]></category>
		<category><![CDATA[文件类型]]></category>
		<category><![CDATA[漏洞]]></category>
		<category><![CDATA[错误解析]]></category>

		<guid isPermaLink="false">http://www.st0p.org/blog/?p=503</guid>
		<description><![CDATA[文章来源：http://www.80sec.com/nginx-securit.html 漏洞介绍：nginx是一款高性能的web服务器，使用非常广泛，其不仅经常被用作反向代理，也可以非常好的支持PHP的运行。80sec发现其中存在一个较为严重的安全问题，默认情况下可能导致服务器错误的将任何类型的文件以PHP的方式进行解析，这将导致严重的安全问题，使得恶意的攻击者可能攻陷支持php的nginx服务器。 漏洞分析：nginx默认以cgi的方式支持php的运行，譬如在配置文件当中可以以 1 2 3 4 5 6 7 location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } 的方式支持对php的解析，location对请求进行选择的时候会使用URI环境变量进行选择，其中传递到后端Fastcgi的关键变量 SCRIPT_FILENAME由nginx生成的$fastcgi_script_name决定，而通过分析可以看到$fastcgi_script_name是直接由URI环境变量控制的，这里就是产生问题的点。而为了较好的支持PATH_INFO的提取，在PHP 的配置选项里存在cgi.fix_pathinfo选项，其目的是为了从SCRIPT_FILENAME里取出真正的脚本名。 那么假设存在一个http://www.80sec.com/80sec.jpg，我们以如下的方式去访问 http://www.80sec.com/80sec.jpg/80sec.php 将会得到一个URI /80sec.jpg/80sec.php 经过location指令，该请求将会交给后端的fastcgi处理，nginx为其设置环境变量SCRIPT_FILENAME，内容为 /scripts/80sec.jpg/80sec.php 而在其他的webserver如lighttpd当中，我们发现其中的SCRIPT_FILENAME被正确的设置为 /scripts/80sec.jpg 所以不存在此问题。 后端的fastcgi在接受到该选项时，会根据fix_pathinfo配置决定是否对SCRIPT_FILENAME进行额外的处理，一般情况下如果不对fix_pathinfo进行设置将影响使用PATH_INFO进行路由选择的应用，所以该选项一般配置开启。Php通过该选项之后将查找其中真正的脚本文件名字，查找的方式也是查看文件是否存在，这个时候将分离出SCRIPT_FILENAME和PATH_INFO分别为 /scripts/80sec.jpg和80sec.php 最后，以/scripts/80sec.jpg作为此次请求需要执行的脚本，攻击者就可以实现让nginx以php来解析任何类型的文件了。 POC： 访问一个nginx来支持php的站点，在一个任何资源的文件如robots.txt后面加上/80sec.php，这个时候你可以看到如下的区别： 访问http://www.80sec.com/robots.txt HTTP/1.1 200 OK Server: nginx/0.6.32 Date: Thu, 20 May 2010 10:05:30 [...]]]></description>
			<content:encoded><![CDATA[<p>文章来源：http://www.80sec.com/nginx-securit.html</p>
<p>漏洞介绍：nginx是一款高性能的web服务器，使用非常广泛，其不仅经常被用作反向代理，也可以非常好的支持PHP的运行。80sec发现其中存在一个较为严重的安全问题，默认情况下可能导致服务器错误的将任何类型的文件以PHP的方式进行解析，这将导致严重的安全问题，使得恶意的攻击者可能攻陷支持php的nginx服务器。</p>
<p>漏洞分析：nginx默认以cgi的方式支持php的运行，譬如在配置文件当中可以以</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;">location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:<span style="color: #ff0000;">9000</span>;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
<span style="color: #00007f;">include</span> fastcgi_params;
}</pre></td></tr></table></div>

<p>的方式支持对php的解析，location对请求进行选择的时候会使用URI环境变量进行选择，其中传递到后端Fastcgi的关键变量 SCRIPT_FILENAME由nginx生成的$fastcgi_script_name决定，而通过分析可以看到$fastcgi_script_name是直接由URI环境变量控制的，这里就是产生问题的点。而为了较好的支持PATH_INFO的提取，在PHP 的配置选项里存在cgi.fix_pathinfo选项，其目的是为了从SCRIPT_FILENAME里取出真正的脚本名。<br />
那么假设存在一个http://www.80sec.com/80sec.jpg，我们以如下的方式去访问</p>
<p>http://www.80sec.com/80sec.jpg/80sec.php</p>
<p>将会得到一个URI</p>
<p>/80sec.jpg/80sec.php</p>
<p>经过location指令，该请求将会交给后端的fastcgi处理，nginx为其设置环境变量SCRIPT_FILENAME，内容为</p>
<p>/scripts/80sec.jpg/80sec.php</p>
<p>而在其他的webserver如lighttpd当中，我们发现其中的SCRIPT_FILENAME被正确的设置为</p>
<p>/scripts/80sec.jpg</p>
<p>所以不存在此问题。<br />
后端的fastcgi在接受到该选项时，会根据fix_pathinfo配置决定是否对SCRIPT_FILENAME进行额外的处理，一般情况下如果不对fix_pathinfo进行设置将影响使用PATH_INFO进行路由选择的应用，所以该选项一般配置开启。Php通过该选项之后将查找其中真正的脚本文件名字，查找的方式也是查看文件是否存在，这个时候将分离出SCRIPT_FILENAME和PATH_INFO分别为</p>
<p>/scripts/80sec.jpg和80sec.php</p>
<p>最后，以/scripts/80sec.jpg作为此次请求需要执行的脚本，攻击者就可以实现让nginx以php来解析任何类型的文件了。</p>
<p>POC： 访问一个nginx来支持php的站点，在一个任何资源的文件如robots.txt后面加上/80sec.php，这个时候你可以看到如下的区别：</p>
<p>访问http://www.80sec.com/robots.txt</p>
<p>HTTP/1.1 200 OK<br />
Server: nginx/0.6.32<br />
Date: Thu, 20 May 2010 10:05:30 GMT<br />
Content-Type: text/plain<br />
Content-Length: 18<br />
Last-Modified: Thu, 20 May 2010 06:26:34 GMT<br />
Connection: keep-alive<br />
Keep-Alive: timeout=20<br />
Accept-Ranges: bytes</p>
<p>访问访问http://www.80sec.com/robots.txt/80sec.php</p>
<p>HTTP/1.1 200 OK<br />
Server: nginx/0.6.32<br />
Date: Thu, 20 May 2010 10:06:49 GMT<br />
Content-Type: text/html<br />
Transfer-Encoding: chunked<br />
Connection: keep-alive<br />
Keep-Alive: timeout=20<br />
X-Powered-By: PHP/5.2.6</p>
<p>其中的Content-Type的变化说明了后端负责解析的变化，该站点就可能存在漏洞。</p>
<p>漏洞厂商：http://www.nginx.org</p>
<p>解决方案：</p>
<p>我们已经尝试联系官方，但是此前你可以通过以下的方式来减少损失</p>
<p>关闭cgi.fix_pathinfo为0</p>
<p>或者</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;">if ( $fastcgi_script_name ~ \..*\/.*php ) {
return <span style="color: #ff0000;">403</span>;
}</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.st0p.org/blog/archives/nginx-file-type-error-parsing-vulnerability.html/feed</wfw:commentRss>
		<slash:comments>76</slash:comments>
		</item>
	</channel>
</rss>

