<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>D-talk (Entries tagged as apache)</title>
    <link>http://blog.dynom.nl/</link>
    <description>The little things that pop into mind</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.2-beta4 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Multiple PHP versions on one webserver</title>
    <link>http://blog.dynom.nl/archives/Multiple-PHP-versions-on-one-webserver_20091103_53.html</link>
            <category>Apache</category>
            <category>PHP</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/Multiple-PHP-versions-on-one-webserver_20091103_53.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=53</wfw:comment>

    <slash:comments>7</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=53</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;h2&gt;Introduction&lt;/h2&gt;&lt;p&gt;This is a blog about running two PHP versions on one webserver and using multiple php.ini files, this combination can be a tricky one to tackle. But luckily one we can tackle quite easily as long as one of the PHP versions is &amp;gt;= 5.2.7. For this example I&#039;ll be using Apache, but the webserver flavor doesn&#039;t really matter. The most important part is the &quot;PHP_INI_SCAN_DIR&quot; environment variable. &lt;/p&gt;&lt;h2&gt;The why&lt;/h2&gt;&lt;p&gt;There could be a number of reasons to want what I&#039;m about to talk about. In my case I have a project where I have a legacy code-base, running on a specific PHP version, and a new code-base which will be run on 5.3. Because the new code-base will be a ongoing progress of replacing the old, it first has to run side by side with the legacy code-base. So I wanted my development image to run two PHP versions.&lt;/p&gt;&lt;p&gt;The old code-base used php.ini settings such as a include-path, error reporting, etc.&amp;#160; Which will be different from the new code-bas, and those can no-longer be set with the &#039;php_value&#039; feature of Apaches since the PHP version we&#039;ll be using for that runs as (f)CGI rather then as module.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Multiple-PHP-versions-on-one-webserver_20091103_53.html#extended&quot;&gt;Continue reading &quot;Multiple PHP versions on one webserver&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 03 Nov 2009 08:39:00 +0100</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20091103_53.html</guid>
    <category>apache</category>
<category>environment variable</category>
<category>multiple versions</category>
<category>php</category>
<category>planetphp</category>

</item>
<item>
    <title>Apache's fail with 'encoded slashes'</title>
    <link>http://blog.dynom.nl/archives/Apaches-fail-with-encoded-slashes_20090625_40.html</link>
            <category>Apache</category>
    
    <comments>http://blog.dynom.nl/archives/Apaches-fail-with-encoded-slashes_20090625_40.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=40</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=40</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Honestly it took me a while to debug a vague bug I had, at first I ignored it and used different path values, figuring it was a bad rewrite rule. I&#039;m using a project and I&#039;m developing on both Apache and IIS, with the one inconsistency that I always got a 404 when the path contained a encoded /, namely &quot;%2F&quot;. So basically, a URL like this: http://domain.com/show/article/104671-Situation%20details%20n%2Fa (Title being: &quot;Situation details n/a&quot;) is giving a 404. The error log was helpful, because it said:&lt;/p&gt;&lt;p&gt;&lt;code&gt;[..] [info] [client 127.0.0.1] found %2f (encoded &#039;/&#039;) in URI (decoded=&#039;//&#039;), returning 404 &lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Luckily, fixing this &lt;s&gt;bug&lt;/s&gt; feature is easy. Add the following to your httpd.conf (vhost or server directive) and voila:&lt;/p&gt;&lt;p&gt;
&lt;code&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes&#039;);&quot;  href=&quot;http://httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes&quot; mce_href=&quot;http://httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes&quot;&gt;AllowEncodedSlashes&lt;/a&gt; On&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Arguably you could be saying that %2F&#039;s simply shouldn&#039;t be in the path, but rather in the POST body or as GET parameter. However in a world where everything has to be SEO and url&#039;s have to be pretty, isn&#039;t this silly default behavior ? Especially since the RFC&#039;s also clearly state that an encoded forward slash (%2F) should not be treated as a regular &#039;/&#039;. To quote &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.faqs.org/rfcs/rfc2616.html&#039;);&quot;  href=&quot;http://www.faqs.org/rfcs/rfc2616.html&quot; mce_href=&quot;http://www.faqs.org/rfcs/rfc2616.html&quot;&gt;RFC 2616&lt;/a&gt;&amp;#160;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.faqs.org/rfcs/rfc2396.html&#039;);&quot;  href=&quot;http://www.faqs.org/rfcs/rfc2396.html&quot; mce_href=&quot;http://www.faqs.org/rfcs/rfc2396.html&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;pre&gt;Characters other than those in the &quot;reserved&quot; and &quot;unsafe&quot; sets (see RFC 2396 [42]) are equivalent to their &quot;&quot;%&quot; HEX HEX&quot; encoding.&lt;/pre&gt;&lt;p&gt;and &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.faqs.org/rfcs/rfc2396.html&#039;);&quot;  href=&quot;http://www.faqs.org/rfcs/rfc2396.html&quot; mce_href=&quot;http://www.faqs.org/rfcs/rfc2396.html&quot;&gt;RFC 2396&lt;/a&gt;&lt;/p&gt;&lt;pre&gt;2.2. Reserved Characters&lt;br /&gt;&lt;br /&gt;   Many URI include components consisting of or delimited by, certain&lt;br /&gt;   special characters.  These characters are called &quot;reserved&quot;, since&lt;br /&gt;   their usage within the URI component is limited to their reserved&lt;br /&gt;   purpose.  If the data for a URI component would conflict with the&lt;br /&gt;   reserved purpose, then the conflicting data must be escaped before&lt;br /&gt;   forming the URI.&lt;br /&gt;&lt;br /&gt;      reserved    = &quot;;&quot; | &quot;/&quot; | &quot;?&quot; | &quot;:&quot; | &quot;@&quot; | &quot;&amp;amp;&quot; | &quot;=&quot; | &quot;+&quot; |&lt;br /&gt;                    &quot;$&quot; | &quot;,&quot;&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Thu, 25 Jun 2009 14:58:45 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20090625_40.html</guid>
    <category>%2f</category>
