<?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>Here comes the Sun &#187; web.py</title>
	<atom:link href="http://sunng.info/blog/tag/web-py/feed/" rel="self" type="application/rss+xml" />
	<link>http://sunng.info/blog</link>
	<description>Homemade Clojure Geek</description>
	<lastBuildDate>Fri, 11 May 2012 02:24:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Lighttpd通过FastCGI运行web.py程序</title>
		<link>http://sunng.info/blog/2009/11/lighttpd%e9%80%9a%e8%bf%87fastcgi%e8%bf%90%e8%a1%8cweb-py%e7%a8%8b%e5%ba%8f/</link>
		<comments>http://sunng.info/blog/2009/11/lighttpd%e9%80%9a%e8%bf%87fastcgi%e8%bf%90%e8%a1%8cweb-py%e7%a8%8b%e5%ba%8f/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 09:31:07 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[手艺]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[web.py]]></category>

		<guid isPermaLink="false">http://www.classicning.com/blog/?p=304</guid>
		<description><![CDATA[web.py是个很小的python框架，特点就是小，连session都没有实现人家就发布了。前几天KungfuRails大会上他们吹牛说Sinatra可以写出世界上最小的Webapp，但是有web.py的化，那个最小至少要加上个“之一”。 Web.py在Lighttpd上通过fastcgi运行的配置，可以在web.py的网站上找到文档： http://webpy.org/cookbook/fastcgi-lighttpd 实际我用的时候把静态的index.html用作首页，稍改动一下： server.document-root = "/home/sun/projects/sdostatweb" server.modules += ( "mod_fastcgi" ) server.modules += ( "mod_rewrite" ) server.port = 4000 mimetype.assign = ( ".html" =&#62; "text/html" ) index-file.names = ( "index.html" ) fastcgi.server = ( "/sdostatweb.py" =&#62; (( "socket" =&#62; &#8230; <a href="http://sunng.info/blog/2009/11/lighttpd%e9%80%9a%e8%bf%87fastcgi%e8%bf%90%e8%a1%8cweb-py%e7%a8%8b%e5%ba%8f/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://webpy.org/" target="_blank">web.py</a>是个很小的python框架，特点就是小，连session都没有实现人家就发布了。前几天KungfuRails大会上他们吹牛说<a href="http://www.sinatrarb.com" target="_blank">Sinatra</a>可以写出世界上最小的Webapp，但是有web.py的化，那个最小至少要加上个“之一”。</p>
<p>Web.py在Lighttpd上通过fastcgi运行的配置，可以在web.py的网站上找到文档：<br />
<a href="http://webpy.org/cookbook/fastcgi-lighttpd">http://webpy.org/cookbook/fastcgi-lighttpd</a></p>
<p>实际我用的时候把静态的index.html用作首页，稍改动一下：</p>
<pre class="brush:plain">server.document-root = "/home/sun/projects/sdostatweb"

server.modules   += ( "mod_fastcgi" )
server.modules   += ( "mod_rewrite" )

server.port = 4000

mimetype.assign = (
    ".html" =&gt; "text/html"
)

index-file.names = ( "index.html" )

fastcgi.server = ( "/sdostatweb.py" =&gt;
(( "socket" =&gt; "/tmp/fastcgi.socket",
        "bin-path" =&gt; "/home/sun/projects/sdostatweb/sdostatweb.py",
        "max-procs" =&gt; 5,
        "bin-environment" =&gt; (
        "REAL_SCRIPT_NAME" =&gt; ""
    ),
        "check-local" =&gt; "disable"
    ))
)

url.rewrite-once = (
    "^/$" =&gt; "/static/index.html",
    "^/flotr/(.*)$" =&gt; "/static/flotr/$1",
    "^/static/(.*)$" =&gt; "/static/$1",
    "^/(.*)$" =&gt; "/sdostatweb.py/$1",

)</pre>
<p>另外用fastcgi的方式使用web.py，需要安装flup。</p>
<p>详细的事，可以看看新浪的Tim Yang的优化：<br />
<a href="http://timyang.net/python/python-webpy-lighttpd/">http://timyang.net/python/python-webpy-lighttpd/</a></p>
<p>我之前真不敢相信搜狐Mail是跑在web.py上。</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2009/11/lighttpd%e9%80%9a%e8%bf%87fastcgi%e8%bf%90%e8%a1%8cweb-py%e7%a8%8b%e5%ba%8f/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

