<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Nginx – Yeri Tiete</title>
    <link>https://yeri.be/tag/nginx/</link>
    <description>Yeri Tiete&#39;s blog</description>
    <language>en</language>
    <copyright>© Yeri Tiete</copyright>
    <lastBuildDate>Thu, 22 Feb 2024 11:24:50 +0100</lastBuildDate>
    <atom:link href="https://yeri.be/tag/nginx/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>WordPress unable to connect to SQL database</title>
      <link>https://yeri.be/wordpress-unable-to-connect-to-sql-database/</link>
      <pubDate>Thu, 22 Feb 2024 11:24:50 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/wordpress-unable-to-connect-to-sql-database/</guid><enclosure url="https://static.yeri.be/2024/02/crashed_database.jpg" length="0" type="image/jpeg" />
      <description>&lt;p&gt;Yesterday, three blogs I&#39;m hosting suddenly went offline and &lt;a href=&#34;https://yeri.be/?s=betteruptime&#34;&gt;alerts&lt;/a&gt; went off.&lt;/p&gt;&#xA;&lt;p&gt;They all had the same error that they couldn&#39;t connect to their SQL database, and it seemed that &lt;a href=&#34;https://hub.docker.com/_/mariadb&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;the container&lt;/a&gt; recently was auto-updated. &lt;/p&gt;&#xA;&lt;p&gt;Docker logs also showed (which may or may not have been related):&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;2024-02-21  7:30:29 97 &amp;#91;Warning] Aborted connection 97 to db: &#39;unconnected&#39; user: &#39;unauthenticated&#39; host: &#39;192.168.200.4&#39; (This connection closed normally without authentication)&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This was odd. I started the usual troubleshooting:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2024/02/crashed_database.jpg" alt="WordPress unable to connect to SQL database"></p><p>Yesterday, three blogs I'm hosting suddenly went offline and <a href="https://yeri.be/?s=betteruptime">alerts</a> went off.</p>
<p>They all had the same error that they couldn't connect to their SQL database, and it seemed that <a href="https://hub.docker.com/_/mariadb" target="_blank" rel="noreferrer noopener">the container</a> recently was auto-updated. </p>
<p>Docker logs also showed (which may or may not have been related):</p>
<pre class="wp-block-code"><code>2024-02-21  7:30:29 97 &#91;Warning] Aborted connection 97 to db: 'unconnected' user: 'unauthenticated' host: '192.168.200.4' (This connection closed normally without authentication)</code></pre>
<p>This was odd. I started the usual troubleshooting:</p>
<ul>
<li>As these containers have their own network, maybe the IPs changed and as the SQL users can only access from a certain IP range, something broke there -- nothing seemed to have changed and I could connect from the nginx container to the other just fine</li>
<li>Password somehow changed -- nah, connections were accepted</li>
<li>Roll back to a previous version of MariaDB -- didn't do anything, odd</li>
<li>This was not actually a MariaDB problem but a WordPress problem? Was there an auto-update? Didn't make sense because one of the blogs is running a very old WP version</li>
<li>Worth noting that I also host two Ghosts blogs using the same setup (nginx+mariadb in container) and they were unaffected and humming along just fine...</li>
<li>At this point I was starting to think something was massively corrupt and this was gonna be a long day.</li>
</ul>
<p>I then continued and created a php (<code>testconnection.php</code>) file on the nginx:</p>
<pre class="wp-block-code"><code>&lt;?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

// Connection Details
$hostname = "container-mariadb";  // Your MariaDB hostname 
$username = "your_username"; // Your MariaDB username
$password = "your_password"; // Your MariaDB password
$database = "your_database_name"; // The database

// Create the connection
$conn = new mysqli($hostname, $username, $password, $database);

// Check for errors
if ($conn-&gt;connect_error) {
    die("Connection failed: " . $conn-&gt;connect_error);
}

// Print Debug Information
echo "Connected successfully\n"; 
echo "Host information: " . $conn-&gt;host_info . "\n";
echo "Client information: " . $conn-&gt;client_info . "\n";

// Close the connection
$conn-&gt;close();
?&gt;</code></pre>
<p>This threw the following error... We were getting somewhere:</p>
<pre class="wp-block-code"><code>Fatal error: Uncaught mysqli_sql_exception: Server sent charset (0) unknown to the client. Please, report to the developers in /var/www/domain/testconnection.php:13 Stack trace: #0 /var/www/domain/testconnection.php(13): mysqli-&gt;__construct() #1 {main} thrown in /var/www/domain/testconnection.php on line 13</code></pre>
<p>The charset I was using was <code>utf8mb4</code> with a collate of <code>utf8mb4_general_ci</code>:</p>
<pre class="wp-block-code"><code>SHOW CREATE DATABASE your_database_name;</code></pre>
<p>My <code>wp-config.php</code> file already had <code>DB_CHARSET</code>, but <code>DB_COLLATE</code> was not set. I added that in the config as well:</p>
<pre class="wp-block-code"><code>define( 'DB_CHARSET', 'utf8mb4' );
define( 'DB_COLLATE', 'utf8mb4_general_ci' );</code></pre>
<p>Sadly, that didn't fix it either. Still saying it can't connect to the database. Grmbl.</p>
<p>I then went ahead and checked <code>/etc/mysql/mariadb.conf</code> and the files in <code>/etc/mariadb.conf.d/</code>. It included <code>character-set-server = utf8mb4</code>, but not <code>collation-server = utf8mb4_general_ci</code>. The line was specifically in <code>/etc/mariadb.conf.d/50-server.cnf</code>.</p>
<p>Adding the latter solved the problem... 2hrs of my life gone. </p>
<p>As this file (likely) is managed in the container and changed by the OS (it's apparently based on Ubuntu, ewwww) or the MariaDB version, the easiest way was just creating another file: <code>/etc/mariadb.conf.d/51-&lt;something&gt;.cnf</code>.</p>
<p>This is my <strong>very dirty</strong> hack (as I'm not using Docker Compose for this):</p>
<pre class="wp-block-code"><code>docker exec -it container-mariadb bash -c "echo -e '&#91;mysqld]\ncollation-server = utf8mb4_general_ci'> /etc/mysql/mariadb.conf.d/51-yeri.cnf"
docker restart container-mariadb</code></pre>
<p>It now works fine again... </p>
]]></content:encoded>
      <category>linux</category><category>software</category><category>www</category>
      <category>mysql</category><category>nginx</category><category>wordpress</category>
    </item>
    
    <item>
      <title>EVA and WiFi</title>
      <link>https://yeri.be/eva-and-wifi/</link>
      <pubDate>Sat, 28 Jan 2017 16:26:10 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/eva-and-wifi/</guid>
      <description>&lt;p style=&#34;text-align: left;&#34;&gt;So I am flying EVA from &lt;a href=&#34;http://flightdiary.net/Tuinslak&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SIN - TPE - JFK&lt;/a&gt; and back. For the first time I also went to the dark side (16hrs was too long to be locked up with just my mind) and got onboard WiFi.&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;https://static.yeri.be/2017/01/evawifi.png&#34;&gt;&lt;img class=&#34;alignnone size-medium wp-image-8253&#34; src=&#34;https://static.yeri.be/2017/01/evawifi-300x260.png&#34; alt=&#34;&#34; width=&#34;300&#34; height=&#34;260&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;This seems to come with unlimited data for ~20USD for 24hrs. I manage to stream Google Music just fine.&lt;/p&gt;&#xA;&lt;p&gt;I totally went Matrix mode during the flight. While the flight is half empty I am wondering if they think I am haxoring it now.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p style="text-align: left;">So I am flying EVA from <a href="http://flightdiary.net/Tuinslak" target="_blank" rel="noopener noreferrer">SIN - TPE - JFK</a> and back. For the first time I also went to the dark side (16hrs was too long to be locked up with just my mind) and got onboard WiFi.</p>
