<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rusty Razor Blade &#187; apache</title>
	<atom:link href="http://www.rustyrazorblade.com/category/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:03:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Enable Mod Rewrite Error Log</title>
		<link>http://www.rustyrazorblade.com/2009/04/enable-mod-rewrite-error-log/</link>
		<comments>http://www.rustyrazorblade.com/2009/04/enable-mod-rewrite-error-log/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 19:53:06 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/2009/04/22/enable-mod-rewrite-error-log/</guid>
		<description><![CDATA[<p>Just a quickie &#8211; throw this in your apache config if you need error logging for mod_rewrite. Useful in a dev environment, not so much in production.</p> <p> RewriteLog /var/log/httpd/rewrite.log<br /> RewriteLogLevel 9 </p>]]></description>
			<content:encoded><![CDATA[<p>Just a quickie &#8211; throw this in your apache config if you need error logging for mod_rewrite.  Useful in a dev environment, not so much in production.</p>
<blockquote><p>
RewriteLog /var/log/httpd/rewrite.log<br />
RewriteLogLevel 9
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2009/04/enable-mod-rewrite-error-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using mod_rewrite with VirtualDocumentRoot</title>
		<link>http://www.rustyrazorblade.com/2009/01/using-mod_rewrite-with-virtualdocumentroot/</link>
		<comments>http://www.rustyrazorblade.com/2009/01/using-mod_rewrite-with-virtualdocumentroot/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 03:33:19 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=459</guid>
		<description><![CDATA[<p>In our dev environment, we use VirtualDocumentRoot to avoid configuring new environments when we get a new developer. It&#8217;s awesome.</p> <p>However, if you try to use mod_rewrite, you&#8217;ll find that your rewrite rules will prepend whatever you have defined as the document root in the config file. To get around this, you have to use [...]]]></description>
			<content:encoded><![CDATA[<p>In our dev environment, we use VirtualDocumentRoot to avoid configuring new environments when we get a new developer.  It&#8217;s awesome.</p>
<p>However, if you try to use mod_rewrite, you&#8217;ll find that your rewrite rules will prepend whatever you have defined as the document root in the config file.  To get around this, you have to use the PT (passthrough) flag, which will solve the issue.</p>
<p>Example:</p>
<blockquote><p>RewriteRule ^/photo/(.*) /open.php?id=$1 [L,NE,PT]</p></blockquote>
<p>Found here, <a href="http://mail-archives.apache.org/mod_mbox/httpd-bugs/200306.mbox/%3C20030602153151.24218.qmail@nagoya.betaversion.org%3E">on an apache archive.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2009/01/using-mod_rewrite-with-virtualdocumentroot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Enabling Mod Deflate in Apache</title>
		<link>http://www.rustyrazorblade.com/2008/06/enabling-mod-deflate-in-apache/</link>
		<comments>http://www.rustyrazorblade.com/2008/06/enabling-mod-deflate-in-apache/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 22:57:52 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=133</guid>
		<description><![CDATA[<p>I got an error while compiling Apache today:</p> <p> &#8220;./configure&#8221; \<br /> &#8220;&#8211;enable-auth-digest&#8221; \<br /> &#8220;&#8211;enable-deflate&#8221; \<br /> &#8220;&#8211;enable-rewrite&#8221; \<br /> &#8220;&#8211;enable-so&#8221; \<br /> &#8220;&#8211;enable-vhost-alias&#8221; \<br /> &#8220;&#8211;disable-userdir&#8221; \<br /> &#8220;&#8211;enable-mime-magic&#8221; \</p> <p>configure: error: mod_deflate has been requested but can not be built due to prerequisite failures</p> <p>I fixed this by installing zlib from source.</p>]]></description>
			<content:encoded><![CDATA[<p>I got an error while compiling Apache today:</p>
<blockquote><p>
&#8220;./configure&#8221; \<br />
&#8220;&#8211;enable-auth-digest&#8221; \<br />
&#8220;&#8211;enable-deflate&#8221; \<br />
&#8220;&#8211;enable-rewrite&#8221; \<br />
&#8220;&#8211;enable-so&#8221; \<br />
&#8220;&#8211;enable-vhost-alias&#8221; \<br />
&#8220;&#8211;disable-userdir&#8221; \<br />
&#8220;&#8211;enable-mime-magic&#8221; \</p>
<p>configure: error: mod_deflate has been requested but can not be built due to prerequisite failures</p></blockquote>
<p>I fixed this by installing zlib from source.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2008/06/enabling-mod-deflate-in-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache: Urlencoded slash breaks multiviews?</title>
		<link>http://www.rustyrazorblade.com/2007/11/apache-urlencoded-slash-breaks-multiviews/</link>
		<comments>http://www.rustyrazorblade.com/2007/11/apache-urlencoded-slash-breaks-multiviews/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 23:46:07 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2007/11/13/apache-urlencoded-slash-breaks-multiviews/</guid>
		<description><![CDATA[<p>If you have a URL like the following, and you&#8217;re using multiviews:</p> <p>/login/15/return_page%2F50</p> <p>it won&#8217;t work. FYI, the last part is a return page. In this instance, lets just pretend it&#8217;s a return page that&#8217;s supposed to get hit after a successful login.</p> <p>Using Apache 2.2.3.</p>]]></description>
			<content:encoded><![CDATA[<p>If you have a URL like the following, and you&#8217;re using multiviews:</p>
<p><code>/login/15/return_page%2F50</code></p>
<p>it won&#8217;t work.  FYI, the last part is a return page.  In this instance, lets just pretend it&#8217;s a return page that&#8217;s supposed to get hit after a successful login.</p>
<p>Using Apache 2.2.3.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2007/11/apache-urlencoded-slash-breaks-multiviews/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Motorola RAZR and 406 Not acceptable</title>
		<link>http://www.rustyrazorblade.com/2007/11/motorola-razr-and-406-not-acceptable/</link>
		<comments>http://www.rustyrazorblade.com/2007/11/motorola-razr-and-406-not-acceptable/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 20:00:25 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2007/11/09/motorola-razr-and-406-not-acceptable/</guid>
		<description><![CDATA[<p>In trying to get a site working on cell phones, I got a &#8220;406 Not acceptable&#8221; only on the Motorola RAZR. The site loaded fine on my Treo 755 and every Blackberry I&#8217;ve tried.</p> <p>It seems that the RAZR doesn&#8217;t handle Multiviews very well, or at all for that matter. If you&#8217;re using Multiviews and [...]]]></description>
			<content:encoded><![CDATA[<p>In trying to get a site working on cell phones, I got a &#8220;406 Not acceptable&#8221; only on the Motorola RAZR.  The site loaded fine on my Treo 755 and every Blackberry I&#8217;ve tried.</p>
<p>It seems that the RAZR doesn&#8217;t handle Multiviews very well, or at all for that matter.  If you&#8217;re using Multiviews and Apache, you&#8217;ll have to specify the full URL: so /login.php rather just /login.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2007/11/motorola-razr-and-406-not-acceptable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Compile Error</title>
		<link>http://www.rustyrazorblade.com/2007/07/apache-compile-error/</link>
		<comments>http://www.rustyrazorblade.com/2007/07/apache-compile-error/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 23:15:29 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2007/07/24/apache-compile-error/</guid>
		<description><![CDATA[<p>I got this while recompiling apache (2.2.4).</p> <p>configure: error: Cannot use an external APR-util with the bundled APR</p> <p>After searching around for a while, I found a tip <a href="http://laffers.net/howtos/howto-install-apache">here</a> to include this in my configure: </p> <p>--with-included-apr</p> <p>Built on MacOS X 10.4.</p>]]></description>
			<content:encoded><![CDATA[<p>I got this while recompiling apache (2.2.4).</p>
<p><code>configure: error: Cannot use an external APR-util with the bundled APR</code></p>
<p>After searching around for a while, I found a tip <a href="http://laffers.net/howtos/howto-install-apache">here</a> to include this in my configure: </p>
<p><code>--with-included-apr</code></p>
<p>Built on MacOS X 10.4.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2007/07/apache-compile-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 (very) Basic Tips for PHP Web Application Security</title>
		<link>http://www.rustyrazorblade.com/2007/02/10-very-basic-tips-for-php-web-application-security/</link>
		<comments>http://www.rustyrazorblade.com/2007/02/10-very-basic-tips-for-php-web-application-security/#comments</comments>
		<pubDate>Fri, 23 Feb 2007 07:37:56 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2007/02/23/10-very-basic-tips-for-php-web-application-security/</guid>
		<description><![CDATA[<p> Barebones list for the things you should be looking for when developing a web app in PHP. Some of it applies to all web apps, not just PHP. </p> Use HTML_Safe (or a similar javascript stripping library) to check for and remove javascript when you&#8217;re accepting data that will be output to a page. [...]]]></description>
			<content:encoded><![CDATA[<p>
Barebones list for the things you should be looking for when developing a web app in PHP.  Some of it applies to all web apps, not just PHP.
</p>
<ol>
<li>Use HTML_Safe (or a similar javascript stripping library) to check for and remove javascript when you&#8217;re accepting data that will be output to a page.</li>
<li>Check every get and post variable for validity.</li>
<p>Every web site has url like &#8220;dosomething.php?id=3&#8243;.  Make sure that id you&#8217;re accepting is actually a number (or whatever type you&#8217;re allowing).</p>
<li>Escape strings before sending to the database.  Not doing so leaves you wide open to SQL injection.</li>
<li>Make sure display_errors, magic_quotes, and register globals are all off.  Log the errors to the error_log instead.</li>
<li>If you have root access, don&#8217;t fall to far behind in stable releases.  Bugs are fixed all the time.</li>
<li>Do not blindly send mail to the address entered in a form. It&#8217;s easy for someone to perform header injection and spam thousands of people before you&#8217;ll even notice.  Do not under any circumstances use Jack&#8217;s formmail.  Your IP will get banned by major mail servers.</li>
<li>Use a firewall/iptables.  Turn off all ports you aren&#8217;t using. </li>
<li>Do not write any sensitive data to a cookie.  I thought this was obvious but I&#8217;ve seen it enough where I throw it in the list.</li>
<li>Don&#8217;t put senstive directories in robots.txt as your only security.  Password protect your admin areas.</li>
<li>Back up your stuff offsite.  Have the offsite computer connect to the server to download the backup, not the other way around.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2007/02/10-very-basic-tips-for-php-web-application-security/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What caused that load spike?</title>
		<link>http://www.rustyrazorblade.com/2007/02/what-caused-that-load-spike/</link>
		<comments>http://www.rustyrazorblade.com/2007/02/what-caused-that-load-spike/#comments</comments>
		<pubDate>Tue, 13 Feb 2007 20:48:36 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2007/02/13/what-caused-that-load-spike/</guid>
		<description><![CDATA[<p>Every now and then, we find that we will have a sudden increase in the number of apache processes, load average will spike up, and then go back down to normal. In rare cases, we will see the same thing happen, and the load avg spike WAY up, all queries appear locked up, and the [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then, we find that we will have a sudden increase in the number of apache processes, load average will spike up, and then go back down to normal.  In rare cases, we will see the same thing happen, and the load avg spike WAY up, all queries appear locked up, and the server must be rebooted.  I am looking for ways of determining what caused this.  I should note that it happens extremely rarely, and has never shown up in a load test.  </p>
<p>On the MySQL end, I use show processlist to try to figure out what&#8217;s causing the issue.  However, sometimes there&#8217;s just 150 queries in there doing nothing (occasionally just selects).  I&#8217;m guessing it&#8217;s either a locking issue or perhaps it&#8217;s an issue with to much disk access causing the problem. </p>
<p>On the web server end, it&#8217;s a little more difficult.  Ideally I&#8217;d like to know what url was originally called to create the  hung apache process &#8211; does anyone know how to figure this out?  Running on Fedora Core release 5 (Bordeaux).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2007/02/what-caused-that-load-spike/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pretty URLs using Multiviews</title>
		<link>http://www.rustyrazorblade.com/2006/10/nice-urls-using-multiviews/</link>
		<comments>http://www.rustyrazorblade.com/2006/10/nice-urls-using-multiviews/#comments</comments>
		<pubDate>Thu, 12 Oct 2006 06:03:10 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2006/10/12/nice-urls-using-multiviews/</guid>
		<description><![CDATA[<p>I saw a post on digg.com about how it&#8217;s nice to have &#8220;pretty urls&#8221; that are easy to tell people. While i&#8217;m not sure anyone would remember rustyrazorblade.com slash some ridiculous post name, it&#8217;s nice to have for search engines. Unfortunately, it didn&#8217;t really go into detail about how to accomplish the urls. A lot [...]]]></description>
			<content:encoded><![CDATA[<p>I saw a post on digg.com about how it&#8217;s nice to have &#8220;pretty urls&#8221; that are easy to tell people.  While i&#8217;m not sure anyone would remember rustyrazorblade.com slash some ridiculous post name, it&#8217;s nice to have for search engines.  Unfortunately, it didn&#8217;t really go into detail about how to accomplish the urls.  A lot of people suggested mod_rewrite.  Yes, it&#8217;s something you can use, but kind of a pain to set up.</p>
<p>A good alternative to mod_rewrite is to use Multiviews.  Multiviews are specified in a per-directory basis, and have to be set explicitly.<br />
<code>
<pre style='font-size:12px'>
&lt;Directory /path/to/your/stuff&gt;
Options  Multiviews
&lt;/Directory&gt;
</pre>
<p></code><br />
You can then use this function to make it useful:<br />
<code>
<pre style='font-size:12px'>
function assign_get_vars()
{
	$args = func_get_args();
	$path_info = $_SERVER['PATH_INFO'];
	$p = explode("/", substr($path_info,1) );

	// assign the vars
	$total = count($args);
	for($i=0; $i < $total; $i++)
	{
		$name = $args[$i];
		$_GET[$name] = $p[$i];
		$_REQUEST[$name] = $p[$i];
	}
}
</pre>
<p></code><br />
Example:<br />
Say you have this page:  /forums/view.php<br />
You can call it like this: /forums/view/444/2</p>
<p>In your PHP script, add this to the top:<br />
<code>
<pre style='font-size:12px'>assign('thread','page');</pre>
<p></code></p>
<p>You can now refer to $_GET['thread'] and $_GET['page'] as if they were set by the server.</p>
<p>A benefit of Multiviews is that it lets you drop the file extension.</p>
<p>Hope this is of some use to someone.  Comments are welcome and encouraged.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2006/10/nice-urls-using-multiviews/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

