<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>lighttpd &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/lighttpd/</link>
	<description>Feed of posts on WordPress.com tagged "lighttpd"</description>
	<pubDate>Sat, 28 Nov 2009 00:43:14 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Debian Lenny, Lighttpd, PHP5 (php5-apc) and MySQL spikes]]></title>
<link>http://paolo.wordpress.com/2009/11/27/debian-lenny-lighttpd-php5-php5-apc-and-mysql-spikes/</link>
<pubDate>Fri, 27 Nov 2009 17:36:16 +0000</pubDate>
<dc:creator>paolo</dc:creator>
<guid>http://paolo.wordpress.com/2009/11/27/debian-lenny-lighttpd-php5-php5-apc-and-mysql-spikes/</guid>
<description><![CDATA[On a clean server I installed Lenny, I used aptitude to install Lighttpd (1.4.19 a bit old, I know),]]></description>
<content:encoded><![CDATA[On a clean server I installed Lenny, I used aptitude to install Lighttpd (1.4.19 a bit old, I know),]]></content:encoded>
</item>
<item>
<title><![CDATA[China gets horny]]></title>
<link>http://ajclark.wordpress.com/2009/11/01/china-gets-horny/</link>
<pubDate>Sun, 01 Nov 2009 17:06:55 +0000</pubDate>
<dc:creator>napta2k</dc:creator>
<guid>http://ajclark.wordpress.com/2009/11/01/china-gets-horny/</guid>
<description><![CDATA[Today I woke up to several alerts from Linode informing me that one of my VPS nodes was exceeding th]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Today I woke up to several alerts from Linode informing me that one of my VPS nodes was exceeding the Disk I/O threshold that I had set. Curiously this VPS is used as a HTTP web proxy and whilst it gets about 300-400 visitors per day (mainly china) this morning I was seeing over 800 visitors in Google Analytics.</p>
<p>Attempting to ssh to the server failed with timeouts although the PHP web application was still responding to requests over HTTP fine. I suspect sshd was failing to reverse-lookup my IP address in any reasonable amount of time, or perhaps IP Tables &#8211; (Note to self: Look in to why that happened). Thankfully Linode provide out of band / console access via SSH and AJax so all was not lost.</p>
<p>Looking at the Network rrdgraph it shows that the server was approaching 7Mbit/s of HTTP traffic and almost 50GB had been consumed today alone. Whilst the server seemed to handle the load without problem (minus ssh access) consuming 50GB+ per day would quickly max out my monthly data transfer allowance with Linode &#8211; this wasn&#8217;t acceptable. I modified the firewall to accept HTTP/HTTPS traffic from my IP only in order to investigate and the load suddenly stopped and SSH was alive again.</p>
<p><a href="http://ajclark.wordpress.com/files/2009/11/ehproxy-info.png"><img class="alignnone size-medium wp-image-188" title="ehproxy.info" src="http://ajclark.wordpress.com/files/2009/11/ehproxy-info.png?w=300" alt="ehproxy.info" width="300" height="136" /></a></p>
<p>Initially I had suspected that some sort of automated bot was using ehproxy.info to do automated scans and attacks but a closer inspection of the traffic showed an even number of distributed IPs (all from China &#8211; as Google Analytics confirms) all clicking various porn sites. I guess everyone in China was feeling horny this afternoon!</p>
<p><a href="http://ajclark.wordpress.com/files/2009/11/most-visited-sites.png"><img class="alignnone size-medium wp-image-189" title="most visited sites" src="http://ajclark.wordpress.com/files/2009/11/most-visited-sites.png?w=300" alt="most visited sites" width="300" height="67" /></a></p>
<p>Further analysis of the access.log shows that the server (Linode XenU VPS with 720MB of ram) was handling 62 hits sec (2428863/39600) and lighttpd was dealing with the load no problem. Pretty good considering this is a pure PHP application utilising php-cgi.</p>
<p>For the record, the top five IP addresses were:</p>
<p>Hits : IP address</p>
<div id="_mcePaste">13872 :222.242.182.169</div>
<div id="_mcePaste">14394 :123.152.129.107</div>
<div id="_mcePaste">16422 :123.11.41.255</div>
<div id="_mcePaste">18110 :113.65.146.126</div>
<div id="_mcePaste">26595 :124.134.24.218</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Senior Systems Administrator and Operations Engineer needed]]></title>
<link>http://mindsourceinc.wordpress.com/2009/10/13/senior-systems-administrator-and-operations-engineer-needed/</link>
<pubDate>Wed, 14 Oct 2009 00:53:35 +0000</pubDate>
<dc:creator>Michelle</dc:creator>
<guid>http://mindsourceinc.wordpress.com/2009/10/13/senior-systems-administrator-and-operations-engineer-needed/</guid>
<description><![CDATA[Our client in Redwood City, CA is in need of a seasoned system administrator and operations engineer]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Our client in<strong> Redwood City, CA</strong> is in need of a seasoned system administrator and operations engineer to manage, maintain and support multiple environments supporting several different architectures and environments. The successful candidate will have strong exposure to large web site deployments with multiple tiers include web front-ends, middleware components, backend services, data storage systems and 2nd/3rd tier components like caching and search layers.</p>
<p><strong>Requirements:</strong></p>
<ul>
<li>7 years Linux admin experience</li>
<li>5 years RHEL admin experience</li>
<li>5 years RPM management and admin experience</li>
<li>3 years working with MySQL</li>
<li>Sound understanding of web services and related technologies (HTTP, REST, XML, JSON, etc)</li>
<li>Experience with Linux web servers (Apache2, nginx, lighttpd, etc)</li>
<li>Experience with monitoring systems and components (nagios, cacti, etc)</li>
<li>Exposure to scripting languages such as Perl, Python, etc.</li>
</ul>
<p><strong>Really nice-to-haves but not required:</strong></p>
<ul>
<li>Experience with Erlang</li>
<li>Experience with Ruby on Rails</li>
<li>Exposure to Jabber/XMPP</li>
<li>Exposure to distributed / grid computing</li>
<li>ejabberd administration and configuration</li>
<li>Experience with second and third tier services and components like memcached (or like systems), search applications (lucene, xapian, sphinx, etc), etc.</li>
</ul>
<p><strong>Realistically, these are also nice to haves but not required:</strong></p>
<ul>
<li>Exposure to functional programming languages.</li>
<li>Exposure to the Facebook Platform, Open Social and or other web services and systems</li>
<li>Comfortable working in an Agile work environment.</li>
<li>Plays games and occasionally keeps tabs on the gaming world/industry.</li>
</ul>
<p>If interested, please send us your resume along with the rate per hour, contact number, and availability for a phone interview to <a href="mailto:raj@mindsource.com?subject=I am interested in the Systems Administrator and Operations Engineer position">raj@mindsource.com</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Show limits of a running process in Linux]]></title>
<link>http://ajclark.wordpress.com/2009/09/29/show-limits-of-a-running-process-in-linux/</link>
<pubDate>Tue, 29 Sep 2009 14:23:03 +0000</pubDate>
<dc:creator>napta2k</dc:creator>
<guid>http://ajclark.wordpress.com/2009/09/29/show-limits-of-a-running-process-in-linux/</guid>
<description><![CDATA[A rather simple but often asked question was put forward to me today: How can I see the maximum amou]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A rather simple but often asked question was put forward to me today: How can I see the maximum amount of file descriptors my running process can open? (without killing the process!)</p>
<p>Typically one would say &#8216;check ulimit -n&#8217; but lets say that a thread-driven or event-driven application like varnish or lighttpd is configured with an arbitrary amount of open file descriptors and you want to verify that they have taken effect before the application crashes.</p>
<p>A simple way to check this (atleast on Linux 2.6.26-1 or later) is to run:</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:50px;width:1px;height:1px;">svr1:~# awk &#8216;/Max open files/{ print $4}&#8217; /proc/$(pgrep -n apache)/limits</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:50px;width:1px;height:1px;">1024</div>
<pre>svr1:~# awk '/Max open files/{ print $4}' /proc/$(pgrep -n lighttpd)/limits

1024</pre>
<p>As you can see the above command returned the value of max open files for the running process. This means you can be sure that your lighttpd or varnish application will not suddenly die after being starved of file descriptors!</p>
<p>I have included the entire output of the limits table for the lighttpd process for completeness:</p>
<pre>svr1:~# cat /proc/$(pgrep -n lighttpd)/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            ms
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            8388608              unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             5824                 5824                 processes
Max open files            1024                 1024                 files
Max locked memory         32768                32768                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       5824                 5824                 signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Pylons: production environments]]></title>
<link>http://rapd.wordpress.com/2009/09/20/pylons-production-environments/</link>
<pubDate>Mon, 21 Sep 2009 05:31:43 +0000</pubDate>
<dc:creator>didip</dc:creator>
<guid>http://rapd.wordpress.com/2009/09/20/pylons-production-environments/</guid>
<description><![CDATA[First of all, there are several wiki posts at pylonshq.com already, below are some of them: http://p]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>First of all, there are several wiki posts at pylonshq.com already, below are some of them:</p>
<ul>
<li><a href="http://pylonsbook.com/en/1.0/deployment.html" target="_blank">http://pylonsbook.com/en/1.0/deployment.html</a></li>
<li><a href="http://wiki.pylonshq.com/display/pylonscookbook/Running+Pylons+with+NGINX" target="_blank">http://wiki.pylonshq.com/display/pylonscookbook/Running+Pylons+with+NGINX</a></li>
<li><a href="http://wiki.pylonshq.com/display/pylonscookbook/Running+Pylons+with+SCGI+and+Lighttpd" target="_blank">http://wiki.pylonshq.com/display/pylonscookbook/Running+Pylons+with+SCGI+and+Lighttpd</a></li>
</ul>
<p>I believe there&#8217;s not a single best solution in choosing any of these strategies. This post is intended as sharing my experience in some of these. I&#8217;m definitely not set on particular one and will change my mind once I gained better understanding.</p>
<p><strong>My testing methodology</strong></p>
<p>I&#8217;m currently testing multiple deployment configurations on the same app, thus giving me the opportunity to blog about it. I use <em>Apache Benchmark</em> (on client side), <em>top</em> and <em>ps afx</em> on server side. My machine is 1 Linode 1440 instance.</p>
<p>My AB setup are:</p>
<pre><code>ab -n 500 -c 50 -k http://rootapp.com/

ab -n 1200 -c 50 -k http://rootapp.com/

ab -n 1500 -c 50 -k http://rootapp.com/

ab -n 800 -c 800 -k http://rootapp.com/</code></pre>
<p>The results varied insignificantly with some subtle interesting differences. I&#8217;ll explain those below.</p>
<p><strong>Note:</strong> I am testing these configuration on dynamic AJAX-y web application, thus reporting hard numbers is not very useful.</p>
<p><strong>CherryPy vs Paste HTTP Server behind NGINX<br />
</strong></p>
<p>One thing  that I noticed immediately is that CherryPy has better performance than Paste&#8217;s HTTP server. On both, having multiple processes does not help much on overall performance, but significantly reduces number of failed requests. When run under multiple processes, CherryPy consistently have the least number of failed requests.</p>
<p>For my setup having 7-8 processes is the sweet spot. When I have more than that, <em>top</em> is telling me that the latter processes are under utilized.</p>
<p>Setting up CherryPy on your production.ini is painless:</p>
<pre><code>use = egg:PasteScript#cherrypy
numthreads = 20
request_queue_size = 512
host = %(http_host)s
port = %(http_port)s
</code></pre>
<p>By just comparing the two, CherryPy is easily the winner.</p>
<p><strong>Lighttpd and SCGI</strong></p>
<p>This <a href="http://gist.github.com/190076" target="_blank">gist</a> is basic configuration to get SCGI up and running on lighttpd while the following is setup for your production.ini:</p>
<pre><code>use = egg:Flup#scgi_thread
host = %(http_host)s
port = %(http_port)s</code></pre>
<p>given the same AB configuration as CherryPy and Paste counterpart, lighttpd and SCGI consistently capable of handling 30 requests/seconds. About 8-10 requests/seconds more than CherryPy. Even though this setup is better, I noticed that memory consumption continues to go up after 2 weeks. I haven&#8217;t spend much time in investigating why. The reason I didn&#8217;t choose this path is more because I simply like NGINX better.</p>
<p>If only SCGI module on NGINX isn&#8217;t so experimental.</p>
<p><strong>NGINX and FastCGI</strong></p>
<p>This <a href="http://gist.github.com/190084" target="_blank">gist</a> is basic configuration to get FastCGI running on NGINX while the following is setup for your production.ini:</p>
<pre><code>use = egg:Flup#fcgi_thread
host = %(http_host)s
port = %(http_port)s</code></pre>
<p>With this configuration, I consistently get about 25 requests/seconds. It&#8217;s a bit behind lighttpd and SCGI configuration. Interestingly, when run under <em>ab -n 1500 -c 50 -k</em>, this configuration hangs NGINX requiring it to be restarted. It only happen once though.</p>
<p>Again, when load balanced properly (depending on your app), any one of these configurations would work well. Hopefully this post can help others to get up to speed in Pylons deployment.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Apache vs Nginx vs Lighttpd vs G-WAN vs Rack? Which is fast, simpler to configure and administer?]]></title>
<link>http://maheshvnit.wordpress.com/2009/09/06/apache-vs-nginx-vs-lighttpd-vs-g-wan-vs-rack-which-is-fast-simpler-to-configure-and-administer/</link>
<pubDate>Sun, 06 Sep 2009 09:47:41 +0000</pubDate>
<dc:creator>maheshvnit</dc:creator>
<guid>http://maheshvnit.wordpress.com/2009/09/06/apache-vs-nginx-vs-lighttpd-vs-g-wan-vs-rack-which-is-fast-simpler-to-configure-and-administer/</guid>
<description><![CDATA[hello friends i am thinking about a web server which is better in terms of performance, configuratio]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>hello friends i am thinking about a web server which is better in terms of performance, configuration and adminstration.</p>
<p>i have read some articles like bellow, you also can check:</p>
<p>1) apache vs nginx vs lighttpd? Which is simpler to configure and administer?<br />
<a style="outline-width:initial;outline-style:none;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;text-decoration:none;color:#003399;border:0 initial initial;margin:0;padding:0;" href="http://www.linkedin.com/redirect?url=http%3A%2F%2Fstackoverflow%2Ecom%2Fquestions%2F475386%2Fapache-vs-nginx-vs-lighttpd-which-is-simpler-to-configure-and-administer&#38;urlhash=tFba&#38;_t=disc_detail_link" target="_blank">http://stackoverflow.com/questions/475386/apache-vs-nginx-vs-lighttpd-which-is-simpler-to-configure-and-administer</a></p>
<p>2) Lighttpd vs Apache HTTP Server<br />
<a style="outline-width:initial;outline-style:none;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;text-decoration:none;color:#003399;border:0 initial initial;margin:0;padding:0;" href="http://www.linkedin.com/redirect?url=http%3A%2F%2Fdurgaprasad%2Ewordpress%2Ecom%2F2006%2F09%2F28%2Flighttpd-vs-apache-http-server%2F&#38;urlhash=MIMX&#38;_t=disc_detail_link" target="_blank">http://durgaprasad.wordpress.com/2006/09/28/lighttpd-vs-apache-http-server/</a></p>
<p>3) Lighttpd vs nginx<br />
<a style="outline-width:initial;outline-style:none;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;text-decoration:none;color:#003399;border:0 initial initial;margin:0;padding:0;" href="http://www.linkedin.com/redirect?url=http%3A%2F%2Fwww%2Ewikivs%2Ecom%2Fwiki%2FLighttpd_vs_nginx&#38;urlhash=o8nY&#38;_t=disc_detail_link" target="_blank">http://www.wikivs.com/wiki/Lighttpd_vs_nginx</a></p>
<p>4) Apache vs TrustLeap G-WAN vs Rock<br />
<a style="outline-width:initial;outline-style:none;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;text-decoration:none;color:#003399;border:0 initial initial;margin:0;padding:0;" href="http://www.linkedin.com/redirect?url=http%3A%2F%2Ftrustleap%2Ecom%2F&#38;urlhash=XBqF&#38;_t=disc_detail_link" target="_blank">http://trustleap.com/</a></p>
<h3 style="outline-width:0;outline-style:initial;outline-color:initial;font-weight:normal;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;border:0 initial initial;margin:0;padding:0;"><span style="outline-width:0;outline-style:initial;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;border:0 initial initial;margin:0;padding:0;">5) nGinx vs Lighttpd &#8211; web server of choice<br />
</span><a style="outline-width:initial;outline-style:none;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;text-decoration:none;color:#003399;border:0 initial initial;margin:0;padding:0;" href="http://www.linkedin.com/redirect?url=http%3A%2F%2Fblog%2Egrik%2Enet%2F2007%2F08%2Fnginx-vs-lighttpd-web-server-of-choice%2Ehtml&#38;urlhash=3F5v&#38;_t=tracking_disc" target="_blank">http://blog.grik.net/2007/08/nginx-vs-lighttpd-web-server-of-choice.html</a> <span style="outline-width:0;outline-style:initial;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;border:0 initial initial;margin:0;padding:0;"></p>
<p>6) Nginx vs. Lighttpd for a small VPS<br />
<a style="outline-width:initial;outline-style:none;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;text-decoration:none;color:#003399;border:0 initial initial;margin:0;padding:0;" href="http://www.linkedin.com/redirect?url=http%3A%2F%2Fhostingfu%2Ecom%2Farticle%2Fnginx-vs-lighttpd-for-a-small-vps&#38;urlhash=8kvv&#38;_t=tracking_disc" target="_blank">http://hostingfu.com/article/nginx-vs-lighttpd-for-a-small-vps</a> <span style="outline-width:0;outline-style:initial;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;border:0 initial initial;margin:0;padding:0;"> </span></p>
<p>7) Nginx, my new favorite front end for mongrel cluster<br />
<a style="outline-width:initial;outline-style:none;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;text-decoration:none;color:#003399;border:0 initial initial;margin:0;padding:0;" href="http://www.linkedin.com/redirect?url=http%3A%2F%2Fbrainspl%2Eat%2Farticles%2F2006%2F08%2F23%2Fnginx-my-new-favorite-front-end-for-mongrel-cluster&#38;urlhash=PaMb&#38;_t=tracking_disc" target="_blank">http://brainspl.at/articles/2006/08/23/nginx-my-new-favorite-front-end-for-mongrel-cluster</a></p>
<p></span></h3>
<p>8.) The Other free Web Server out there!</p>
<p><a href="http://www.cherokee-project.com/" target="_blank">http://www.cherokee-project.com/</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Python web development woes]]></title>
<link>http://nicolas314.wordpress.com/2009/08/27/python-web-development-woes/</link>
<pubDate>Thu, 27 Aug 2009 21:43:42 +0000</pubDate>
<dc:creator>nicolas314</dc:creator>
<guid>http://nicolas314.wordpress.com/2009/08/27/python-web-development-woes/</guid>
<description><![CDATA[Writing a 2c web app is a lot harder than it looks. Objective Write a mockup prototype for a web-bas]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><em>Writing a 2c web app is a lot harder than it looks.</em></p>
<h2>Objective</h2>
<p>Write a mockup prototype for a web-based application. Tools: anything you like, as long as the job is done quickly and can easily be modified to accomodate rapidly-evolving requirements.  In fact, this application is meant as a living demonstration of the future full-fledged stuff re-programmed later with something industrial-grade. Think of it as specifications that compile and can actually be run.</p>
<p>As the local Python expert I thought I would demonstrate how it can quickly get the job done with a minimal amount of efforts. Little did I know&#8230;</p>
<h2>Choosing the web server</h2>
<p>We are dealing with something that will essentially be web-based, choosing the appropriate web server seems the first thing to do.</p>
<p>I have worked with two web servers in the past: <a href="http://www.apache.org">Apache</a> and <a href="http://www.lighttpd.net">lighttpd</a>. Apache is notoriously difficult to configure, the config file is full of traps and possible inconsistencies. There are complete books and tutorials on the Net about how to configure your own server and believe me they are all worth consulting. Apache is a really good server but if you have never used it you&#8217;d better plan a couple of weeks in advance to learn how to use it correctly.</p>
<p><a href="http://www.lighttpd.net">lighttpd</a> (pronounced &#8220;lighty&#8221;) is a really fast and lightweight server, much easier to configure. Once you have it installed you can literally have it run within minutes. Unfortunately it does not support https client-side certificates (yet) and that feature is needed for what I want to do. One guy recently submitted a <a href="http://redmine.lighttpd.net/issues/1288"> related patch </a> but unfortunately I could not get it to work against every version of lighttpd I could find. Exit lighttpd, welcome Apache!</p>
<h2>First attempt: Python CGI script</h2>
<p>Python comes with a <a href="http://docs.python.org/library/cgi.html">cgi module</a> that is great for writing demo scripts but quickly becomes a serious pain whenever you want to implement anything more complicated like logins, sessions or database-related stuff. This is really bare-bone but maybe a little too much. After spending half a day re-coding a session mechanism I finally gave up and moved on to the next stage.</p>
<h2>Second attempt: Apache + mod_python</h2>
<p><a href="http://www.modpython.org/">mod_python</a> is great! A <a href="http://www.modpython.org/live/current/doc-html/hand-pub.html">Publisher algorithm</a> browses through your Python files and publishes on the web server anything that looks like a string or a callable. Imagine a static server responding to these URLs:</p>
<pre>http://[server]/hello
http://[server]/world</pre>
<p>If you have a Python module containing two top-level strings named &#8216;hello&#8217; and &#8216;world&#8217;, they will be published by mod_python and displayed verbatim. More interesting of course is to use callables (functions or instances) for a dynamic site.</p>
<p>Took me a complete week to finish the site with mod_python but development was a breeze. I spent more time in my application business than with the tools themselves, which is the main reason for using tools like Python.</p>
<p>And then I reached a stopping point: I need to authorize web clients to upload XML files to the server in an unusual MIME type. Unfortunately mod_python offers no support to do this and even worse: it silently absorbs the uploaded files and does not even bother warning your application that it missed a client request. Going through mod_python forums I could find that somebody else already mentioned this to the developers but the feature was rejected because <em>if you want to do serious web stuff you should move to WSGI</em>.</p>
<p>At that point I could have gone back to CGI for the file uploading stuff but I did not want to live with a schizophrenic code being half CGI half mod_python. Besides, I do not even want to know how much time I would have needed to make this work in the Apache configuration file. Time to leave mod_python behind and move on.</p>
<h2>Third attempt: Python WSGI</h2>
<p>Now I have to wade through this infamous WSGI stuff and see if it is really worth all the buzz. To make things short: WSGI is a pure Python standard that specifies how a Web framework should behave at its lowest level. The intention is to make it easier to port a WSGI-compliant application from one framework or web server to another without having to re-code anything.</p>
<p>I read the <a href="http://www.python.org/dev/peps/pep-0333/">full specifications for WSGI</a> and I have to admit I did not really understand the motivations behind this design. But oh well, I trust the guys to have done a good job at factorizing web frameworks. The WSGI standard itself is really low-level.  There is no way you can develop a web site just armed with it, it is only meant for middleware providers. So let&#8217;s hunt for WSGI middleware!</p>
<h2>WSGI stage 1: Django, Pylons</h2>
<p><a href="http://www.djangoproject.com/">Django</a> and <a href="http://pylonshq.com/">Pylons</a> are full-fledged frameworks that come up with all bells and whistles. Nothing bad with these but they do suffer from the same issues, namely:</p>
<ul>
<li>They offer about a zillion features I do not care about</li>
<li>They cover almost everything I need, but not quite</li>
</ul>
<p>Which means that I will probably end up deploying lots of packages I will never use and will have to code additional functionalities into their framework just to cover my own needs.</p>
<p>Both packages come with half a million dependencies on various additional packages, and every package means more maintenance.  I spent a couple of days on each to try and explore and came to the conclusion that it must be really great to use them as a basis for a larger project but I would not want to do it.</p>
<p>Mental note: I need to train myself on these frameworks, it might come handy some day.</p>
<h2>WSGI stage 2: Bottle</h2>
<p><a href="http://bottle.paws.de">Bottle</a> is a lightweight WSGI environment all contained within a single file. Can&#8217;t beat that in terms of the fewest dependencies!  It offers a very simple syntax to route your URLs to your objects and makes for clean code like:</p>
<pre>@route('/admin')
def administration():
return '.... html page here ....'

@route('/')
def index():
return '.... html page here ....'</pre>
<p>Nice package, but I would largely prefer having the framework pick routable objects directly from my Python modules, like mod_python&#8217;s Publisher does. There were some other features missing from it and Bottle does not seem to be maintained any more, so I reluctantly decided not to use it.</p>
<p>Just out of curiosity I also tried to run Bottle within lighttpd, loosing another evening in the process. lighttpd does not support WSGI, you have to install yet another middleware layer (<a href="http://trac.saddi.com/flup">python-flup</a>) and run the server in FCGI mode. After a whole evening of messing around I still could not get any Hello World out of my setup and ended up tracking an obscure bug in the way lighttpd spawns sub-processes. I do not have the courage to get into that in depth.</p>
<p>My conclusion on lighttpd: great for serving static files, still a long way to go before it can compete with Apache. I have no doubt the lighttpd guys will eventually get there though.</p>
<h2>WSGI stage 3: Colubrid, Werkzeug</h2>
<p><a href="http://wsgiarea.pocoo.org/colubrid/">Colubrid</a> offers exactly the kind of thing I need: a Publisher algorithm that goes through your objects and publishes them at predictable URLs. It took me no more than an hour to transform my mod_python application to Colubrid and see it run. Documentation for this project is pretty sparse though, and it is unfortunately not maintained any more. The authors refer to Werkzeug as the tool of choice now.</p>
<p>Enters <a href="http://werkzeug.pocoo.org/">Werkzeug</a>: described as a library of WSGI helpers, it tends to suffer from the same overweight issues as Django or Pylons. A lot of dependencies on other libraries and a model that is really hard to understand. I spent a couple of hours going through the tutorial and could not make sense out of it. It is probably very powerful but seems inadequate for my brain.</p>
<p>So Colubrid it will be. It is unmaintained but the library does not force other dependencies and even if it has little documentation I can at least understand it. If I ever face issues I will modify it to suit my needs without fear of seeing my own patches overwritten by a new version. I found a couple of bugs but no showstopper for the moment.</p>
<h2>Wrapping it up</h2>
<p>I learned quite a lot in the process. Python is sufficiently high-level to expect development to be quick and to the point.  And in a way, that goal is pretty much achieved. Getting a dynamic web application is just a matter of coding your business logic into classes and then hooking them into a View and a database.</p>
<p>On the other hand, the sheer number of dependencies for most frameworks is a definitive showstopper for production. Many of these libraries are still relatively young and lack the polish needed to adapt from the package developer&#8217;s needs to your own.</p>
<p>Another thing I learned is that as time goes on, Python frameworks tend to become more and more complicated, to the point that there is little left for people like me who want to just have something that handles the HTTP protocol and lets you hook in the tools you need one at a time.</p>
<p>Oh well&#8230; Give me enough time and I might just <a href="http://gojko.net/2008/12/05/photo-of-the-day-it-looks-like-youre-writing-a-framework/">end up writing my own</a>.</p>
<div id="attachment_74" class="wp-caption alignleft" style="width: 460px"><img class="size-full wp-image-74" title="Looks like you are writing a framework" src="http://nicolas314.wordpress.com/files/2009/08/framework.jpg" alt="Looks like you are writing a framework" width="450" height="299" /><p class="wp-caption-text">Looks like you are writing a framework</p></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[TPU Image Hosting - it's really simple]]></title>
<link>http://techpowerup.wordpress.com/2009/08/08/tpu-image-hosting-its-so-simple/</link>
<pubDate>Sat, 08 Aug 2009 08:49:05 +0000</pubDate>
<dc:creator>techpowerup</dc:creator>
<guid>http://techpowerup.wordpress.com/2009/08/08/tpu-image-hosting-its-so-simple/</guid>
<description><![CDATA[The image hosting at techpowerup.org is running on our mail server which is an old, old machine stil]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>The image hosting at techpowerup.org is running on our mail server which is an old, old machine still hosted at ThePlanet. I&#8217;m reluctant to move it because properly setting up a mail server takes a long time and could break a lot of things &#8211; wouldn&#8217;t want to miss a &#8220;you won the lottery&#8221; notification.</p>
<p><!--more--></p>
<p>So I had this box sitting around sorting emails all day. Why not put something useful on it&#8230;</p>
<p>Back in 2006 all free image hosting services sucked big time (don&#8217;t they still today?), so why not setup some free image hosting.</p>
<p>It&#8217;s all really simple:</p>
<ul>
<li>Give user some kind of upload page with file browser,</li>
<li>upload image to Apache sitting on <a href="http://www.techowerup.org">www.techpowerup.org</a>,</li>
<li>use PHP and ImageMagick to process it,</li>
<li>put it somewhere on the HDD.</li>
<li>Give the user a link to img.techpowerup.com which is a different IP on which Lighttpd is running that serves the images from the HDD.</li>
</ul>
<p>Why Lighttpd ? Apache sucks to serve static content. When using mod_php every single apache worker consumes around 20 MB of RAM. Due to the prefork design you can run a maximum of 255 concurrent workers. So either you run out of memory ( 255 * 20 = 5.1 GB) or out of workers, but you are never able to handle more than 255 concurrent requests at a time.</p>
<p>Lighttpd has been designed and optimized to serve static content fast and with very limited memory use.</p>
<p>I&#8217;ve seen Lighttpd on our servers with several thousand connections using only a few hundred MB of memory and almost no CPU (note: disk seeks will start killing you at this point).</p>
<p>Another good Lighttpd alternative is nginx.</p>
<p>Main two reasons why we use Lighttpd and not nginx is that nginx doesn&#8217;t have a dynamic plugin architecture, all &#8220;plugins&#8221; have to be compiled in at compile time. This means constant nginx recompiles.<br />
Second point is that Lighttpd has a nicer status module than nginx.</p>
<p>Right now Lighttpd development cycles are extremely slow and I doubt we will ever see a major new release version.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Lousy jailed-lighttpd scripts]]></title>
<link>http://geektivities.wordpress.com/2009/08/06/lousy-jailed-lighttpd-scripts/</link>
<pubDate>Thu, 06 Aug 2009 02:30:52 +0000</pubDate>
<dc:creator>thandle</dc:creator>
<guid>http://geektivities.wordpress.com/2009/08/06/lousy-jailed-lighttpd-scripts/</guid>
<description><![CDATA[Now, jailed has its own automated scripts to generate its own proper fully-contained jails (as far a]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Now, jailed has its own automated scripts to generate its own proper fully-contained jails (as far as &#8220;jails&#8221; on GNU/Linux go, that is; they&#8217;re chroots, actually).</p>
<p>The following scripts are leftovers from me trying to do the same, before finding out that the utilities are already there. They have been lying around for quite some time. I&#8217;m just copying them here so I can delete them from the home dir.</p>
<p>=====</p>
<p>jailed-lighttpd-install<br />
&#8212;&#8211;</p>
<pre><code>#!/bin/sh
# Create a jail for lighttpd

jail=/jail/lighttpd

mkdir -p $jail
cd $jail

mkdir tmp
chmod 1777 tmp

mkdir -p        var/log/lighttpd var/run/lighttpd home/http
chown http:http var/log/lighttpd var/run/lighttpd home/http
chmod a+rx      var/log/lighttpd var/run/lighttpd home/http

mkdir etc
cp -avr /etc/php etc/
cp -v /etc/hosts /etc/nsswitch.conf /etc/resolv.conf /etc/services /etc/localtime etc/
cp -v /etc/group /etc/host.conf /etc/passwd /etc/protocols etc/

mkdir -p usr/bin
cp /usr/bin/php /usr/bin/php-cgi usr/bin/

# read l2chroot before use
./l2chroot /usr/bin/php
./l2chroot /usr/bin/php-cgi

# just in case some permissions were forgotten...
chmod a+rx $jail</code></pre>
<p>=====</p>
<p>jailed-lighttpd.rc<br />
&#8212;&#8211;</p>
<pre><code>#!/bin/bash

# general config
. /etc/rc.conf
. /etc/rc.d/functions

jailroot=/jail/lighttpd
function jailcmd () {
su http -c "$*"
}

PID=`pidof -o %PPID /usr/sbin/lighttpd`

case "$1" in
start)
stat_busy "Starting jailed lighttpd Daemon"
[ -z "$PID" ] &#38;&#38; jk_chrootlaunch -j $jailroot -x /usr/sbin/lighttpd -- -f /etc/lighttpd/lighttpd.conf 2&#62;&#38;1
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon lighttpd
stat_done
fi
;;
stop)
stat_busy "Stopping jailed lighttpd Daemon"
[ ! -z "$PID" ] &#38;&#38; jailcmd kill $PID &#38;&#62;/dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon lighttpd
rm -f $jailroot/var/run/lighttpd/lighttpd.pid
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start&#124;stop&#124;restart}"
esac</code></pre>
<p>=====</p>
<p>l2chroot<br />
&#8212;&#8211;</p>
<pre><code>#!/bin/bash
# Use this script to copy shared (libs) files to Apache/Lighttpd chrooted
# jail server.
# ----------------------------------------------------------------------------
# Written by nixCraft &#60;http://www.cyberciti.biz/tips/&#62;
# (c) 2006 nixCraft under GNU GPL v2.0+
# + Added ld-linux support
# + Added error checking support
# ------------------------------------------------------------------------------
# See url for usage:
# http://www.cyberciti.biz/tips/howto-setup-lighttpd-php-mysql-chrooted-jail.html
# -------------------------------------------------------------------------------
# Set CHROOT directory name
BASE="/jail/lighttpd"

if [ $# -eq 0 ]; then
echo "Syntax : $0 /path/to/executable"
echo "Example: $0 /usr/bin/php5-cgi"
exit 1
fi

[ ! $BASE ] &#38;&#38; mkdir -p $BASE &#124;&#124; :

# iggy ld-linux* file as it is not shared one
FILES="$(ldd $1 &#124; awk '{ print $3 }' &#124;egrep -v ^'\(')"

echo "Copying shared files/libs to $BASE..."
for i in $FILES
do
d="$(dirname $i)"
[ ! -d $BASE$d ] &#38;&#38; mkdir -p $BASE$d &#124;&#124; :
/bin/cp $i $BASE$d
done

# copy /lib/ld-linux* or /lib64/ld-linux* to $BASE/$sldlsubdir
# get ld-linux full file location
sldl="$(ldd $1 &#124; grep 'ld-linux' &#124; awk '{ print $1}')"
# now get sub-dir
sldlsubdir="$(dirname $sldl)"

if [ ! -f $BASE$sldl ];
then
echo "Copying $sldl $BASE$sldlsubdir..."
/bin/cp $sldl $BASE$sldlsubdir
else
:
fi</code></pre>
<p>=====</p>
<p>There. Sorry for the tabbing, it went AWOL.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Installation d'une Dedibox]]></title>
<link>http://nesoblog.wordpress.com/2009/08/04/installation-dune-dedibox/</link>
<pubDate>Tue, 04 Aug 2009 08:30:41 +0000</pubDate>
<dc:creator>Nesousx</dc:creator>
<guid>http://nesoblog.wordpress.com/2009/08/04/installation-dune-dedibox/</guid>
<description><![CDATA[Voilà, j&#8217;ai (enfin) reçu ma Dedibox, c&#8217;est parti pour un petit tour d&#8217;horizon ! ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Voilà, j&#8217;ai (enfin) reçu ma Dedibox, c&#8217;est parti pour un petit tour d&#8217;horizon !</p>
<p>           &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<h3>Matériel, Dedibox XL :</h3>
<p>Core2Duo @ 2.0GHz<br />
3 Go DDR2<br />
500 Go DD<br />
100 Mbit/s</p>
<h3>Installation :</h3>
<p>Debian 5.0 (64bits)<br />
swap de 2 Go<br />
/home de 100 Go<br />
/var de 300 Go<br />
le reste pour le /</p>
<h3>Première prise de contrôle :</h3>
<p>Avec putty, toute première chose à faire &#8220;sécuriser&#8221; le serveur. Pour ce faire j&#8217;ai décidé de changer le port de SSH et d&#8217;interdire le login en tant que root.<br />
Une fois connecté à votre serveur, tapez :</p>
<blockquote><p>su</p></blockquote>
<p> puis votre mot de passe root, ensuite :</p>
<blockquote><p>nano /etc/ssh/sshd_config</p></blockquote>
<p>dans ce fichier, changer le <strong>port</strong> par un numéro de votre choix (au-dessus de 1000 par exemple), et à la ligne <strong>PermitRootLogin</strong> remplacez &#8220;yes&#8221; par &#8220;no&#8221;.</p>
<p>Et enfin :</p>
<blockquote><p>/etc/init.d/ssh restart</p></blockquote>
<p>Déconnectez-vous, modifiez le port dans putty, puis essayer de vous loger en root, et / ou avec l&#8217;ancien port (22). Si tout c&#8217;est bien passé, vous ne devriez plus pouvoir vous connecter en root, ni sur le port 22.</p>
<p><em>Voilà, pour la base de la base niveau sécurisation.</em></p>
<h3>Mise à jour :</h3>
<p>En root, tapez les commandes suivantes (dans l&#8217;ordre indiqué) :</p>
<blockquote><p>apt-get update</p></blockquote>
<blockquote><p>apt-get upgrade</p></blockquote>
<h3> Installation de Lighty :</h3>
<p>Pour ce faire, suivez le guide, <a href="http://www.cyberciti.biz/tips/installing-and-configuring-lighttpd-webserver-howto.html#lightyconfig">ici</a> !</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[VPS Optimization for High Traffic Sites]]></title>
<link>http://lesleyharrison.wordpress.com/2009/07/16/vps-optimization-for-high-traffic-sites/</link>
<pubDate>Thu, 16 Jul 2009 16:18:05 +0000</pubDate>
<dc:creator>lesleyharrison</dc:creator>
<guid>http://lesleyharrison.wordpress.com/2009/07/16/vps-optimization-for-high-traffic-sites/</guid>
<description><![CDATA[I have a VPS with 384MB RAM available as standard, and the option to burst up to 1GB. This is enough]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I have a VPS with 384MB RAM available as standard, and the option to burst up to 1GB.</p>
<p>This is enough to run some fairly high traffic sites if you&#8217;re careful with the setup, but with the default setups and fancy control panels, you&#8217;ll exceed the memory limit quite quickly.</p>
<p>I use Citadel as the email client, but I&#8217;ve disabled Webcit.  I also removed Spam Assassin, and just use the Realtime Blackhole List to prevent spam.  Those simple changes have shaved over 100MB off my normal usage, but there&#8217;s still a lot to go.</p>
<p><em>top </em>shows that memory usage is leaking up into the burst limit over time &#8211; even with some basic optimizations of httpd.conf and MySQL.  I&#8217;m considering trying lighttpd instead of Apache2 &#8211; I really don&#8217;t NEED Apache2, and it seems to be quiet a hog.</p>
<p>The other possible optimization would be to use something lightweight in place of named &#8211; which is currently sat at 180m memory usage!</p>
<p>If anyone has any favourite lightweight alternatives to named, I&#8217;d love to hear about them.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Linux Tutorials per tutti i gusti su HowToForge!]]></title>
<link>http://discoverylinux.wordpress.com/2009/07/15/linux-tutorials-per-tutti-i-gusti-su-howtoforge/</link>
<pubDate>Wed, 15 Jul 2009 09:13:01 +0000</pubDate>
<dc:creator>sparazza</dc:creator>
<guid>http://discoverylinux.wordpress.com/2009/07/15/linux-tutorials-per-tutti-i-gusti-su-howtoforge/</guid>
<description><![CDATA[&#8220;HowtoForge provides user-friendly Linux tutorials about almost every topic.&#8221; howtoforge]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="aligncenter size-full wp-image-305" title="howtoforge logo icon" src="http://discoverylinux.wordpress.com/files/2009/07/schermata.png" alt="howtoforge logo icon" width="270" height="118" /></p>
<blockquote><p>&#8220;HowtoForge provides user-friendly Linux tutorials about almost every topic.&#8221;</p></blockquote>
<p><a href="http://www.howtoforge.com" target="_blank">howtoforge</a> contiene tantissimi<strong> tutorial </strong>davvero per tutti i gusti.</p>
<p>Prima di <strong>googlare</strong> su come si configura l&#8217;ssh, come si abilita virtualbox 3 o su tutto quello che vi passa per la testa, vi consiglio di fare sempre un salto in questo paradiso di guide online che copre qualsiasi argomento d&#8217;interesse ( del mondo linux ovviamente ):</p>
<blockquote><p>Howtos, Linux, CentOS, Debian, Fedora, Kernel, Mandriva, PCLinuxOS, SuSE, Ubuntu, Apache, Backup, Control Panels, DNS, Desktop, Email, Anti-Spam/Virus, Postfix, Procmail, Sendmail, FTP, High-Availability, Lighttpd, Monitoring, MySQL, Programming, C/C++, PHP, Samba, Security, Anti-Spam/Virus, Virtualization, Other, FreeBSD, Commercial, Mini-Howtos.</p></blockquote>
<p><strong>Link</strong> <a href="http://www.howtoforge.com" target="_blank">www.howtoforge.com</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Ruby on rails]]></title>
<link>http://paraprogramar.wordpress.com/2009/07/11/ruby-on-rails/</link>
<pubDate>Sat, 11 Jul 2009 02:56:11 +0000</pubDate>
<dc:creator>Mario</dc:creator>
<guid>http://paraprogramar.wordpress.com/2009/07/11/ruby-on-rails/</guid>
<description><![CDATA[Rails es un completo entorno para desarrollar aplicaciones web con base de datos de acuerdo con la e]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Rails es un completo entorno para desarrollar aplicaciones web con base de datos de acuerdo con la estructura Model-View-Control. Desde el Ajax en la vista, a la petición y respuesta en el controlador, hasta el modelo, Rails te da un entorno de desarrollo de Ruby. Para probarlo, solo necesitas una base de datos y un servidor web.</p>
<p>Todo el mundo desde startups a organizaciones sin ánimo de lucro pasando por compañías están usando Rails. Rails es todo acerca de la infraestructura así que se acopla perfectamente en cualquier tipo de aplicacion web Es software para colaboración, comunidad, e-commercio, cms, estatísticas, control, como quieras llamarlo. Algunos ejemplos:</p>
<div><a href="http://www.rubyonrails.org.es/images/applications/basecamp.gif"></a><a href="http://www.basecamphq.com/">Basecamp</a>: Control de proyectos.</div>
<div><a href="http://www.lacoctelera.com/"></a><a href="http://www.lacoctelera.com/">La Coctelera</a>: Crea tu blog.</div>
<div> </div>
<div><a href="http://www.43things.com/"></a><a href="http://www.43things.com/">43things</a>: Consigue tus metas en la vida.</div>
<div><a href="http://www.odeo.com/"></a><a href="http://www.odeo.com/">ODEO</a>: Graba y comparte audio.</div>
<div> </div>
<div><a href="http://www.strongspace.com/"></a><a href="http://www.strongspace.com/">Strongspace</a>: Alojamiento seguro de archivos.</div>
<div><a href="http://www.typosphere.org/"></a><a href="http://www.typosphere.org/">Typo</a>: Tu blog en Rails.</div>
<div> </div>
<div><a href="http://www.fluxiom.com/"></a><a href="http://www.fluxiom.com/">Fluxiom</a>: Gestión de archivos multimedia.</div>
<div><a href="http://www.shopify.com/"></a><a href="http://www.shopify.com/">Shopify</a>: Comercio electrónico de forma fácil.</div>
<div> </div>
<div>
<p>Rails trabaja con varios servidores web y bases de datos. Para el servidor web, recomendamos <a href="http://httpd.apache.org/">Apache</a> o <a href="http://www.lighttpd.net/">lighttpd</a> ejecutando FastCGI o SCGI. Para la base de datos, puedes usar MySQL, PostgreSQL, SQLite, Oracle, SQL Server, DB2, o Firebird. Funcionará sobre cualquier sistema operativo, pero recomendamos alguno basado en unix para el desarrollo.</p>
<p>Si necesitas alojamiento, <a href="http://www.textdrive.com/">TextDrive</a> es el hosting oficial de Ruby on Rails. Da igual si necesitas alojamiento compartido o dedicado, ellos son expertos en Ruby on Rails. Otras alternativas, en la <a href="http://wiki.rubyonrails.com/rails/pages/RailsWebHosts">lista de alojamientos que soportan Rails</a>.</p>
<p>Fuente: <a href="http://www.rubyonrails.org.es/">http://www.rubyonrails.org.es/</a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[11 Juli 2009 2:05 AM WIB]]></title>
<link>http://adeklanin.wordpress.com/2009/07/11/11-juli-2009-205-am-wib/</link>
<pubDate>Fri, 10 Jul 2009 19:05:45 +0000</pubDate>
<dc:creator>Adek Lanin</dc:creator>
<guid>http://adeklanin.wordpress.com/2009/07/11/11-juli-2009-205-am-wib/</guid>
<description><![CDATA[Yang diambil dari &#8220;layartembak&#8221; tapi kalau kata id.wikipedia.org sih &#8220;Cuplikan Lay]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Yang diambil dari &#8220;layartembak&#8221; tapi kalau kata id.wikipedia.org sih &#8220;<a href="http://id.wikipedia.org/wiki/Cuplikan_layar">Cuplikan Layar</a>&#8220;</p>
<p><img class="aligncenter size-full wp-image-90" title="&#34;Cuplikan Layar&#34; APC di phpinfo server tetangga" src="http://adeklanin.wordpress.com/files/2009/07/phpinfo_apc2.jpg" alt="&#34;Cuplikan Layar&#34; APC di phpinfo server tetangga" width="640" height="820" />Gara-gara ini jadi lupa kalau ternyata jatah hidup dah minus 1 tahun. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Deny access to .svn directories with lighttpd]]></title>
<link>http://itimeteo.wordpress.com/2009/06/29/deny-access-to-svn-directories-with-lighttpd/</link>
<pubDate>Mon, 29 Jun 2009 08:08:10 +0000</pubDate>
<dc:creator>isontheline</dc:creator>
<guid>http://itimeteo.wordpress.com/2009/06/29/deny-access-to-svn-directories-with-lighttpd/</guid>
<description><![CDATA[$HTTP["url"] =~ "/\.svn/" { &nbsp;&nbsp;url.access-deny = ( "" ) }]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><code>$HTTP["url"] =~ "/\.svn/" {<br />
&#160;&#160;url.access-deny = ( "" )<br />
}</code></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Lighttpd in jailkit chroot environment]]></title>
<link>http://geektivities.wordpress.com/2009/06/28/lighttpd-in-jailkit-chroot-environment/</link>
<pubDate>Sun, 28 Jun 2009 15:48:40 +0000</pubDate>
<dc:creator>thandle</dc:creator>
<guid>http://geektivities.wordpress.com/2009/06/28/lighttpd-in-jailkit-chroot-environment/</guid>
<description><![CDATA[[lighttpd] comment = LigHTTPd HTTP server paths = /usr/sbin/lighttpd, /usr/sbin/lighttpd-angel, /usr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><code>[lighttpd]<br />
comment = LigHTTPd HTTP server<br />
paths = /usr/sbin/lighttpd, /usr/sbin/lighttpd-angel, /usr/lib/lighttpd, /etc/lighttpd<br />
emptydirs = /tmp, /srv/http, /var/log/lighttpd, /var/run/lighttpd<br />
devices = /dev/urandom, /dev/null<br />
users = http<br />
groups = http<br />
includesections = uidbasics, netbasics, logbasics</p>
<p>[php]<br />
comment = PHP 5<br />
paths = /usr/bin/php, /usr/bin/php-cgi, /usr/bin/cgi-fcgi, /usr/bin/spawn-fcgi, /etc/php<br />
includesections = netbasics, logbasics</code></p>
<p>Permissions need to be changed in your jaildir.</p>
<p>jailed-lighttpd:</p>
<p>(include file lost, sorry)</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[apache2 fast or slow?-try lighttpd]]></title>
<link>http://justinhaaga.wordpress.com/2009/06/18/apache2-fast-or-slow-try-lighttpd/</link>
<pubDate>Thu, 18 Jun 2009 20:05:33 +0000</pubDate>
<dc:creator>justinhaaga</dc:creator>
<guid>http://justinhaaga.wordpress.com/2009/06/18/apache2-fast-or-slow-try-lighttpd/</guid>
<description><![CDATA[Apache is almost considered a standard when it comes to a linux web server.  It&#8217;s performance ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a rel="attachment wp-att-92" href="http://justinhaaga.wordpress.com/2009/06/18/apache2-fast-or-slow-try-lighttpd/geronimo/"><img class="alignnone size-full wp-image-92" title="geronimo" src="http://justinhaaga.wordpress.com/files/2009/06/geronimo.jpg" alt="geronimo" width="150" height="193" /></a><a rel="attachment wp-att-93" href="http://justinhaaga.wordpress.com/2009/06/18/apache2-fast-or-slow-try-lighttpd/lighttpd1/"><img class="alignnone size-full wp-image-93" title="lighttpd1" src="http://justinhaaga.wordpress.com/files/2009/06/lighttpd1.png" alt="lighttpd1" width="150" height="144" /></a></p>
<p>Apache is almost considered a standard when it comes to a linux web server.  It&#8217;s performance is pretty good especially comparing it to it&#8217;s windows counterpart, IIS.  However, it&#8217;s not the fastest&#8230;. In setting up a web farm using haproxy, I discovered that the Apache performance was disappointing when scaling it over hardware and pushing the load to the farm. I spend hours and hours tweaking and tuning apache to get the maximum performance.  Well, hopefully this document can help you save time avoiding that and rather just going with lighttpd.</p>
<p>For info on lighthttpd <a href="http://www.lighttpd.net/">http://www.lighttpd.net/</a> see here.  Large deployments like youtube, wikipedia and others use this for their http server.  It&#8217;s ideal for PHP configurations and of course static webpages.  It does have limitation due to it&#8217;s small footprint, so it&#8217;s not perfect for everything.</p>
<p>This configuration will work with Debian Lenny or Ubuntu 8.0.4 LTS.</p>
<p>First, install the server (stop apache services if running or change to different port)</p>
<p>apt-get install lighttpd<br />
apt-get install php5-cgi</p>
<p>Second, enable php</p>
<p>nano /etc/php5/cgi/php.ini<br />
cgi.fix_path_info = 1</p>
<p>Third, enable php in lighthttpd</p>
<p>nano /etc/lighthttpd/lighthttpd.conf<br />
nano /etc/lighthttpd/lighthttpd.conf<br />
server.modules              = (<br />
&#8220;mod_access&#8221;,<br />
&#8220;mod_alias&#8221;,<br />
&#8220;mod_accesslog&#8221;,<br />
&#8220;mod_compress&#8221;,<br />
&#8220;mod_fastcgi<br />
)</p>
<p>add &#8220;mod_fastcgi&#8221;</p>
<p>##tweaks (depends on memory and CPU) so run some tests &#8211; max-proc and min-proc specify how many php processes to spawn, make sure you adequately assign according to memory, default is 2<br />
server.max-connections = 250<br />
server.max-fds = 625</p>
<p>fastcgi.server = ( &#8220;.php&#8221; =&#62; ((<br />
&#8220;bin-path&#8221; =&#62; &#8220;/usr/bin/php5-cgi&#8221;,<br />
&#8220;socket&#8221; =&#62; &#8220;/tmp/php.socket&#8221;,<br />
&#8220;max-procs&#8221; =&#62; 4,<br />
&#8220;min-procs&#8221; =&#62; 4,<br />
&#8220;bin-environment&#8221; =&#62; (<br />
&#8220;PHP_FCGI_CHILDREN&#8221; =&#62; &#8220;16&#8243;,<br />
&#8220;PHP_FCGI_MAX_REQUESTS&#8221; =&#62; &#8220;10000&#8243;<br />
),<br />
&#8220;bin-copy-environment&#8221; =&#62; (<br />
&#8220;PATH&#8221;, &#8220;SHELL&#8221;, &#8220;USER&#8221;<br />
),<br />
&#8220;broken-scriptfilename&#8221; =&#62; &#8220;enable&#8221;<br />
)))</p>
<p>reset lighthttpd<br />
/etc/init.d/lightttpd</p>
<p>DONE-now enjoy! default web root is /var/www</p>
<p>Extra-Need a SSL Cert? Here&#8217;s the config:</p>
<p>1. generate ssl cert using openssl (see other docs on the net)<br />
2. mkdir /sslcerts     cd /sslcerts<br />
3. cat your.key your.crt &#62; lms.pem<br />
4. nano /etc/lighthttpd/lighthttpd.conf<br />
$SERVER["socket"] == &#8220;10.10.13.161:443&#8243; {<br />
ssl.engine = &#8220;enable&#8221;<br />
ssl.pemfile = &#8220;/sslcerts/.your.pem&#8221;<br />
ssl.ca-file = &#8220;/sslcerts/your.crt&#8221;<br />
server.name = &#8220;lms&#8221;<br />
server.document-root = &#8220;/var/websites/lms/www&#8221;<br />
server.errorlog = &#8220;/var/log/lighttpd/lmsserror.log&#8221;<br />
accesslog.filename = &#8220;/var/log/lighttpd/lmsaccess.log&#8221;<br />
}</p>
<p>So-what are the benchmark results? using apachebench &#8211; 51 requests per second vs 21. Convinced?</p>
<p>apache2-</p>
<p>Server Software:        Apache/2.2.9<br />
Server Hostname:<br />
Server Port:            443<br />
SSL/TLS Protocol:       TLSv1/SSLv3,DHE-RSA-AES256-SHA,1024,256</p>
<p>Document Path:          /<br />
Document Length:        50825 bytes</p>
<p>Concurrency Level:      250<br />
<strong>Time taken for tests:   33.324 seconds</strong><br />
Complete requests:      700<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      36709423 bytes<br />
HTML transferred:       36135271 bytes<br />
<strong>Requests per second:    21.01 [#/sec] (mean)<br />
Time per request:       11901.542 [ms] (mean)<br />
Time per request:       47.606 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          1075.76 [Kbytes/sec] received</strong></p>
<p>lighthttpd<br />
Server Software:        lighttpd/1.4.19<br />
Server Hostname:<br />
Server Port:            443<br />
SSL/TLS Protocol:       TLSv1/SSLv3,AES256-SHA,1024,256</p>
<p>Document Path:          /<br />
Document Length:        50825 bytes</p>
<p>Concurrency Level:      250<br />
Time taken for tests:   13.606 seconds<br />
Complete requests:      700<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      36342698 bytes<br />
HTML transferred:       35862831 bytes<br />
<strong>Requests per second:    51.45 [#/sec] (mean)<br />
Time per request:       4859.177 [ms] (mean)<br />
Time per request:       19.437 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          2608.53 [Kbytes/sec] received</strong></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[设置Lighttpd下的Wordpress永久链接]]></title>
<link>http://coderoar.wordpress.com/2009/05/23/%e8%ae%be%e7%bd%aelighttpd%e4%b8%8b%e7%9a%84wordpress%e6%b0%b8%e4%b9%85%e9%93%be%e6%8e%a5/</link>
<pubDate>Sat, 23 May 2009 06:41:28 +0000</pubDate>
<dc:creator>coderoar</dc:creator>
<guid>http://coderoar.wordpress.com/2009/05/23/%e8%ae%be%e7%bd%aelighttpd%e4%b8%8b%e7%9a%84wordpress%e6%b0%b8%e4%b9%85%e9%93%be%e6%8e%a5/</guid>
<description><![CDATA[LAMP环境下，WordPress可以设置简洁优雅的永久链接，但是对于Lighttpd和Windows下的IIS，问题就来了：永久链接里要加上“/index.php”才能避免“404 Not Foun]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>LAMP环境下，WordPress可以设置简洁优雅的永久链接，但是对于Lighttpd和Windows下的IIS，问题就来了：永久链接里要加上“<code>/index.php</code>”才能避免“404 Not Found”。这里简单谈一下Lighttpd的设置。</p>
<p>首先启用<code>mod_rewrite，编辑/etc/lighttpd/lighttpd.conf，在“server.modules”中去掉</code><code>“mod_rewrite”的注释。</code></p>
<p>然后加入以下设置：</p>
<blockquote><p>$HTTP["host"] =~ &#8220;localhost$&#8221; {<br />
var.wpdir = &#8220;/blog/&#8221;<br />
url.rewrite-once = (<br />
&#8220;^&#8221; + wpdir + &#8220;(wp-.+).*/?&#8221; =&#62; &#8220;$0&#8243;,<br />
&#8220;^&#8221; + wpdir + &#8220;(sitemap.xml)&#8221; =&#62; &#8220;$0&#8243;,<br />
&#8220;^&#8221; + wpdir + &#8220;(xmlrpc.php)&#8221; =&#62; &#8220;$0&#8243;,<br />
&#8220;^&#8221; + wpdir + &#8220;keyword/([A-Za-z_0-9-])/?$&#8221; =&#62; wpdir + &#8220;index.php?keyword=$1&#8243;,<br />
&#8220;^&#8221; + wpdir + &#8220;(.+)/?$&#8221; =&#62; wpdir + &#8220;index.php/$1&#8243;<br />
)<br />
}</p></blockquote>
<p>最后重启Lighttpd，就可以随意设置喜欢的永久链接了。</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[First version of WeTwoo now "On Air"]]></title>
<link>http://brange.wordpress.com/2009/05/06/first-version-of-wetwoo-now-on-air/</link>
<pubDate>Wed, 06 May 2009 00:13:44 +0000</pubDate>
<dc:creator>abrange</dc:creator>
<guid>http://brange.wordpress.com/2009/05/06/first-version-of-wetwoo-now-on-air/</guid>
<description><![CDATA[WeTwoo on Air With several months delayed, we are launched a first beta version of WeTwoo.com (We-Tw]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div id="attachment_150" class="wp-caption aligncenter" style="width: 520px"><img class="size-full wp-image-150" title="WeTwoo on air" src="http://brange.wordpress.com/files/2009/05/screeshot_listofcouples.png" alt="WeTwoo on air" width="510" height="374" /><p class="wp-caption-text">WeTwoo on Air</p></div>
<p style="text-align:center;">
<p>With several months delayed, we are launched a first beta version of <a title="wetwoo" href="http://www.wetwoo.com">WeTwoo.com</a> (We-Two-o) which for the moment has few features available which are day to day improving &#8230;  May be you are asking, What hell is wetwoo?. WeTwoo is a facebook application which attempt to be a place to know information about  you friends that have some type of relationship. The current functionality are:</p>
<ul>
<li> <a href="http://apps.facebook.com/wetwooapp/">Know</a> the status of relationship of all your friends. For this, you can see a pie-chat which show the distribution of relationship of your friends.</li>
<li><a href="http://apps.facebook.com/wetwooapp/graphs/">Show a List</a>, in one place, the friends that have some type of relationship that is showed on facebook.</li>
<li>Make <a href="http://apps.facebook.com/wetwooapp/graphs/">comments</a> about the relation of your friends. Click on the name of you friend on the &#8220;Friends in Couple&#8221; page and the comment will appear on the wall of your friend.</li>
<li> Make comments about the application and these will be show on the wall of your friends.</li>
<li><a href="http://apps.facebook.com/wetwooapp/invite/">Invite</a> to friend to join wetwoo. In this way, the list of friends listed on &#8220;Friends in couple&#8221; will grow because only is show the couple that are accepted the application.</li>
<li>Available on English and Spanish (Español)</li>
</ul>
<p>Other features that we hope add:</p>
<ul>
<li>Save and help to remember the anniversary of couple to friends.</li>
<li>Save the comments that are done for some couples.</li>
<li>Suggest possibles couples as &#8220;Couple-friends&#8221;.</li>
</ul>
<p>The application is developed using Ubuntu, Python, Django, Apache, Lighttpd, and PostgreSQL with the help of some libraries as MatPlotLib for graphs and PyFacebook which allow access to Facebook API.<br />
I hope write more on the next months about technical issues to share this process with you.</p>
<p>Before end, I would like to invite to <a title="WeTwoo.com" href="http://www.wetwoo.com"><strong>join to the site</strong></a> and make any comments or suggestion about it and help to spread with your contacts.</p>
<p>Best regards,</p>
<p>Álvaro</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[lighttpd: Symbol `FamErrlist’ has different size in shared object, consider re-linking]]></title>
<link>http://paragasu.wordpress.com/2009/04/18/lighttpd-symbol-famerrlist%e2%80%99-has-different-size-in-shared-object-consider-re-linking/</link>
<pubDate>Sat, 18 Apr 2009 01:07:27 +0000</pubDate>
<dc:creator>paragasu</dc:creator>
<guid>http://paragasu.wordpress.com/2009/04/18/lighttpd-symbol-famerrlist%e2%80%99-has-different-size-in-shared-object-consider-re-linking/</guid>
<description><![CDATA[to fix this #apt-get install libfam0]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>to fix this<br />
<code><br />
#apt-get install libfam0<br />
</code></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Loopia biffar upp sig]]></title>
<link>http://sulo.se/2009/04/15/loopia-biffar-upp-sig/</link>
<pubDate>Wed, 15 Apr 2009 21:11:03 +0000</pubDate>
<dc:creator>Jonathan</dc:creator>
<guid>http://sulo.se/2009/04/15/loopia-biffar-upp-sig/</guid>
<description><![CDATA[Loopia har idag lanserat något som de kallar för Autobahn. Det är en uppsättning servrar, med Nginx,]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://loopia.se/">Loopia</a> har idag lanserat något som de <a href="http://blogg.loopia.se/2009/04/15/autobahn-hosting-med-overvaxel/">kallar för Autobahn</a>. Det är en uppsättning servrar, med <a href="http://nginx.net/">Nginx</a>, dedikerade för statiskt material såsom vanliga HTML-sidor och bilder. Nginx är, enkelt förklarat, en väldigt nedstrippad webbserver (som Apache), i stil med <a href="http://lighttpd.net/">lighttpd</a>.</p>
<p>Vid en första anblick är detta väldigt positivt. Nu får man, som kund på Loopia, möjlighet att snabba upp åtkomsten till statiska filer för sin hemsida. Och det hanteras genom kontrollpanelen, på samma sätt som UNIX- och Windows-konton på Loopia.</p>
<p>Eller, för att <a href="https://www.loopia.se/omloopia/pressinfo-2009-04-15/">citera Jimmie Eriksson</a> &#8211; &#8220;enklare och mer kraftfullt än så blir det inte&#8221;.</p>
<p>Men så började jag fundera&#8230;</p>
<p><img src="http://jonathansulo.wordpress.com/files/2009/04/traffic_jam.jpg?w=199" alt="traffic_jam" title="traffic_jam" width="199" height="300" class="alignright size-medium wp-image-868" />Hur enkelt är det egentligen att använda separata utrymmen (läs: olika domäner/subdomäner och FTP-konton) för att hantera materialet för en hemsida? Och hur fungerar det med ett publiceringssystem, såsom WordPress eller Joomla? Vad händer om en plattform inte fungerar? Fler plattformar tenderar att leda till fler problem.</p>
<p>Personligen skulle jag prioritera andra saker (läs: <a href="http://www.idg.se/2.1085/1.188399/explosion-slog-ut-loopias-servrar">dieselaggregat</a>) på Loopia och min uppfattning om &#8220;enkelt&#8221; är snarare en lösning där kunderna laddar upp sina filer till ett enda utrymme, för att därefter (innan webbservrarna) styra om trafiken till olika webbservrar helt &#8220;osynligt&#8221; för kunderna (beroende på vad det är för material).</p>
<p>Men jag förstår varför Loopia gör detta (<a href="http://skapadebehov.se/">heja Daniel</a>!) och jag tycker det är skönt nördigt likaså. Jag hoppas att mina farhågor inte besannas och att ledningen på Loopia och <a href="http://www.mamut.com/se/">Mamut</a> verkligen förstår vad detta innebär. Om inte annat så kan det sporra ytterligare aktörer till liknande förbättringar (och kanske ännu enklare lösningar).</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[WebServer Benchmarking]]></title>
<link>http://ruigaspar.com/2009/04/06/webserver-benchmarking/</link>
<pubDate>Mon, 06 Apr 2009 16:20:58 +0000</pubDate>
<dc:creator>ruiagaspar</dc:creator>
<guid>http://ruigaspar.com/2009/04/06/webserver-benchmarking/</guid>
<description><![CDATA[Actualmente o apache lidera o ranking de utilização dos Web Servers. No entanto existem outros Web S]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Actualmente o <em>apache </em>lidera o <em>ranking </em>de utilização dos <em>Web Servers</em>. No entanto existem outros<em> Web Servers</em> que não tendo o grau de popularidade do <em>apache</em> conseguem ter um desempenho muito interessante.</p>
<p>Por esse motivo procedi a um teste de desempenho a 4 <em>Web Servers</em>, sendo eles: <a href="http://httpd.apache.org/" target="_blank"><em>Apache httpd</em></a>, <a href="http://nginx.net/" target="_blank"><em>Nginx</em></a>, <a href="http://litespeedtech.com/" target="_blank"><em>LiteSpeed </em></a>e <a href="http://www.lighttpd.net/" target="_blank"><em>Lighttpd</em></a>.<br />
Para este teste fora usadas duas máquinas. Uma fazendo de servidor e outra simulando os clientes, usando uma ferramenta de medição (<a href="http://jakarta.apache.org/jmeter/" target="_blank"><em>JMeter</em></a>).</p>
<p>Todos os servidores foram testados usando uma páginas estática (HTML) e uma página dinâmica (PHP) com uma repetição de 5 vezes em cada teste para impedir possíveis erros circunstanciais.</p>
<p>O primeiro teste mostra <em>Throughput </em>(respostas por segundo) dos diversos servidores quando sujeitos a 100 clientes simultâneamente com cada um a pedir 500 páginas e com a opção <em>KeepAlive </em>activa.</p>
<p style="text-align:center;"><img class="alignnone size-full wp-image-18" title="webserver_benchmark_throughput" src="http://ruiagaspar.wordpress.com/files/2009/04/webserver_benchmark_throughput.png" alt="webserver_benchmark_throughput" width="300" height="160" /><br />
<strong>Fig.1 &#8211; Throughput (Requests/Sec) </strong></p>
<p>Podemos também ver o estado da memória e do CPU do servidor durante a execução de cada teste.</p>
<p style="text-align:center;"><img class="alignnone size-full wp-image-17" title="webserver_benchmark_serverload" src="http://ruiagaspar.wordpress.com/files/2009/04/webserver_benchmark_serverload.png" alt="webserver_benchmark_serverload" width="300" height="160" /><br />
<strong>Fig.2 &#8211; ServerLoad</strong></p>
<p>Com estes testes, verificamos que existem outras boas alternativas ao <em>Apache</em>. Para uso de conteúdo estático o <em>nginx </em>teve um desempenho muito bom, enquanto que para conteúdo dinâmico, o <em>apache</em> continuar a ser a melhor opção. Mas temos que ter em mente que a maioria dos sites, tem na sua maioria conteúdo estático (imagens, css, html, js, etc.).<br />
Relativamente a carga de CPU, o <em>nginx </em>também é o que menos CPU consome, o que se vem reforçar a liderança deste <em>benchmarking</em>.<br />
O único ponto a apontar ao <em>Nginx</em>, foi o facto de a sua instalação não ser simples, e requereu alguma pesquisa principalmente para colocar o modulo php a funcionar.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Lighttpd in chroot&hellip;How to get it done&hellip;]]></title>
<link>http://smshaker.wordpress.com/2009/04/01/lighttpd-in-chroothow-to-get-it-done/</link>
<pubDate>Wed, 01 Apr 2009 06:05:55 +0000</pubDate>
<dc:creator>smshaker</dc:creator>
<guid>http://smshaker.wordpress.com/2009/04/01/lighttpd-in-chroothow-to-get-it-done/</guid>
<description><![CDATA[I was always fascinated by the level of security introduced in Java application servers such as Tomc]]></description>
<content:encoded><![CDATA[I was always fascinated by the level of security introduced in Java application servers such as Tomc]]></content:encoded>
</item>
<item>
<title><![CDATA[rtorrent e WebGUI a me sconosciuta (rutorrent) + guida]]></title>
<link>http://sertmaat.wordpress.com/2009/03/14/rtorrent-e-webgui-a-me-sconosciuta-guida/</link>
<pubDate>Sat, 14 Mar 2009 03:12:21 +0000</pubDate>
<dc:creator>setmaat</dc:creator>
<guid>http://sertmaat.wordpress.com/2009/03/14/rtorrent-e-webgui-a-me-sconosciuta-guida/</guid>
<description><![CDATA[*Aggiornata la pagina del progetto* Sin da quando utilizzo rtorrent mi sono agitato alla ricerca di ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;"><strong>*Aggiornata la pagina del progetto</strong>*</p>
<p style="text-align:justify;">Sin da quando utilizzo rtorrent mi sono agitato alla ricerca di una gui che rispettasse le grandi potenzialità di questo client torrent e che fosse alla portata di <span style="text-decoration:line-through;">cervello</span> mano della mia compagna. Son passato per <strong>nTorrent</strong>, client in java del quale sono anche diventato traduttore, per poi stufarmi del fatto che il client dovesse risiedere in ogni postazione dalla quale interrogare la mia seedbox. Mi sono infine stabilizzato sui <em>client php</em> (<strong>wTorrent</strong> e <strong>rtGUI</strong>) con lighttpd come webserver.</p>
<p style="text-align:justify;">Fino a questo pomeriggio avevo installato sulle mie due seedbox, un router Asus Wl500gp con harddisk usb e un nas Buffalo linkstation Live HS-DH500GL, rispettivamente <strong>Transmission</strong> 1.51 con la sua recente -manco tanto- webgui <strong>Clutch</strong> e appunto<strong> rTorrent</strong> 8.4 + <strong>rtgui</strong> e <strong>wtorrent</strong> in contemporanea.</p>
<p style="text-align:justify;">Cosa è successo?</p>
<p style="text-align:justify;">Transmission mi ha rotto le balle con i suoi errori non richiesti ed ho deciso di percorrere la via rtorrent + gui anche sull&#8217;asus.</p>
<p style="text-align:justify;">Troverete la guida dopo il break.</p>
<p style="text-align:justify;"><!--more--></p>
<p style="text-align:justify;">Per colpa di marte che è entrato in urano senza il suo permesso, sull&#8217;asus nTorrent funziona alla grande ma <strong>rtgui </strong>e <strong>wtorrent</strong> non vogliono saperne di funzionare.</p>
<p style="text-align:justify;">
<p style="text-align:justify;">In mio soccorso arriva questo client:</p>
<p style="text-align:center;"><a href="http://code.google.com/p/rutorrent/">http://code.google.com/p/rutorrent/</a></p>
<p style="text-align:center;"><a class="jcebox" title="rtorrent.jpg" href="http://vif2ne.ru/nvk/stuff/novik/rtorrent/webui.jpg" target="_blank"><img class="aligncenter" src="http://vif2ne.ru/nvk/stuff/novik/rtorrent/webui.jpg" alt="rtorrent" width="311" height="232" /></a></p>
<p>Direttamente dalla pagina di google code, vi elenco le features:</p>
<ul>
<li><a name="Main_features:">Lightweight server side, so it can be installed on old and low-end servers and even on some SOHO routers </a></li>
<li><a name="Main_features:">Extensible &#8211; there are several plugins and everybody can create his own one </a></li>
<li><a name="Main_features:">Nice look <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </a></li>
</ul>
<p style="text-align:justify;">
<p>Nelle prossime righe vedremo come configurare rtorrent per funzionare con la totalità dei suoi client.</p>
<p style="text-align:justify;">
<p style="text-align:justify;">Premessa:</p>
<p style="text-align:justify;">rtorrent usa xmlrpc per interfacciarsi con i suoi client, questo schema preso dal sito di wtorrent e applicabile anche agli altri client, rende l&#8217;idea.</p>
<p style="text-align:center;"><img class="alignnone" src="http://www.wtorrent-project.org/trac/attachment/wiki/wTorrentInstall/diag.jpg?format=raw" alt="" width="400" height="100" /></p>
<p style="text-align:justify;">Ci occorreranno lighttpd e i suoi moduli scgi e fcgi, php5, xmlrpc-c, rtorrent, le sue dipendenze e naturalmente ruTorrent o quale sia il suo nome. La guida che segue è, per quanto riguarda la parte sull&#8217;installazione dei pacchetti, orientata a un sistema optware, cioè un qualsiasi coso sul quale gira linux e che installa tutte le applicazioni nella path /opt utilizzando ipkg come gestore di pacchetti. I file di configurazione invece sono uguali per ogni distro/architettura/gestoredipacchetti, percui ho inserito le diverse path ai file. Per le modifiche ai file ho usato <strong>nano</strong>.</p>
<p style="text-align:justify;">Vi rimando a questo sito per maggiori informazioni sugli optware.</p>
<p style="text-align:justify;"><a href="http://www.nslu2-linux.org/wiki/Optware/Packages?from=Unslung.Packages">http://www.nslu2-linux.org/wiki/Optware/Packages?from=Unslung.Packages</a></p>
<p style="text-align:center;"><strong>Iniziamo</strong></p>
<p style="text-align:justify;">Installare lighttpd e php5 e nano (se non fosse gia presente).</p>
<blockquote>
<div class="code">ipkg update</div>
<div class="code">ipkg install lighttpd php php-fcgi php-curl php-xmlrpc libcurl  nano</div>
</blockquote>
<p style="text-align:justify;">
<p style="text-align:justify;">Ora mofidichiamo il file di configurazione di lighttpd con nano</p>
<p style="text-align:justify;">per i sistemi optware</p>
<div class="code">
<p style="text-align:justify;">
<blockquote><p>nano /opt/etc/lighttpd/lighttpd.conf</p></blockquote>
</div>
<p style="text-align:justify;">per tutti gli altri</p>
<div class="code">
<p style="text-align:justify;">
<blockquote><p>nano /etc/lighttpd/lighttpd.conf</p></blockquote>
</div>
<p style="text-align:justify;">decommentiamo i seguenti moduli:</p>
<div class="code">
<blockquote><p>server.modules              = (<br />
&#8220;mod_access&#8221;,<br />
&#8220;mod_fastcgi&#8221;,<br />
&#8220;mod_scgi&#8221;,<br />
&#8220;mod_accesslog&#8221; )</p></blockquote>
</div>
<p style="text-align:justify;">e aggiungendo questo in fondo al file di configurazione.</p>
<blockquote>
<div class="code">scgi.server = (<br />
&#8220;/RPC2&#8243; =&#62; # RT_DIR<br />
( &#8220;127.0.0.1&#8243; =&#62;<br />
(<br />
&#8220;host&#8221; =&#62; &#8220;127.0.0.1&#8243;, # Ip where rtorrent is listening<br />
&#8220;port&#8221; =&#62; 5000, # Port specified in .rtorrent.rc<br />
&#8220;check-local&#8221; =&#62; &#8220;disable&#8221;<br />
)<br />
)<br />
)fastcgi.server             = ( &#8220;.php&#8221; =&#62;<br />
( &#8220;localhost&#8221; =&#62;<br />
(<br />
&#8220;socket&#8221; =&#62; &#8220;/tmp/php-fastcgi.socket&#8221;,<br />
&#8220;bin-path&#8221; =&#62; &#8220;/opt/bin/php-fcgi&#8221;,<br />
&#8220;bin-environment&#8221; =&#62; (<br />
&#8220;PHP_FCGI_CHILDREN&#8221; =&#62; &#8220;4&#8243;,<br />
&#8220;PHP_FCGI_MAX_REQUESTS&#8221; =&#62; &#8220;4000&#8243;<br />
)<br />
)<br />
)<br />
)</div>
</blockquote>
<p style="text-align:justify;">
<p style="text-align:justify;">Configurazione rtorrent</p>
<div class="code">
<p style="text-align:justify;">
<blockquote><p>ipkg install xmlrpc-c screen libtorrent rtorrent</p></blockquote>
</div>
<p style="text-align:justify;">a questo punto editiamo il file di configurazione di rtorrent</p>
<p style="text-align:justify;">Nel caso di sistemi optware è</p>
<div class="code">
<p style="text-align:justify;">
<blockquote><p>nano /opt/etc/rtorrent.conf</p></blockquote>
</div>
<p style="text-align:justify;">per tutti gli altri</p>
<div class="code">
<p style="text-align:justify;">
<blockquote><p>nano /etc/.rtorrent.rc</p></blockquote>
</div>
<p style="text-align:justify;">o</p>
<div class="code">
<p style="text-align:justify;">
<blockquote><p>nano ~/.rtorrent.rc</p></blockquote>
</div>
<p style="text-align:justify;">inseriamo quanto segue cancellando l&#8217;intero contenuto del file precedente e avendo cura di sostituire le path delle directory con la vostra.</p>
<blockquote>
<p style="text-align:justify;">
<div class="code">scgi_port = 127.0.0.1:5000<br />
session = /tmp/harddisk/torrents # nel mio caso è questa, voi sostituite con la vostra.<br />
port_range = 10000-15000<br />
directory = /tmp/harddisk/downloads # nel mio caso è questa, voi sostituite con la vostra.<br />
check_hash = no<br />
encryption = prefer_plaintext<br />
max_uploads = 5<br />
download_rate = 0<br />
upload_rate = 20<br />
dht = auto<br />
dht_port = 6881<br />
safe_sync = yes<br />
# controlla se in una directory ci sono nuovi torrents,<br />
# e li avvia automaticamente.<br />
schedule = watch_directory,5,5,load_start=/tmp/harddisk/torrents/*.torrent<br />
# ferma i torrent quando lo spazio su disco scende a 300mb<br />
schedule = low_diskspace,5,60,close_low_diskspace=300M<br />
peer_exchange = yes<br />
session_on_completion = yes</div>
</blockquote>
<p style="text-align:justify;">Editiamo lo script di avvio per inserire il nome utente di chi lancerà l&#8217;eseguibile rtorrent. (se lo script non è presente nel pacchetto della vostra disto, potete prenderlo da <a href="http://libtorrent.rakshasa.no/attachment/wiki/RTorrentCommonTasks/rtorrentInit.bash">qui</a> e salvarlo col nome sotto indicato)</p>
<div class="code">
<p style="text-align:justify;">
<blockquote><p>nano /opt/etc/init.d/S99rtorrent</p></blockquote>
</div>
<p style="text-align:justify;">Intorno alla riga 41 troveremo user=&#8221;p2p&#8221;, modificatelo in base al vostro username. Qui ad esempio ho inserito &#8220;admin&#8221;.</p>
<div class="code">
<p style="text-align:justify;">
<blockquote><p>#Do not put a space on either side of the equal signs e.g.<br />
# user = user<br />
# will not work<br />
# system user to run as<br />
user=&#8221;admin&#8221;</p></blockquote>
</div>
<p style="text-align:justify;">Riavviamo i demoni lighttpd e rtorrent</p>
<div class="code">
<p style="text-align:justify;">
<blockquote>
<p style="text-align:justify;">/opt/etc/init.d/S80lighttpd restart</p>
<p style="text-align:justify;">/opt/etc/init.d/S99rtorrent restart</p>
</blockquote>
<p style="text-align:justify;">
</div>
<p style="text-align:justify;">usiamo &#8220;ps&#8221; per contollare la corretta esecuzione di rtorrent</p>
<div class="code">
<p style="text-align:justify;">
<blockquote><p>ps axf &#124; grep rtorrent</p></blockquote>
</div>
<p style="text-align:justify;">Questo dovrebbe essere un output corretto.</p>
<div class="code">
<p style="text-align:justify;">
<blockquote><p>1122 pts/0    S+     0:00          _ grep rtorrent<br />
978 ?        Ss     0:01 SCREEN -dm -S rtorrent<br />
983 pts/2    Ds+   75:38  _ rtorrent -n -o import=/opt/etc/rtorrent.conf</p></blockquote>
</div>
<p style="text-align:justify;">Se viene visualizzata una cosa simile in particolare la 3° riga vuol dire che rtorrent è avviato corretamente e usa il file di configurazione precedentemente modificato. Procediamo quindi testando il dialogo tra rtorrent e il gateway.</p>
<p style="text-align:justify;">Apriamo il browser su</p>
<p style="text-align:justify;">
<blockquote><p>http://ipdellamacchina/RPC2</p></blockquote>
<p style="text-align:justify;">oppure</p>
<p style="text-align:justify;">
<blockquote><p>http://ipdellamacchina:porta/RPC2</p></blockquote>
<p style="text-align:justify;">Nel caso in cui lighttpd usi porta diversa da 80, inserirla nell&#8217;indirizzo. esempio http://192.168.1.1:8081/RPC2</p>
<p style="text-align:justify;">Se visualizziamo una pagina completamente bianca vuol dire che funziona (rtorrent passa i dati via xmlrc al gateway scgi). Se visualizziamo &#8220;500 internal server error&#8221; è facile che rtorrent non sia avviato o che ci siano degli errori nel file di configurazione di lighttpd (in particolare nel modulo scgi).</p>
<p style="text-align:justify;">Ora procediamo con la <strong>WebUI</strong>,</p>
<p style="text-align:justify;">scarichiamo la webui e scompattiamola nella document root di lighttpd che dovrebbe essere /opt/share/www sui sistemi optware e /etc/www per tutti gli altri.</p>
<div class="code">
<p style="text-align:justify;">
<blockquote>
<p style="text-align:justify;">cd /opt/share/www</p>
<p style="text-align:justify;">wget http://rutorrent.googlecode.com/files/rtorrent-2.7.tar.gz</p>
<p style="text-align:justify;">tar -zxvf rtorrent-2.7.tar.gz</p>
</blockquote>
<p style="text-align:justify;">
</div>
<p style="text-align:justify;">aprire  il browser e puntare a</p>
<p style="text-align:justify;"><strong>http://ipdellamacchina/rtorrent </strong></p>
<p style="text-align:justify;"><strong>http://ipdellamacchina:numeroporta/rtorrent</strong> se lighttpd usa una porta diversa da 80</p>
<p style="text-align:justify;">verrà visualizzato brevemente &#8220;Apertura&#8230;&#8221; e subito dopo, se tutto va bene, l&#8217;interfaccia. In caso di mancata connessione con rtorrent, verrà segnalata da un messaggio.</p>
<p style="text-align:justify;">Se visualizziamo &#8220;500 internal server error&#8221;, &#8220;404 Error&#8221;, &#8220;Forbidden&#8221; o simili vuol dire che lighttpd è mal configurato. In questo caso controlliamo la parte finale dei log di lighttpd e rtorrent e interroghiamo mastro google.</p>
<p style="text-align:justify;">Sistemi optware</p>
<div class="code">
<blockquote><p>tail /opt/var/log/lighttpd/error.logtail /opt/var/log/lighttpd/access.log</p>
<p>tail /opt/var/log/rtorrentInit.log</p></blockquote>
</div>
<p style="text-align:justify;">Tutti gli altri, uguale senza &#8220;/opt&#8221;.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
