<?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"
	>

<channel>
	<title>IScale &#187; webserver</title>
	<atom:link href="http://dotimes.com/iscale/category/webserver/feed" rel="self" type="application/rss+xml" />
	<link>http://dotimes.com/iscale</link>
	<description>Living within Dot Times</description>
	<pubDate>Tue, 18 Nov 2008 06:04:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Standalone MoinMoin Wiki with Nginx Proxy</title>
		<link>http://dotimes.com/iscale/2008/10/standalone-moinmoin-wiki-with-nginx-proxy.html</link>
		<comments>http://dotimes.com/iscale/2008/10/standalone-moinmoin-wiki-with-nginx-proxy.html#comments</comments>
		<pubDate>Fri, 31 Oct 2008 03:12:21 +0000</pubDate>
		<dc:creator>Cherife Li</dc:creator>
		
		<category><![CDATA[proxy]]></category>

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

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

		<guid isPermaLink="false">http://dotimes.com/iscale/?p=86</guid>
		<description><![CDATA[Long time since last post here. Yeah, I&#8217;m alive.
For wiking with moin on nginx, I tried a lot and finally got it work. I&#8217;m using Moin 1.7.2 with Nginx 0.7.19 on Slackware linux.
As you may know, there is a mod called mod_wsgi which is an implementation of the Python Web Server Gateway Interface for the [...]]]></description>
			<content:encoded><![CDATA[<p>Long time since last post here. Yeah, I&#8217;m alive.</p>
<p>For wiking with moin on nginx, I tried a lot and finally got it work. I&#8217;m using Moin 1.7.2 with Nginx 0.7.19 on Slackware linux.</p>
<p>As you may know, there is a mod called mod_wsgi which is an implementation of the Python Web Server Gateway Interface for the nginx web server. However, mod_wsgi code is about 7 months old and only tested with nginx 0.5.x, currently cannot be built with nginx 0.7.x. I didn&#8217;t test it with nginx 0.6.x, but there are some patches. For more information, check http://hg.mperillo.ath.cx/nginx/mod_wsgi/file/tip/README (CANNOT access from m^therf^cking China mainland network).</p>
<p>I intended to use the public wiki mode, but unfortunately, haven&#8217;t work it out on fastcgi. Any help is welcome. :-)</p>
<p>It was <a href="http://wiki.codemongers.com/cliff" target="blank">Cliff</a> who illumined me that nginx can proxy to moin standalone server. Thanks to Cliff.</p>
<p>After some test, here is a block of the working nginx configuration on moinmoin wiki.</p>
<blockquote>
<pre>
...snip...
    server {
	listen       127.0.0.1:80;
	server_name	localhost;
	server_tokens	off;
	root	/srv;

# Begin Core MoinMoin:
	rewrite	^/moin_static[0-9]*/(.*)$	/moin/$1	last;
	rewrite ^/(favicon\.ico)$		/moin/$1	last;

### temporary use
	location = / {
		rewrite .*	/wiki/	redirect;
	}
###

	location /wiki {
		proxy_redirect		http://localhost:8000	/;
		proxy_pass		http://localhost:8000;
		proxy_set_header	X-Real-IP	$remote_addr;
		proxy_set_header	X-Forwarded-For	$proxy_add_x_forwarded_for;
		proxy_set_header	Host		$http_host;
		<strong>proxy_set_header        X-Moin-Location /wiki/;</strong>
	}
# End Core MoinMoin.

	location  ~* \.(jpg|jpeg|gif|png|ico|css|js|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mov|avi|mkv|srt|idx|sub)$ {
	    access_log	off;
	    expires	30d;
	}

	location ~* /\.ht {
            deny  all;
	}
    }
...snip...
</pre>
</blockquote>
<p>Then, http://localhost/wiki is ready.<br />
It&#8217;s an important point of the X-Moin-Location header. Moin will add that path to the output link.<br />
So far, so good.</p>
]]></content:encoded>
			<wfw:commentRss>http://dotimes.com/iscale/2008/10/standalone-moinmoin-wiki-with-nginx-proxy.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>an example of Varnish and Lighttpd</title>
		<link>http://dotimes.com/iscale/2007/12/an-example-of-varnish-and-lighttpd.html</link>
		<comments>http://dotimes.com/iscale/2007/12/an-example-of-varnish-and-lighttpd.html#comments</comments>
		<pubDate>Thu, 13 Dec 2007 12:36:52 +0000</pubDate>
		<dc:creator>Cherife Li</dc:creator>
		
		<category><![CDATA[proxy]]></category>

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

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

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

		<guid isPermaLink="false">http://dotimes.com/iscale/2007/12/an-example-of-varnish-and-lighttpd.html</guid>
		<description><![CDATA[Lighttpd on server 192.168.123.248 vhost config:

[...]
simple-vhost.server-root = "/var/web"
simple-vhost.default-host = "test.lo"
simple-vhost.document-root = "/www"
$HTTP["host"] =~ "^(www\.)?test\.lo$" {
        server.document-root = "/var/web/www"
}
$HTTP["host"] =~ "^blog\.test\.lo$" {
        server.document-root = "/var/web/blog"
}
[...]

Varnish on server 192.168.123.249 VCL file:

backend test {
set backend.host = "192.168.123.248";
set backend.port = "80";
}

acl purge {
"localhost";
"127.0.0.1";
}

sub vcl_recv {
if [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lighttpd.net/" title="Security, speed, compliance, and flexibility webserver">Lighttpd</a> on server 192.168.123.248 vhost config:</p>
<pre>
[...]
simple-vhost.server-root = "/var/web"
simple-vhost.default-host = "test.lo"
simple-vhost.document-root = "/www"
$HTTP["host"] =~ "^(www\.)?test\.lo$" {
        server.document-root = "/var/web/www"
}
$HTTP["host"] =~ "^blog\.test\.lo$" {
        server.document-root = "/var/web/blog"
}
[...]
</pre>
<p><a href="http://varnish.projects.linpro.no/" title="state-of-the-art, high-performance HTTP accelerator">Varnish</a> on server 192.168.123.249 VCL file:</p>
<pre>
backend test {
set backend.host = "192.168.123.248";
set backend.port = "80";
}

acl purge {
"localhost";
"127.0.0.1";
}

sub vcl_recv {
if (req.http.host ~ "^(www|blog\.)?test\.lo$") {
set req.backend = test;
}

else {
error 404 "Unknown virtual host";
}
if (req.request == "PURGE") {
if (!client.ip ~ purge) {
error 405 "Not allowed.";
}
}
if (req.http.Cache-Control ~ "no-cache") {
pass;
}
if (req.request != "GET" &amp;&amp; req.request != "HEAD") {
pipe;
}
if (req.http.Expect) {
pipe;
}
if (req.http.Authenticate || req.http.Cookie) {
pass;
}
lookup;
}

sub vcl_pipe {
pipe;
}

sub vcl_pass {
pass;
}

sub vcl_hash {
set req.hash += req.url;
set req.hash += req.http.host;
set req.hash += req.http.cookie;
hash;
}

sub vcl_hit {
if (req.request == "PURGE") {
set obj.ttl = 0s;
error 200 "Purged.";
}
if (!obj.cacheable) {
pass;
}
deliver;
}

sub vcl_miss {
if (req.request == "PURGE") {
error 404 "Not in cache.";
}
fetch;
}

sub vcl_fetch {
if (!obj.valid) {
error;
}
if (!obj.cacheable || obj.http.Set-Cookie|| \
        obj.http.Pragma ~ "no-cache" || \
        obj.http.Cache-Control ~ "no-cache" || \
        obj.http.Cache-Control ~ "private") {
pass;
}
if (req.request == "GET" &amp;&amp; req.url ~ "\.(txt|js)$") {
set obj.ttl = 3600s;
}
else {
set obj.ttl = 30d;
}
insert;
}

sub vcl_deliver {
deliver;
}

sub vcl_timeout {
discard;
}

sub vcl_discard {
discard;
}
</pre>
<p>Above is just a simple example, it works for me currently.<br />
Many people want to see the performance comparison between varnish and squid. Sorry but for now I couldn&#8217;t give that, maybe one day;)<br />
I&#8217;m afraid that there&#8217;s going to be a variety of  troubles to shooting, yeah, definitely.</p>
]]></content:encoded>
			<wfw:commentRss>http://dotimes.com/iscale/2007/12/an-example-of-varnish-and-lighttpd.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