<category>apache</category>
<category>encoded</category>
<category>fail</category>
<category>slashes</category>

</item>
<item>
    <title>Be careful with double extensions</title>
    <link>http://blog.dynom.nl/archives/Be-careful-with-double-extensions_20081024_25.html</link>
            <category>PHP</category>
            <category>PlanetPHP</category>
    
    <comments>http://blog.dynom.nl/archives/Be-careful-with-double-extensions_20081024_25.html#comments</comments>
    <wfw:comment>http://blog.dynom.nl/wfwcomment.php?cid=25</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dynom.nl/rss.php?version=2.0&amp;type=comments&amp;cid=25</wfw:commentRss>
    

    <author>nospam@example.com (Mark van der Velden)</author>
    <content:encoded>
    &lt;p&gt;Since I&#039;m on a &#039;finish blog drafts&#039; spree, I might as well publish this one also. I actually had it in draft for about 5 months now anyway.&lt;/p&gt;&lt;p&gt;In most upload tools files are checked on extensions only, while it might seem pretty solid it&#039;s actually not as safe as you might think. Especially in combination with &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.apache.org/&#039;);&quot;  href=&quot;http://www.apache.org/&quot; title=&quot;Apache HTTP Server&quot; target=&quot;_blank&quot; mce_href=&quot;http://www.apache.org/&quot;&gt;Apache&lt;/a&gt; and &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/httpd.apache.org/docs/2.0/mod/mod_mime.html&#039;);&quot;  href=&quot;http://httpd.apache.org/docs/2.0/mod/mod_mime.html&quot; title=&quot;Apache Module mod_mime&quot; target=&quot;_blank&quot; mce_href=&quot;http://httpd.apache.org/docs/2.0/mod/mod_mime.html&quot;&gt;mod_mime&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;When you do:&lt;br /&gt; &lt;i&gt;rename image.jpg image.txt&lt;/i&gt; and you request it: &lt;i&gt;domain.com/image.txt&lt;/i&gt; you get garbled text.&lt;/p&gt;&lt;p&gt;However when you try something like this:&lt;br /&gt; &lt;i&gt;rename file.php file.php.bogus&lt;/i&gt; and you request it: &lt;i&gt;domain.com/file.php.bogus&lt;/i&gt;
PHP code within the file is handled by the &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/httpd.apache.org/docs/2.2/handler.html&#039;);&quot;  href=&quot;http://httpd.apache.org/docs/2.2/handler.html&quot; title=&quot;Apache handlers&quot; mce_href=&quot;http://httpd.apache.org/docs/2.2/handler.html&quot;&gt;handler&lt;/a&gt; set for that extension.&lt;/p&gt;&lt;p&gt;Before you get all excited, the scenario when this happens is not likely to happen, because it only works for unknown file extensions. So basically, this can only happen when you work with black-listing rather then white-listing. And when checking files, you shouldn&#039;t be black-listing in the first place. Let&#039;s go into detail about the why.&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://blog.dynom.nl/archives/Be-careful-with-double-extensions_20081024_25.html#extended&quot;&gt;Continue reading &quot;Be careful with double extensions&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 24 Oct 2008 13:43:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dynom.nl/archives/guid_20081024_25.html</guid>
    <category>apache</category>
<category>double extensions</category>
<category>fckeditor</category>
<category>mod_mime</category>
<category>php</category>
<category>planetphp</category>
<category>tinymce</category>
<category>upload</category>
<category>wysiwyg</category>

</item>

</channel>
</rss>