<p style="text-align: center;"><a href="https://static.yeri.be/2017/01/evawifi.png"><img class="alignnone size-medium wp-image-8253" src="https://static.yeri.be/2017/01/evawifi-300x260.png" alt="" width="300" height="260" /></a></p>
<p>This seems to come with unlimited data for ~20USD for 24hrs. I manage to stream Google Music just fine.</p>
<p>I totally went Matrix mode during the flight. While the flight is half empty I am wondering if they think I am haxoring it now.</p>
<p>EVA uses T-Mobile Germany as carrier.</p>
<p>Public IP routes to a German IP (and Google redirects to Google.de).</p>
<pre>nazgul<span class="s2"> ~ </span><span class="s3">$</span><span class="s4"> curl canhazip.com
88.128.80.215</span></pre>
<p class="p1">Whois info:</p>
<p class="p1">[...]</p>
<pre>inetnum: 88.128.80.0 - 88.128.95.255
netname: ca-de
descr: Telekom Deutschland GmbH
country: DE
admin-c: TH12429-RIPE
tech-c: AS8728-RIPE
tech-c: MS47198-RIPE
remarks: ***************************************************************************
remarks: Please send any abuse complaints to: abuse@telekom.de
remarks: Behoerdenauskuenfte koennen nur ueber folgende Ruf- bzw. Faxnummern beantwortet werden:
remarks: Fax: 0180-18812-66 (0,039 Euro/Minute aus dem Festnetz der Deutschen Telekom AG.)
remarks: Tel.: 0180-18812-77 (0,039 Euro/Minute aus dem Festnetz der Deutschen Telekom AG.)
remarks: ***************************************************************************
status: ASSIGNED PA
mnt-by: MNT-TMD
created: 2008-05-06T07:54:12Z
last-modified: 2012-07-30T08:54:39Z
source: RIPE</pre>
<p>Trace routes are quite odd:</p>
<pre>nazgul ~ $ traceroute yeri.be
traceroute to yeri.be (83.149.69.152), 64 hops max, 52 byte packets
1 ns.evawifi.com (172.19.248.1) 3.429 ms 2.746 ms 2.921 ms
2 10.207.1.1 (10.207.1.1) 2.998 ms 2.535 ms 2.455 ms
3 172.18.15.41 (172.18.15.41) 553.837 ms 536.711 ms 541.207 ms
4 172.18.14.34 (172.18.14.34) 615.658 ms 534.722 ms 536.465 ms
5 * * *
6 yeri.be (83.149.69.152) 728.306 ms 749.172 ms 738.020 ms
7 yeri.be (83.149.69.152) 743.171 ms 735.898 ms 858.885 ms
8 yeri.be (83.149.69.152) 731.611 ms 764.056 ms 734.694 ms
9 yeri.be (83.149.69.152) 745.765 ms 745.182 ms 729.407 ms
10 yeri.be (83.149.69.152) 745.248 ms 1002.078 ms 750.183 ms
11 yeri.be (83.149.69.152) 901.702 ms 758.616 ms 898.359 ms
12 yeri.be (83.149.69.152) 750.162 ms 779.888 ms 863.083 ms
13 yeri.be (83.149.69.152) 777.654 ms 777.442 ms 750.133 ms
14 yeri.be (83.149.69.152) 745.435 ms 783.786 ms 942.607 ms
15 yeri.be (83.149.69.152) 926.653 ms 939.882 ms 830.519 ms
16 yeri.be (83.149.69.152) 1239.295 ms 754.112 ms 753.986 ms</pre>
<pre>nazgul ~ $ traceroute google.com
traceroute to google.com (172.217.17.46), 64 hops max, 52 byte packets
1 ns.evawifi.com (172.19.248.1) 1.716 ms 1.200 ms 2.627 ms
2 10.207.1.1 (10.207.1.1) 2.155 ms 1.932 ms 2.165 ms
3 172.18.15.41 (172.18.15.41) 583.366 ms 588.440 ms 730.303 ms
4 172.18.14.34 (172.18.14.34) 552.347 ms 963.682 ms 550.350 ms
5 172.30.1.34 (172.30.1.34) 841.324 ms * 637.136 ms
6 ams16s29-in-f46.1e100.net (172.217.17.46) 752.359 ms 744.614 ms 819.851 ms
7 ams16s29-in-f46.1e100.net (172.217.17.46) 735.554 ms 737.249 ms 785.678 ms
8 ams16s29-in-f46.1e100.net (172.217.17.46) 766.046 ms 738.774 ms 750.276 ms
9 ams16s29-in-f46.1e100.net (172.217.17.46) 817.491 ms 736.133 ms 765.344 ms
10 ams16s29-in-f46.1e100.net (172.217.17.46) 1047.754 ms 754.939 ms *
11 * ams16s29-in-f46.1e100.net (172.217.17.46) 761.013 ms 762.848 ms
12 * ams16s29-in-f46.1e100.net (172.217.17.46) 840.602 ms 750.186 ms
13 ams16s29-in-f46.1e100.net (172.217.17.46) 935.149 ms 808.133 ms 745.638 ms
14 ams16s29-in-f46.1e100.net (172.217.17.46) 736.075 ms 881.481 ms 788.661 ms
15 * * *
16 ams16s29-in-f46.1e100.net (172.217.17.46) 876.269 ms 1195.194 ms 754.661 ms
17 ams16s29-in-f46.1e100.net (172.217.17.46) 749.985 ms 850.065 ms 742.763 ms
18 ams16s29-in-f46.1e100.net (172.217.17.46) 737.418 ms 1079.194 ms 751.415 ms
19 ams16s29-in-f46.1e100.net (172.217.17.46) 765.339 ms 763.116 ms 754.928 ms
20 ams16s29-in-f46.1e100.net (172.217.17.46) 765.059 ms 767.733 ms 762.777 ms
21 ams16s29-in-f46.1e100.net (172.217.17.46) 860.458 ms 780.965 ms 757.507 ms
22 ams16s29-in-f46.1e100.net (172.217.17.46) 768.432 ms 747.930 ms 764.553 ms
23 ams16s29-in-f46.1e100.net (172.217.17.46) 758.869 ms 747.489 ms 751.329 ms
24 ams16s29-in-f46.1e100.net (172.217.17.46) 797.699 ms 818.899 ms *</pre>
<pre>nazgul ~ $ traceroute t-mobile.de
traceroute to t-mobile.de (46.29.100.15), 64 hops max, 52 byte packets
1 ns.evawifi.com (172.19.248.1) 1.978 ms 1.080 ms 1.071 ms
2 10.207.1.1 (10.207.1.1) 4.575 ms 1.885 ms 1.847 ms
3 172.18.15.41 (172.18.15.41) 540.670 ms 739.430 ms 787.836 ms
4 172.18.14.34 (172.18.14.34) 646.621 ms 775.771 ms 562.301 ms
5 * 172.30.1.34 (172.30.1.34) 630.660 ms *
6 46.29.100.15 (46.29.100.15) 1014.377 ms 813.739 ms 755.431 ms
7 46.29.100.15 (46.29.100.15) 766.290 ms 805.572 ms 735.697 ms
8 46.29.100.15 (46.29.100.15) 806.918 ms 792.377 ms 945.535 ms
9 46.29.100.15 (46.29.100.15) 783.751 ms 736.085 ms 781.832 ms
10 46.29.100.15 (46.29.100.15) 817.682 ms 738.980 ms 1031.463 ms
11 46.29.100.15 (46.29.100.15) 872.993 ms 767.682 ms 807.777 ms
12 46.29.100.15 (46.29.100.15) 986.659 ms 804.279 ms 806.750 ms
13 46.29.100.15 (46.29.100.15) 846.340 ms 767.556 ms 939.215 ms
14 46.29.100.15 (46.29.100.15) 737.330 ms 759.259 ms 786.724 ms
15 * * *
16 * * *</pre>
<p>Not very sure what witchery is going on here.</p>
<p>arp shows AP isolation and two different servers running for the WiFi:</p>
<pre>nazgul ~ $ arp -a
ns.evawifi.com (172.19.248.1) at 0:d:2e:0:40:1 on en0 ifscope [ethernet]
www.evawifi.com (172.19.248.2) at 0:d:2e:0:0:a8 on en0 ifscope [ethernet]
? (172.19.249.255) at (incomplete) on en0 ifscope [ethernet]
? (224.0.0.251) at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet]
? (239.192.0.0) at 1:0:5e:40:0:0 on en0 ifscope permanent [ethernet]
? (239.255.255.250) at 1:0:5e:7f:ff:fa on en0 ifscope permanent [ethernet]</pre>
<p>There seems to be a transparant Squid/<a href="https://www.cvedetails.com/vulnerability-list/vendor_id-9950/product_id-17766/version_id-171780/Squid-cache-Squid-3.4.6.html" target="_blank" rel="noopener noreferrer">3.4.6</a> caching proxy running:</p>
<p style="text-align: center;"><a href="https://static.yeri.be/2017/01/evasquid.png"><img class="alignnone size-medium wp-image-8254" src="https://static.yeri.be/2017/01/evasquid-300x228.png" alt="" width="300" height="228" /></a></p>
<p style="text-align: left;">More random things can be found <a href="https://static.yeri.be/2017/01/eva.txt">here</a>.</p>
]]></content:encoded>
      <category>networking</category><category>travel</category>
      <category>nginx</category><category>squid</category><category>wifi</category>
    </item>
    
    <item>
      <title>Theme</title>
      <link>https://yeri.be/theme/</link>
      <pubDate>Sat, 27 Dec 2014 06:47:34 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/theme/</guid>
      <description>&lt;p&gt;I had the &lt;a href=&#34;https://yeri.be/theme-blog-and-stuff&#34;&gt;same theme&lt;/a&gt; for over four years. I&amp;rsquo;ve made quite a few custom css and PHP edits myself, and it had been &lt;a href=&#34;http://azeemazeez.com/blogs/white-as-milk/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;outdated for ages&lt;/a&gt;&amp;hellip; But it served me well.&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;https://static.yeri.be/2014/12/theme-2011.png&#34;&gt;&lt;img class=&#34;alignnone size-full wp-image-6554&#34; src=&#34;https://static.yeri.be/2014/12/theme-2011.png&#34; alt=&#34;theme-2011&#34; width=&#34;1817&#34; height=&#34;1192&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;However, it&amp;rsquo;s now time for &lt;a href=&#34;https://wordpress.org/themes/opal&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;something new&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;https://static.yeri.be/2014/12/theme-2015.png&#34;&gt;&lt;img class=&#34;alignnone size-full wp-image-6542&#34; src=&#34;https://static.yeri.be/2014/12/theme-2015.png&#34; alt=&#34;theme-2015&#34; width=&#34;1411&#34; height=&#34;1174&#34; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;As always, as minimalistic as possible.&lt;/p&gt;&#xA;&lt;p&gt;On a side note, this blog has been moved from &lt;a href=&#34;https://yeri.be/blog-changes&#34;&gt;vm1&lt;/a&gt; (and &lt;a href=&#34;https://yeri.be/one-2&#34;&gt;one&lt;/a&gt; before that) a virtual machine running on a dual Xeon 3070 (2.66Ghz) at &lt;a href=&#34;https://yeri.be/four&#34;&gt;Databarn&lt;/a&gt; to &lt;a href=&#34;http://www.wowwiki.com/Akama&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Akama&lt;/a&gt;, a VM on an 8 core Xeon E3-1230 (3.2Ghz) at &lt;a href=&#34;https://www.facebook.com/photo.php?fbid=10203828300326081&amp;amp;set=pb.1177197811.-2207520000.1419638163.&amp;amp;type=3&amp;amp;theater&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Leaseweb&lt;/a&gt;.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I had the <a href="https://yeri.be/theme-blog-and-stuff">same theme</a> for over four years. I&rsquo;ve made quite a few custom css and PHP edits myself, and it had been <a href="http://azeemazeez.com/blogs/white-as-milk/" target="_blank" rel="noopener noreferrer">outdated for ages</a>&hellip; But it served me well.</p>
<p style="text-align: center;"><a href="https://static.yeri.be/2014/12/theme-2011.png"><img class="alignnone size-full wp-image-6554" src="https://static.yeri.be/2014/12/theme-2011.png" alt="theme-2011" width="1817" height="1192" /></a></p>
<p>However, it&rsquo;s now time for <a href="https://wordpress.org/themes/opal" target="_blank" rel="noopener noreferrer">something new</a>.</p>
<p style="text-align: center;"><a href="https://static.yeri.be/2014/12/theme-2015.png"><img class="alignnone size-full wp-image-6542" src="https://static.yeri.be/2014/12/theme-2015.png" alt="theme-2015" width="1411" height="1174" /></a></p>
<p>As always, as minimalistic as possible.</p>
<p>On a side note, this blog has been moved from <a href="https://yeri.be/blog-changes">vm1</a> (and <a href="https://yeri.be/one-2">one</a> before that) a virtual machine running on a dual Xeon 3070 (2.66Ghz) at <a href="https://yeri.be/four">Databarn</a> to <a href="http://www.wowwiki.com/Akama" target="_blank" rel="noopener noreferrer">Akama</a>, a VM on an 8 core Xeon E3-1230 (3.2Ghz) at <a href="https://www.facebook.com/photo.php?fbid=10203828300326081&amp;set=pb.1177197811.-2207520000.1419638163.&amp;type=3&amp;theater" target="_blank" rel="noopener noreferrer">Leaseweb</a>.</p>
<p>I&rsquo;ve also correctly repaired IPv6 on this blog. Apparently nginx never and/or stopped correctly listening to IPv6 (suddenly my Android devices displayed errors on this page, Chrome &amp; Firefox on OS X seemed to fall back to IPv4 instantly&hellip; Not sure how long it was broken, but it&rsquo;s back).</p>
<p>Note to self:</p>
<pre>listen          yeri.be:443;
server_name     yeri.be;</pre>
<p>Does not work with IPv6, it has to be</p>
<pre>listen          [::]:443;
server_name     yeri.be;</pre>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>networking</category><category>software</category><category>virtualisation</category><category>www</category>
      <category>tuinslak</category><category>blog</category><category>nginx</category><category>rootspirit</category>
    </item>
    
    <item>
      <title>Raspberry Pi &#43; ad blocking &#43; nginx</title>
      <link>https://yeri.be/raspberry-pi-ad-blocking/</link>
      <pubDate>Thu, 19 Sep 2013 20:13:26 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/raspberry-pi-ad-blocking/</guid>
      <description>&lt;p&gt;There&amp;rsquo;s &lt;a href=&#34;http://learn.adafruit.com/raspberry-pi-as-an-ad-blocking-access-point/install-software&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;this howto&lt;/a&gt; that explains how to set up the RPi as ad blocker.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve two RPi&amp;rsquo;s acting a router and was already running dnsmasq. I decided to give it a try. Note that this howto can actually be used on any DNS serving Linux server.&lt;/p&gt;&#xA;&lt;p&gt;First of all, don&amp;rsquo;t go with the pixelserv as it crashes after a few minutes.&lt;/p&gt;&#xA;&lt;p&gt;Apache is an option that worked fine. A general hint: if you&amp;rsquo;re already running Apache or whatever on port 80, just add a 2nd static IP and make Apache listen to that.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>There&rsquo;s <a href="http://learn.adafruit.com/raspberry-pi-as-an-ad-blocking-access-point/install-software" target="_blank" rel="noopener noreferrer">this howto</a> that explains how to set up the RPi as ad blocker.</p>
<p>I&rsquo;ve two RPi&rsquo;s acting a router and was already running dnsmasq. I decided to give it a try. Note that this howto can actually be used on any DNS serving Linux server.</p>
<p>First of all, don&rsquo;t go with the pixelserv as it crashes after a few minutes.</p>
<p>Apache is an option that worked fine. A general hint: if you&rsquo;re already running Apache or whatever on port 80, just add a 2nd static IP and make Apache listen to that.</p>
<p>For example (/etc/network/interfaces) &ndash; be sure it&rsquo;s in the same subnet:</p>
<pre>auto eth0:0
iface eth0:0 inet static
 address 10.100.200.254
 netmask 255.255.255.0
 broadcast 10.100.200.255</pre>
<p>10.100.200.254 is the Apache IP that just serves a HTTP 200 (or 204).</p>
<p>Here&rsquo;s the relevant config part (note the HTTP 204 code, more info on that later):</p>
<pre>&lt;VirtualHost adblock:80&gt;
 ServerAdmin webmaster@domain.net
 DocumentRoot /var/www
 &lt;Directory /&gt;
 Options FollowSymLinks
 AllowOverride All
 &lt;/Directory&gt;
 &lt;Directory /var/www/&gt;
 Options Indexes FollowSymLinks MultiViews
 AllowOverride None
 Order allow,deny
 allow from all
 RewriteEngine on
 RedirectMatch 204 (.*)$
 ErrorDocument 204 " "
 &lt;/Directory&gt;

ErrorLog ${APACHE_LOG_DIR}/error.log
 LogLevel warn
 CustomLog ${APACHE_LOG_DIR}/access.log combined
&lt;/VirtualHost&gt;</pre>
<p>And edit /etc/hosts to add &ldquo;adblock&rdquo;:</p>
<pre>10.100.200.254 adblock.local adblock</pre>
<p>If I had used the IP instead of adblock I would have had this error:</p>
<pre># apache2ctl configtest
[Mon Sep 16 20:27:21 2013] [error] (EAI 2)Name or service not known: 
Failed to resolve server name for 10.100.200.254 (check DNS) 
-- or specify an explicit ServerName
Syntax OK</pre>
<p>With the HTTP 200 code, some browsers expect some content/file in return. So it&rsquo;s generally safer to use HTTP 204 &ldquo;<a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#2xx_Success" target="_blank" rel="noopener noreferrer">No Content</a>&rdquo;; which basically means &ldquo;all good but I have nothing to serve you.&rdquo;</p>
<p>Now, I call myself an nginx fan. Running Apache on a RPi is a no go (at least for me). I could&rsquo;ve ran nginx on the RPi, but decided to run it on a remote server with an additional IP. At least for now. To preserve resources on the RPi.</p>
<p>Here&rsquo;s the relevant config to run it on nginx (and be sure this config is the first file nginx parses; or it might redirect all the domains to some other site):</p>
<pre>server {
 listen 80;
 server_name pixel.0x04.com 10.100.200.254 _;
 access_log /var/log/nginx/pixel.access.log;
 error_log /var/log/nginx/pixel.error.log;
 expires max;
 autoindex off; 
 rewrite ^(.*)$ /;
 location / {
  return 204 'pixel';
 }
}</pre>
<p>And if we test it, this is what we get:</p>
<pre>HTTP/1.1 204 No Content
Server: nginx/1.4.0
Date: Mon, 16 Sep 2013 18:36:52 GMT
Connection: close
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000</pre>
<p>And that&rsquo;s it.</p>
<p>&lt;3 nginx</p>
<p>The only downside is that this won&rsquo;t work with HTTPS. You can run your webbrowser with a self signed certificate, but this will throw errors&hellip;</p>
<p>The result:</p>
<p><a href="https://static.yeri.be/2013/09/adblock.png"><img class="alignnone size-medium wp-image-5298 aligncenter" alt="adblock" src="https://static.yeri.be/2013/09/adblock-300x171.png" width="300" height="171" /></a></p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category><category>www</category>
      <category>dns</category><category>nginx</category><category>raspberrypi</category>
    </item>
    
    <item>
      <title>413 Request Entity Too Large</title>
      <link>https://yeri.be/413-request-entity-too-large/</link>
      <pubDate>Sun, 03 Jun 2012 11:07:12 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/413-request-entity-too-large/</guid>
      <description>&lt;p&gt;Since I started pushing kernel and modules through Puppet (as raw files, instead of .deb packages) I randomly got these errors:&lt;/p&gt;&#xA;&lt;pre&gt;[...]&#xA;/usr/lib/ruby/1.8/puppet/agent/locker.rb:21:in `lock&#39;&#xA;/usr/lib/ruby/1.8/puppet/agent.rb:44:in `run&#39;&#xA;/usr/lib/ruby/1.8/sync.rb:230:in `synchronize&#39;&#xA;/usr/lib/ruby/1.8/puppet/agent.rb:44:in `run&#39;&#xA;/usr/lib/ruby/1.8/puppet/agent.rb:108:in `with_client&#39;&#xA;/usr/lib/ruby/1.8/puppet/agent.rb:42:in `run&#39;&#xA;/usr/lib/ruby/1.8/puppet/application.rb:172:in `call&#39;&#xA;/usr/lib/ruby/1.8/puppet/application.rb:172:in `controlled_run&#39;&#xA;/usr/lib/ruby/1.8/puppet/agent.rb:40:in `run&#39;&#xA;/usr/lib/ruby/1.8/puppet/application/agent.rb:337:in `onetime&#39;&#xA;/usr/lib/ruby/1.8/puppet/application/agent.rb:311:in `run_command&#39;&#xA;/usr/lib/ruby/1.8/puppet/application.rb:309:in `run&#39;&#xA;/usr/lib/ruby/1.8/puppet/application.rb:416:in `hook&#39;&#xA;/usr/lib/ruby/1.8/puppet/application.rb:309:in `run&#39;&#xA;/usr/lib/ruby/1.8/puppet/application.rb:407:in `exit_on_fail&#39;&#xA;/usr/lib/ruby/1.8/puppet/application.rb:309:in `run&#39;&#xA;/usr/lib/ruby/1.8/puppet/util/command_line.rb:69:in `execute&#39;&#xA;/usr/bin/puppet:4&#xA;&lt;span style=&#34;color: #ff00ff;&#34;&gt;err: Could not send report: Error 413 on SERVER: &amp;lt;html&amp;gt;&lt;/span&gt;&#xA;&lt;span style=&#34;color: #ff00ff;&#34;&gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;413 Request Entity Too Large&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&#xA;&lt;span style=&#34;color: #ff00ff;&#34;&gt;&amp;lt;body bgcolor=&#34;white&#34;&amp;gt;&lt;/span&gt;&#xA;&lt;span style=&#34;color: #ff00ff;&#34;&gt;&amp;lt;center&amp;gt;&amp;lt;h1&amp;gt;413 Request Entity Too Large&amp;lt;/h1&amp;gt;&amp;lt;/center&amp;gt;&lt;/span&gt;&#xA;&lt;span style=&#34;color: #ff00ff;&#34;&gt;&amp;lt;hr&amp;gt;&amp;lt;center&amp;gt;nginx/1.1.19&amp;lt;/center&amp;gt;&lt;/span&gt;&#xA;&lt;span style=&#34;color: #ff00ff;&#34;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&#xA;&lt;span style=&#34;color: #ff00ff;&#34;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;span style=&#34;color: #000000;&#34;&gt;The error seems quite easy to solve by modifying nginx&amp;rsquo; config to allow bigger body sizes.&lt;/span&gt;&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Since I started pushing kernel and modules through Puppet (as raw files, instead of .deb packages) I randomly got these errors:</p>
<pre>[...]
/usr/lib/ruby/1.8/puppet/agent/locker.rb:21:in `lock'
/usr/lib/ruby/1.8/puppet/agent.rb:44:in `run'
/usr/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/lib/ruby/1.8/puppet/agent.rb:44:in `run'
/usr/lib/ruby/1.8/puppet/agent.rb:108:in `with_client'
/usr/lib/ruby/1.8/puppet/agent.rb:42:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:172:in `call'
/usr/lib/ruby/1.8/puppet/application.rb:172:in `controlled_run'
/usr/lib/ruby/1.8/puppet/agent.rb:40:in `run'
/usr/lib/ruby/1.8/puppet/application/agent.rb:337:in `onetime'
/usr/lib/ruby/1.8/puppet/application/agent.rb:311:in `run_command'
/usr/lib/ruby/1.8/puppet/application.rb:309:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:416:in `hook'
/usr/lib/ruby/1.8/puppet/application.rb:309:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:407:in `exit_on_fail'
/usr/lib/ruby/1.8/puppet/application.rb:309:in `run'
/usr/lib/ruby/1.8/puppet/util/command_line.rb:69:in `execute'
/usr/bin/puppet:4
<span style="color: #ff00ff;">err: Could not send report: Error 413 on SERVER: &lt;html&gt;</span>
<span style="color: #ff00ff;">&lt;head&gt;&lt;title&gt;413 Request Entity Too Large&lt;/title&gt;&lt;/head&gt;</span>
<span style="color: #ff00ff;">&lt;body bgcolor="white"&gt;</span>
<span style="color: #ff00ff;">&lt;center&gt;&lt;h1&gt;413 Request Entity Too Large&lt;/h1&gt;&lt;/center&gt;</span>
<span style="color: #ff00ff;">&lt;hr&gt;&lt;center&gt;nginx/1.1.19&lt;/center&gt;</span>
<span style="color: #ff00ff;">&lt;/body&gt;</span>
<span style="color: #ff00ff;">&lt;/html&gt;</span></pre>
<p><span style="color: #000000;">The error seems quite easy to solve by modifying nginx&rsquo; config to allow bigger body sizes.</span></p>
<p><span style="color: #000000;">Edit <em>nginx.conf</em> and add this line:</span></p>
<pre>client_max_body_size 50M;</pre>
<p>(I&rsquo;ve set it to 50M, although that&rsquo;s probably way to big, but so far I&rsquo;ve not been able to reproduce this error).</p>
<p><span style="color: #000000;"> </span></p>
]]></content:encoded>
      <category>misc</category>
      <category>nginx</category><category>puppet</category>
    </item>
    
    <item>
      <title>nginx: could not build the server_names_hash</title>
      <link>https://yeri.be/nginx-could-not-build-the-server_names_hash/</link>
      <pubDate>Thu, 17 Feb 2011 11:37:06 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nginx-could-not-build-the-server_names_hash/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve recently started switching my custom nginx installations to the Debian repository version.&lt;/p&gt;&#xA;&lt;p&gt;So from 0.9.4 to 0.6.32 (Lenny), which will be upgraded to 0.7.x in Squeeze.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve come across this error on certain servers:&lt;/p&gt;&#xA;&lt;pre style=&#34;background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;&#34;&gt;# /etc/init.d/nginx restart&#xA;Restarting nginx: 2011/02/11 11:34:58 [emerg] 3624#0: could not build the server_names_hash, &#xA;you should increase server_names_hash_bucket_size: 32&#xA;nginx.&lt;/pre&gt;&#xA;&lt;p&gt;This can be solved by adding this to the nginx.conf:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I&rsquo;ve recently started switching my custom nginx installations to the Debian repository version.</p>
<p>So from 0.9.4 to 0.6.32 (Lenny), which will be upgraded to 0.7.x in Squeeze.</p>
<p>I&rsquo;ve come across this error on certain servers:</p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;"># /etc/init.d/nginx restart
Restarting nginx: 2011/02/11 11:34:58 [emerg] 3624#0: could not build the server_names_hash, 
you should increase server_names_hash_bucket_size: 32
nginx.</pre>
<p>This can be solved by adding this to the nginx.conf:</p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;">server_names_hash_bucket_size 64;
</pre>
<p>Be sure to place it between the http-section.</p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;">[...]
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    server_names_hash_bucket_size 64;

    access_log	/var/log/nginx/access.log;
	
    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;
    tcp_nopush	       on;

    gzip  on;
    gzip_comp_level   5;
    gzip_http_version 1.0;
    gzip_min_length   0;
    gzip_proxied      any;
    gzip_buffers      16 8k;
    # Some version of IE 6 don't handle compression well on some mime-types, 
    # so just disable for them
    gzip_disable "MSIE [1-6].(?!.*SV1)";
    gzip_types        text/plain text/css image/x-icon application/x-javascript text/xml  application/xml application/xml+rss text/javascript image/gif image/jpeg image/png application/json application/x-tar application/zip application/x-rar-compressed application/msword application/octet-stream application/vnd.ms-excel application/pdf application/vnd.ms-powerpoint;
    gzip_vary         on;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}</pre>
]]></content:encoded>
      <category>errors</category><category>linux</category><category>www</category>
      <category>nginx</category>
    </item>
    
    <item>
      <title>Call to undefined function http_post_data()</title>
      <link>https://yeri.be/call-to-undefined-function-http_post_data/</link>
      <pubDate>Wed, 09 Feb 2011 09:55:45 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/call-to-undefined-function-http_post_data/</guid>
      <description>&lt;p&gt;After updating &lt;a href=&#34;https://web.archive.org/web/20110213161611/http://vm1.rootspirit.com:80/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;my server&lt;/a&gt; from testing to Squeeze it suddenly crashed after running a high CPU % perl script.&lt;/p&gt;&#xA;&lt;p&gt;Being unresponsive I reset the machine to reboot it.&lt;/p&gt;&#xA;&lt;p&gt;After booting up and testing websites running on it I came along an odd PHP error;&lt;/p&gt;&#xA;&lt;pre style=&#34;background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;&#34;&gt;Call to undefined function http_post_data()&lt;/pre&gt;&#xA;&lt;p&gt;Probably due to PHP updates from Lenny/testing to Squeeze.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>After updating <a href="https://web.archive.org/web/20110213161611/http://vm1.rootspirit.com:80/" target="_blank" rel="noopener">my server</a> from testing to Squeeze it suddenly crashed after running a high CPU % perl script.</p>
<p>Being unresponsive I reset the machine to reboot it.</p>
<p>After booting up and testing websites running on it I came along an odd PHP error;</p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;">Call to undefined function http_post_data()</pre>
<p>Probably due to PHP updates from Lenny/testing to Squeeze.</p>
<p>This error is caused by not having installed PECL-HTTP (and <span style="font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; line-height: normal;">php-pear php5-dev libcurl3-openssl-dev)</span></p>
<p><span style="font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; line-height: normal;">However, PECL-HTTP had been installed for ages and running the pecl install command resulted in this:</span></p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;"># pecl install pecl_http
pecl/pecl_http is already installed and is the same as the released version 1.7.0
install failed</pre>
<p>Some quick Googling didn&rsquo;t come up with a simple fix.</p>
<p>I then tried to reinstall PECL-HTTP (by uninstalling and reinstalling it)</p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 35px; border: 1px dashed #489e06;"># pecl uninstall pecl_http
Unable to remove "extension=http.so" from php.ini
uninstall ok: channel://pecl.php.net/pecl_http-1.7.0
# pecl install pecl_http
downloading pecl_http-1.7.0.tgz ...
Starting to download pecl_http-1.7.0.tgz (173,979 bytes)
[...]</pre>
<p>Which luckily did solve my issue&hellip;</p>
<p>So reinstalling does actually solve stuff on Linux :x</p>
<p>Be sure to have extension=http.so in your php.ini and to restart php if it&rsquo;s running with fastcgi or restarting Apache after making the changes.</p>
]]></content:encoded>
      <category>errors</category><category>linux</category><category>software</category><category>www</category>
      <category>nginx</category><category>php</category>
    </item>
    
    <item>
      <title>Blog changes</title>
      <link>https://yeri.be/blog-changes/</link>
      <pubDate>Thu, 09 Dec 2010 00:47:31 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/blog-changes/</guid>
      <description>&lt;p&gt;Right, playing around with my blog again. Wasn&amp;rsquo;t really that happy anymore with my nginx rproxy caching. Especially that for some reason, lately, every (php) request got at least one hit to the backend Apache server, while it used to cache the generated html for 30 mins.&lt;/p&gt;&#xA;&lt;p&gt;And well, performance just wasn&amp;rsquo;t good enough. So I said bye to &lt;a href=&#34;http://one.rootspirit.com&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;one.rootspirit.com&lt;/a&gt;, and hi to &lt;a href=&#34;https://web.archive.org/web/20110213161611/http://vm1.rootspirit.com:80/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;vm1.rootspirit.com&lt;/a&gt; a couple of days ago. Vm1 is no longer the nginx proxy, but is hosting my whole blog now. No more Apache for me.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Right, playing around with my blog again. Wasn&rsquo;t really that happy anymore with my nginx rproxy caching. Especially that for some reason, lately, every (php) request got at least one hit to the backend Apache server, while it used to cache the generated html for 30 mins.</p>
<p>And well, performance just wasn&rsquo;t good enough. So I said bye to <a href="http://one.rootspirit.com" target="_blank" rel="noopener">one.rootspirit.com</a>, and hi to <a href="https://web.archive.org/web/20110213161611/http://vm1.rootspirit.com:80/" target="_blank" rel="noopener">vm1.rootspirit.com</a> a couple of days ago. Vm1 is no longer the nginx proxy, but is hosting my whole blog now. No more Apache for me.</p>
<p>Now to see if performance increases and if it was any point in changing.</p>
<p>Oh, and all static/upload/image requests are now rewritten to a new domain (static.0x04.com). Gives me to option to move static pages to a different webserver/host in the future. And why 0x04.com and not static.yeri.be or static.tuinslak.org ? Well, don&rsquo;t know. Just like my &ldquo;0x04&rdquo; domain name! :D</p>
<p>Oh well&hellip; Just playing around&hellip;</p>
]]></content:encoded>
      <category>misc</category><category>software</category><category>www</category>
      <category>tuinslak</category><category>blog</category><category>nginx</category>
    </item>
    
    <item>
      <title>iRail news</title>
      <link>https://yeri.be/irail-news/</link>
      <pubDate>Sun, 26 Sep 2010 03:06:23 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/irail-news/</guid>
      <description>&lt;ul&gt;&#xA;    &lt;li&gt;Been playing around with &lt;a href=&#34;https://static.yeri.be/2010/09/irail_nginxVsApache.txt&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;nginx vs Apache&lt;/a&gt; for &lt;a href=&#34;http://irail.be&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;iRail&lt;/a&gt;. The bottle neck still is the NMBS site (and I&#39;m truly sorry for DoSing you, dearest NMBS. I had to benchmark), but nginx seems to win just slightly over Apache. Maybe it&#39;s worth moving irail.be to my nginx webserver. &amp;lt;3 nginx.&lt;/li&gt;&#xA;    &lt;li&gt;The iRail (national) mobile website is getting its final touches and should go live tomorrow night.&lt;/li&gt;&#xA;    &lt;li&gt;The iRail &lt;a href=&#34;http://api.irail.be/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;API&lt;/a&gt; seems stable. Special thanks to Pieter.&lt;/li&gt;&#xA;    &lt;li&gt;iRail is currently developing a native Qt (Symbian, Maemo and MeeGo) application.&lt;/li&gt;&#xA;    &lt;li&gt;There will most likely be a &lt;a href=&#34;https://web.archive.org/web/20211106125618/https://www.bada.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Bada&lt;/a&gt; (Samsung) native application as well.&lt;/li&gt;&#xA;    &lt;li&gt;Same for the iPhone, native app should be here soonish.&lt;/li&gt;&#xA;    &lt;li&gt;If you&#39;d like to help, one way or another, two addresses, &lt;a href=&#34;http://project.irail.be&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Project iRail&lt;/a&gt; and &lt;a href=&#34;https://lists-archive.okfn.org/pipermail/irail/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;mailing list&lt;/a&gt;. :)&lt;/li&gt;&#xA;    &lt;li&gt;iRail team will attend &lt;a href=&#34;http://project.irail.be/cgi-bin/trac.fcgi/wiki/Events/AppsMarathon&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Apps Marathon&lt;/a&gt; on Monday.&lt;/li&gt;&#xA;    &lt;li&gt;iRail @ &lt;a href=&#34;https://web.archive.org/web/20130922154100/http://www.openbelgium.be:80/data/nmbs-sncb-api-irail&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenBelgium&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
      <content:encoded><![CDATA[<ul>
    <li>Been playing around with <a href="https://static.yeri.be/2010/09/irail_nginxVsApache.txt" target="_blank" rel="noopener noreferrer">nginx vs Apache</a> for <a href="http://irail.be" target="_blank" rel="noopener noreferrer">iRail</a>. The bottle neck still is the NMBS site (and I'm truly sorry for DoSing you, dearest NMBS. I had to benchmark), but nginx seems to win just slightly over Apache. Maybe it's worth moving irail.be to my nginx webserver. &lt;3 nginx.</li>
    <li>The iRail (national) mobile website is getting its final touches and should go live tomorrow night.</li>
    <li>The iRail <a href="http://api.irail.be/" target="_blank" rel="noopener noreferrer">API</a> seems stable. Special thanks to Pieter.</li>
    <li>iRail is currently developing a native Qt (Symbian, Maemo and MeeGo) application.</li>
    <li>There will most likely be a <a href="https://web.archive.org/web/20211106125618/https://www.bada.com/" target="_blank" rel="noopener noreferrer">Bada</a> (Samsung) native application as well.</li>
    <li>Same for the iPhone, native app should be here soonish.</li>
    <li>If you'd like to help, one way or another, two addresses, <a href="http://project.irail.be" target="_blank" rel="noopener noreferrer">Project iRail</a> and <a href="https://lists-archive.okfn.org/pipermail/irail/" target="_blank" rel="noopener noreferrer">mailing list</a>. :)</li>
    <li>iRail team will attend <a href="http://project.irail.be/cgi-bin/trac.fcgi/wiki/Events/AppsMarathon" target="_blank" rel="noopener noreferrer">Apps Marathon</a> on Monday.</li>
    <li>iRail @ <a href="https://web.archive.org/web/20130922154100/http://www.openbelgium.be:80/data/nmbs-sncb-api-irail" target="_blank" rel="noopener noreferrer">OpenBelgium</a></li>
</ul>
]]></content:encoded>
      <category>linux</category><category>software</category><category>irail</category><category>www</category>
      <category>appsmarathon</category><category>bada</category><category>iphone</category><category>nginx</category><category>nmbs</category><category>nokia</category><category>sncb</category>
    </item>
    
    <item>
      <title>nginx configs</title>
      <link>https://yeri.be/nginx-configs/</link>
      <pubDate>Wed, 30 Jun 2010 02:19:42 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nginx-configs/</guid>
      <description>&lt;p&gt;Been slacking a bit lately, but here &lt;a href=&#34;https://yeri.be/tag/nginx/&#34;&gt;they&lt;/a&gt; are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;    &lt;li&gt;/etc/nginx/&lt;a href=&#34;https://static.yeri.be/2010/06/nginx.conf_.txt&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;nginx.conf&lt;/a&gt; // general nginx config&lt;/li&gt;&#xA;    &lt;li&gt;/etc/nginx/sites-available/&lt;a href=&#34;https://static.yeri.be/2010/06/blog.txt&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;blog&lt;/a&gt; // my current (as of posting this) rproxy settings for this blog&lt;/li&gt;&#xA;    &lt;li&gt;/etc/nginx/conf.d/&lt;a href=&#34;https://static.yeri.be/2010/06/proxy.conf_.txt&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;proxy.conf&lt;/a&gt; // reverse proxy related config&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
      <content:encoded><![CDATA[<p>Been slacking a bit lately, but here <a href="https://yeri.be/tag/nginx/">they</a> are:</p>
<ul>
    <li>/etc/nginx/<a href="https://static.yeri.be/2010/06/nginx.conf_.txt" target="_blank" rel="noopener noreferrer">nginx.conf</a> // general nginx config</li>
    <li>/etc/nginx/sites-available/<a href="https://static.yeri.be/2010/06/blog.txt" target="_blank" rel="noopener noreferrer">blog</a> // my current (as of posting this) rproxy settings for this blog</li>
    <li>/etc/nginx/conf.d/<a href="https://static.yeri.be/2010/06/proxy.conf_.txt" target="_blank" rel="noopener noreferrer">proxy.conf</a> // reverse proxy related config</li>
</ul>
]]></content:encoded>
      <category>linux</category><category>software</category><category>www</category>
      <category>nginx</category>
    </item>
    
    <item>
      <title>nginx cache in tmpfs</title>
      <link>https://yeri.be/nginx-cache-in-tmpfs/</link>
      <pubDate>Wed, 09 Jun 2010 18:10:31 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nginx-cache-in-tmpfs/</guid>
      <description>&lt;p&gt;Probably won&amp;rsquo;t change a lot to my performance, but I&amp;rsquo;ve mounted the nginx reverse proxy cache in a &lt;a href=&#34;http://www.thegeekstuff.com/2008/11/overview-of-ramfs-and-tmpfs-on-linux/&#34; target=&#34;_blank&#34;&gt;tmpfs mount&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;pre style=&#34;padding-left: 30px;&#34;&gt;none on /var/cache/nginx/blog type tmpfs (rw,size=512m)&lt;/pre&gt;&#xA;&lt;pre style=&#34;padding-left: 30px;&#34;&gt;none  512M   47M  466M   4% /var/cache/nginx/blog&lt;/pre&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s see what performance boosts this will give. :P&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Probably won&rsquo;t change a lot to my performance, but I&rsquo;ve mounted the nginx reverse proxy cache in a <a href="http://www.thegeekstuff.com/2008/11/overview-of-ramfs-and-tmpfs-on-linux/" target="_blank">tmpfs mount</a>.</p>
<pre style="padding-left: 30px;">none on /var/cache/nginx/blog type tmpfs (rw,size=512m)</pre>
<pre style="padding-left: 30px;">none  512M   47M  466M   4% /var/cache/nginx/blog</pre>
<p>Let&rsquo;s see what performance boosts this will give. :P</p>
]]></content:encoded>
      <category>linux</category><category>software</category><category>www</category>
      <category>nginx</category>
    </item>
    
    <item>
      <title>nginx reverse proxy with caching</title>
      <link>https://yeri.be/nginx-reverse-proxy-with-caching/</link>
      <pubDate>Sun, 23 May 2010 00:10:06 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nginx-reverse-proxy-with-caching/</guid>
      <description>&lt;p&gt;Playing around and searching the &lt;a href=&#34;http://serverfault.com/questions/30705/how-to-set-up-nginx-as-a-caching-reverse-proxy&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;web&lt;/a&gt; I enabled some decent caching now.&lt;/p&gt;&#xA;&lt;p&gt;Here are some stats: &lt;a href=&#34;https://static.yeri.be/2010/05/nginx_rproxy_cache.txt&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;image+html&lt;/a&gt; and &lt;a href=&#34;https://static.yeri.be/2010/05/nginx_rproxy_cache2.txt&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;php&lt;/a&gt;. Note that the php on apache (recompiled each request, about 1.5-2sec between every request) versus the cached output has a huge difference. Difference between images and static text files aren&amp;rsquo;t that huge. Also note that nginx has gzip enabled. The downside is that nginx caches all pages (HTTP code 200) for one hour and isn&amp;rsquo;t notified when pages are modified (yet).&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Playing around and searching the <a href="http://serverfault.com/questions/30705/how-to-set-up-nginx-as-a-caching-reverse-proxy" target="_blank" rel="noopener noreferrer">web</a> I enabled some decent caching now.</p>
<p>Here are some stats: <a href="https://static.yeri.be/2010/05/nginx_rproxy_cache.txt" target="_blank" rel="noopener noreferrer">image+html</a> and <a href="https://static.yeri.be/2010/05/nginx_rproxy_cache2.txt" target="_blank" rel="noopener noreferrer">php</a>. Note that the php on apache (recompiled each request, about 1.5-2sec between every request) versus the cached output has a huge difference. Difference between images and static text files aren&rsquo;t that huge. Also note that nginx has gzip enabled. The downside is that nginx caches all pages (HTTP code 200) for one hour and isn&rsquo;t notified when pages are modified (yet).</p>
<p>My &ldquo;live&rdquo; blog is also accessible using <a href="https://yeri.be">blog.yeri.be</a> as blog.tuinslak.org will now <a href="http://uptime.netcraft.com/up/graph?site=blog.tuinslak.org&amp;probe=1" target="_blank" rel="noopener noreferrer">point to the nginx</a> reverse proxy.</p>
<p>I&rsquo;ve come across a few issues though, pages such as <a href="https://static.yeri.be/2010/05/ip.php" target="_blank" rel="noopener noreferrer">this</a> (shows your current IP address) and <a href="https://static.yeri.be/2010/05/date.php" target="_blank" rel="noopener noreferrer">this</a> (compare to <a href="https://static.yeri.be/2010/05/date.php" target="_blank" rel="noopener noreferrer">this</a> and refresh a few times) are cached as well, and actually show the previous visitor (if any) their output and the pages aren&rsquo;t updated when a new visitor visits them. <em>Edit: fixed, correctly refreshes; </em><em>.php under wp-</em> isn&rsquo;t cached.</p>
<p>Same goes for layout (I use <a href="https://yeri.be/wptouch/" target="_blank" rel="noopener noreferrer">WPtouch</a> for mobile devices). <a href="https://static.yeri.be/2010/05/Screen-shot-2010-05-22-at-21.26.53-2.png" target="_blank" rel="noopener noreferrer">A page</a> that got visited on the iPhone and then on a desktop as well as <a href="https://static.yeri.be/2010/05/photo.jpg" target="_blank" rel="noopener noreferrer">a page</a> that got first cached using a desktop browser and then an iPhone. I&rsquo;ve disabled WPtouch for now.</p>
<p>And a 3rd issue is that the Wordpress stats image (<img class="alignnone" title=":)" src="http://stats.wordpress.com/g.gif" alt="" width="6" height="5" />) is cached as well. So if a regular visitor visits the site before a a registered user (admin), the stats image will still be present (and generate incorrect stats). This doesn&rsquo;t happen the other way around, as no pages are cached for a registered user (unless they are already in its cache)&hellip; Weird. <em>Edit: fixed by watching the http cookie and this <a href="http://wordpress.org/extend/plugins/nginx-proxy-cache-integrator/" target="_blank" rel="noopener noreferrer">plugin</a>. Admin pages are never cached now but at least stats are correct again.</em></p>
<p>Speed gain is insane though.</p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category><category>www</category>
      <category>nginx</category>
    </item>
    
    <item>
      <title>nginx reverse proxy IP</title>
      <link>https://yeri.be/nginx-reverse-proxy-ip/</link>
      <pubDate>Sat, 22 May 2010 17:32:59 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nginx-reverse-proxy-ip/</guid>
      <description>&lt;p&gt;The issue with the wrong IP address being shown when using nginx &lt;a href=&#34;https://yeri.be/nginx-reverse-proxy/&#34;&gt;as reverse proxy&lt;/a&gt; can easily be solved with mod_rpaf.&lt;/p&gt;&#xA;&lt;div id=&#34;_mcePaste&#34;&gt;cache.blog.tuinslak.org &lt;strong&gt;&lt;a href=&#34;http://home.tiete.be&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;85.234.196.237&lt;/a&gt;&lt;/strong&gt; - - [22/May/2010:16:33:46 +0200] &#34;GET /2010/05/nginx-reverse-proxy/ HTTP/1.0&#34; 200 6184 &#34;-&#34; &#34;Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.53 Safari/533.4&#34; 1766 6503&lt;/div&gt;&#xA;&lt;p&gt;vs&lt;/p&gt;&#xA;&lt;p&gt;cache.blog.tuinslak.org &lt;strong&gt;&lt;a href=&#34;https://web.archive.org/web/20130702144129/http://85.12.6.171&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;85.12.6.171&lt;/a&gt;&lt;/strong&gt; - - [22/May/2010:16:27:40 +0200] &amp;ldquo;GET /2010/05/nginx-reverse-proxy/ HTTP/1.0&amp;rdquo; 200 22639 &amp;ldquo;-&amp;rdquo; &amp;ldquo;Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.53 Safari/533.4&amp;rdquo; 1771 23031&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>The issue with the wrong IP address being shown when using nginx <a href="https://yeri.be/nginx-reverse-proxy/">as reverse proxy</a> can easily be solved with mod_rpaf.</p>
<div id="_mcePaste">cache.blog.tuinslak.org <strong><a href="http://home.tiete.be" target="_blank" rel="noopener noreferrer">85.234.196.237</a></strong> - - [22/May/2010:16:33:46 +0200] "GET /2010/05/nginx-reverse-proxy/ HTTP/1.0" 200 6184 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.53 Safari/533.4" 1766 6503</div>
<p>vs</p>
<p>cache.blog.tuinslak.org <strong><a href="https://web.archive.org/web/20130702144129/http://85.12.6.171" target="_blank" rel="noopener noreferrer">85.12.6.171</a></strong> - - [22/May/2010:16:27:40 +0200] &ldquo;GET /2010/05/nginx-reverse-proxy/ HTTP/1.0&rdquo; 200 22639 &ldquo;-&rdquo; &ldquo;Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.53 Safari/533.4&rdquo; 1771 23031</p>
<p>First one being my current home IP address, the second one being the nginx server IP address. The idea is to have the first line to show up in the logs.</p>
<p>On Gentoo (and I guess it&rsquo;s fairly similar on other distributions);</p>
<pre>*  www-apache/mod_rpaf
      Latest version available: 0.6
      Latest version installed: 0.6
      Size of files: 7 kB
      Homepage:      http://stderr.net/apache/rpaf/
      Description:   Reverse proxy add forward module
      License:       Apache-2.0</pre>
<p><span style="font-style: normal;">Emerge it, add &ldquo;-D RPAF&rdquo; to /etc/conf.d/apache2 and add the following the the correct vhost (e.g. /etc/apache2/vhosts.d/your_vhost.conf):</span></p>
<pre>&lt;IfModule mod_rpaf.c&gt;
      RPAFenable On
      RPAFsethostname On
      RPAFproxy_ips <strong>85.12.6.171</strong>
&lt;/IfModule&gt;</pre>
<p><span style="font-style: normal;">Change the bold IP address to your nginx rproxy IP address</span></p>
<p><span style="font-style: normal;">Might be safe to run &ldquo;apache2ctl configtest&rdquo; to make sure you don&rsquo;t have any errors in your config file(s).</span></p>
<p><span style="font-style: normal;">And restart Apache. This makes it show the correct IP address in its log files.</span></p>
<p><span style="font-style: normal;">Next on my to do list, getting it to actually cache something. </span></p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category><category>www</category>
      <category>nginx</category>
    </item>
    
    <item>
      <title>nginx reverse proxy</title>
      <link>https://yeri.be/nginx-reverse-proxy/</link>
      <pubDate>Sat, 22 May 2010 15:35:08 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nginx-reverse-proxy/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been &lt;a href=&#34;http://uptime.netcraft.com/up/graph?site=vm1.rootspirit.com&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;playing around&lt;/a&gt; a bit with &lt;a href=&#34;http://nginx.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;nginx&lt;/a&gt; and its reverse proxy module. The &amp;ldquo;real&amp;rdquo; website is accessible &lt;a href=&#34;https://yeri.be/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;here&lt;/a&gt;, whereas the cached version is &lt;a href=&#34;https://yeri.be/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;I&amp;rsquo;m deliberately making a difference between cache.* and live.* as blog.tuinslak.* might move to the cached version lateron. &lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The question, is it useful to reverse proxy this blog? No, probably not. But meh&amp;hellip; It&amp;rsquo;s fun. :)&lt;/p&gt;&#xA;&lt;p&gt;IP differences between both versions: &lt;a href=&#34;https://static.yeri.be/2010/05/ip.php&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;live&lt;/a&gt; vs &lt;a href=&#34;https://static.yeri.be/2010/05/ip.php&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;cache&lt;/a&gt;°. I&amp;rsquo;m guessing as most of the stats (Google Analytics and WP Stats) are JavaScript based, all stats should still be correctly generated. Only the Apache logs show the nginx proxy &lt;a href=&#34;https://web.archive.org/web/20110213161611/http://vm1.rootspirit.com:80/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;IP&lt;/a&gt; address. Which is normal, I guess.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I&rsquo;ve been <a href="http://uptime.netcraft.com/up/graph?site=vm1.rootspirit.com" target="_blank" rel="noopener noreferrer">playing around</a> a bit with <a href="http://nginx.org/" target="_blank" rel="noopener noreferrer">nginx</a> and its reverse proxy module. The &ldquo;real&rdquo; website is accessible <a href="https://yeri.be/" target="_blank" rel="noopener noreferrer">here</a>, whereas the cached version is <a href="https://yeri.be/" target="_blank" rel="noopener noreferrer">here</a>.</p>
<p><em>I&rsquo;m deliberately making a difference between cache.* and live.* as blog.tuinslak.* might move to the cached version lateron. </em></p>
<p>The question, is it useful to reverse proxy this blog? No, probably not. But meh&hellip; It&rsquo;s fun. :)</p>
<p>IP differences between both versions: <a href="https://static.yeri.be/2010/05/ip.php" target="_blank" rel="noopener noreferrer">live</a> vs <a href="https://static.yeri.be/2010/05/ip.php" target="_blank" rel="noopener noreferrer">cache</a>°. I&rsquo;m guessing as most of the stats (Google Analytics and WP Stats) are JavaScript based, all stats should still be correctly generated. Only the Apache logs show the nginx proxy <a href="https://web.archive.org/web/20110213161611/http://vm1.rootspirit.com:80/" target="_blank" rel="noopener noreferrer">IP</a> address. Which is normal, I guess.</p>
<p>First small test doesn&rsquo;t seem too good. Apparently not a lot of caching is going on. Though most of this site&rsquo;s content is HTML (using WPSuperCache).</p>
<ul>
    <li>Live, on One, using Apache: <a href="https://static.yeri.be/2010/05/one_apache.txt" target="_blank" rel="noopener noreferrer">here</a> &amp; <a href="https://static.yeri.be/2010/05/one_apache_img.txt" target="_blank" rel="noopener noreferrer">here</a></li>
    <li>Proxy, on VM1, using nginx: <a href="https://static.yeri.be/2010/05/vm1_nginx.txt" target="_blank" rel="noopener noreferrer">here</a> &amp; <a href="https://static.yeri.be/2010/05/vm1_nginx_img.txt" target="_blank" rel="noopener noreferrer">here</a></li>
</ul>
<p>More tests &amp; fine tuning later!</p>
<p>(°): Due to a <a href="https://yeri.be/nginx-reverse-proxy-ip/">minor edit</a>, the live and cached version both show the <span style="text-decoration: line-through;"><a href="https://yeri.be/nginx-reverse-proxy-with-caching">correct</a></span> IP address (yours) instead of the nginx proxy IP address.</p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category><category>www</category>
      <category>nginx</category>
    </item>
    
    <item>
      <title>nginx &#43; fastcgi PHP</title>
      <link>https://yeri.be/nginx-fastcgi-php/</link>
      <pubDate>Sun, 21 Mar 2010 01:32:21 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/nginx-fastcgi-php/</guid>
      <description>&lt;p&gt;I recently migrated &lt;a href=&#34;https://web.archive.org/web/20110213161611/http://vm1.rootspirit.com:80/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;vm1&lt;/a&gt; to &lt;a href=&#34;http://nginx.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;nginx&lt;/a&gt; instead of lighttpd. Just for the sake of playing and testing around.&lt;/p&gt;&#xA;&lt;p&gt;As there&amp;rsquo;s a PHP page as well, I had to set up fastcgi with PHP. I mainly followed &lt;a href=&#34;https://web.archive.org/web/20160310072932/http://tomasz.sterna.tv:80/2009/04/php-fastcgi-with-nginx-on-ubuntu&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;this tutorial&lt;/a&gt; to try to get PHP working.&lt;/p&gt;&#xA;&lt;p&gt;However, every PHP page I visited returned following error:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;No input file specified.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As I was fairly sure it was path (or variable) related, I played around with:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I recently migrated <a href="https://web.archive.org/web/20110213161611/http://vm1.rootspirit.com:80/" target="_blank" rel="noopener noreferrer">vm1</a> to <a href="http://nginx.org/" target="_blank" rel="noopener noreferrer">nginx</a> instead of lighttpd. Just for the sake of playing and testing around.</p>
<p>As there&rsquo;s a PHP page as well, I had to set up fastcgi with PHP. I mainly followed <a href="https://web.archive.org/web/20160310072932/http://tomasz.sterna.tv:80/2009/04/php-fastcgi-with-nginx-on-ubuntu" target="_blank" rel="noopener noreferrer">this tutorial</a> to try to get PHP working.</p>
<p>However, every PHP page I visited returned following error:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">No input file specified.
</span></span></code></pre></div><p>As I was fairly sure it was path (or variable) related, I played around with:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">fastcgi_param   SCRIPT_FILENAME  <span class="nv">$document_root$fastcgi_script_name</span><span class="p">;</span>
</span></span></code></pre></div><p>Changing $document_root to the full path, etc, without success.</p>
<p>However, as I used the init script in the tutorial, and <a href="https://web.archive.org/web/20120225104936/http://forum.slicehost.com:80/comments.php?DiscussionID=1259" target="_blank" rel="noopener noreferrer">read a few posts</a> about possible permission errors, I tried adding the group to the fastcgi daemon starter as well.</p>
<p>Change this:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">start-stop-daemon --quiet --start --background --chuid <span class="s2">&#34;</span><span class="nv">$USER</span><span class="s2">&#34;</span> --exec /usr/bin/env -- <span class="nv">$PHP_CGI_ARGS</span>
</span></span></code></pre></div><p>to:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">start-stop-daemon --quiet --start --background --chuid <span class="s2">&#34;</span><span class="nv">$USER</span><span class="s2">&#34;</span> -g www-data --exec /usr/bin/env -- <span class="nv">$PHP_CGI_ARGS</span>
</span></span></code></pre></div><p>Notice the &ldquo;-g www-data&rdquo; part.</p>
<p>You can always make a variable in case you ever want to edit it.</p>
<p>Restart php_fastcgi and try again. Should work fine now.</p>
<p>Some fast stats: <a href="https://static.yeri.be/2010/03/nginx.vm1_.txt" target="_blank" rel="noopener noreferrer">vm1 + nginx</a>, <a href="https://static.yeri.be/2010/03/lighttpd.vm1_.txt" target="_blank" rel="noopener noreferrer">vm1 + lighttpd</a>, <a href="https://static.yeri.be/2010/03/IIS7.vm0_.txt" target="_blank" rel="noopener noreferrer">vm0 + IIS7</a>, <a href="https://static.yeri.be/2010/03/apache.one_.txt" target="_blank" rel="noopener noreferrer">one + Apache</a>, vm1 + nginx + PHP and <a href="https://static.yeri.be/2010/03/apache.one_.php_.txt" target="_blank" rel="noopener noreferrer">one + Apache + PHP</a>.</p>
<p>These stats should only give a quick overview. To get correct results it should be ran on the same hardware, at the same moment with the same load, and 100% the same pages.</p>
<p>&ldquo;One&rdquo; is a Gentoo dual Pentium III with 1.2Gb ram, &ldquo;vm0&rdquo; is a Windows 2008 Xen Virtual machine with 1 Gb ram, and has access to two vCPUs (Xeon), &ldquo;vm1&rdquo; is a Debian with 128Mb ram, and also access to two vCPUs (Xeon). Nginx wins on static content (followed by Lighttpd). Apache wins by a little over nginx on PHP content in these tests.</p>
<p><a href="https://web.archive.org/web/20120703003237/http://blog.webfaction.com:80/a-little-holiday-present" target="_blank" rel="noopener noreferrer">Here</a>&rsquo;s another site with some stats.</p>
]]></content:encoded>
      <category>errors</category><category>linux</category><category>software</category><category>www</category>
      <category>nginx</category><category>php</category>
    </item>
    
  </channel>
</rss>
