<?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>threeeighthsspacer.com &#187; precondition failed</title>
	<atom:link href="http://threeeighthsspacer.com/blog/tag/precondition-failed/feed/" rel="self" type="application/rss+xml" />
	<link>http://threeeighthsspacer.com/blog</link>
	<description>Cryptic Writings on the Tubes</description>
	<lastBuildDate>Sat, 12 Jun 2010 15:33:39 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MAD_SECURITY &#8211; &#8220;precondition failed&#8221; error on Wordpress post action</title>
		<link>http://threeeighthsspacer.com/blog/2008/05/26/mad_security/</link>
		<comments>http://threeeighthsspacer.com/blog/2008/05/26/mad_security/#comments</comments>
		<pubDate>Mon, 26 May 2008 21:56:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[mod security]]></category>
		<category><![CDATA[precondition failed]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://threeeighthsspacer.com/blog/?p=15</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>   May 26, 2008 &#8212; Until I &#8220;fixed&#8221; this problem, on this Wordpress 2.5.1 blog hosted on textdrive, If I typed &#8220;FTP&#8221; and &#8220;server&#8221; in the main text field of the &#8220;New Post&#8221; page, and then published or saved my post, I got &#8220;Precondition Failed&#8221; </p>
<p>Try this on your wordpress blog.<br />
Make a new post.<br />
Type anything in the title field.<br />
Type the words<br />
&#8220;FTP&#8221; and &#8220;server&#8221; in the main text field you can type any other content too, but put those two words together and you will not be able to save your post. (edit: It appears that the only word  that I really had trouble was &#8220;FTP &#8221; &#8211; with the space after and without the quotes. I have heard of people having problems with words commonly found in porn spam and also some seemingly-innoccuous words such as &#8220;picture&#8221;)<br />
Try to publish your test post.<br />
Do you get the &#8220;Precondition Failed&#8221; error?</p>
<pre>
Precondition Failed

The precondition on the request for the URL /blog/wp-admin/post.php evaluated to false.
</pre>
<p>Update &#8211; I think it&#8217;s mod_security that causes that message.  See<br />
<a href="http://wordpress.org/support/topic/130554"> this Wordpress Support Page</a><br />
Also see <a href="http://help.joyent.com/index.php?pg=kb.page&#038;id=85">this Joyent help page</a><br />
I tried creating a .htaccess file in my public_html directory using the rules suggested there. According to that, you can disable MOD_SECURITY with the following in your .htaccess file:<br />
<code>SecFilterEngine Off</code><br />
This made it so that at one point I was able to post the word &#8220;FTP&#8221; alone in a post, which was impossible before. However, I didn&#8217;t want to completely disable MOD_SECURITY if I didn&#8217;t have to, so,<br />
I tried this in my .htaccess instead, as Joyent suggested at the url above:<br />
<code><br />
SecFilterEngine On<br />
SecFilterSelective "REQUEST_URI" "/blog/wp-admin/post.php" "allow,nolog"<br />
SecFilterSelective "POST_PAYLOAD" "FTP ,FTP,SSH ,SSH" "allow,nolog"<br />
</code><br />
(<em>Note that the above code consists of three lines, and the lines begin with SecFilt&#8230;. I will have to make a few adjustments to the theme CSS to make my blog wider </em>. . .)<br />
And that one worked! I don&#8217;t think I need the post.php entry so I may remove that line. Anyway it worked.<br />
 I am told that MOD_SECURITY is used for spam filtering, and there are many recommendations to disable mod_security as a workaround for this type of problem.  However I don&#8217;t know. I am rather experimenting here. I&#8217;m glad I didn&#8217;t have to completely disable it.<br />
   I&#8217;m tempted to think that overall rules (on my server) are too strict or need tweaking. Or that I need to make a custom filter of my own. However, one would think that one could blog the word &#8220;FTP&#8221; server without having to rewrite apache rules. When the 3rd and 5th blog posts I made failed, I started thinking &#8220;What&#8217;s the use? I got me a blog that I can&#8217;t post on!&#8221;<br />
   So here are some suggestions for some rules to put in your .htaccess file so that MOD_SECURITY will be generally functional, and allow apache to allow posts about FTP SSH, etc&#8230;<br />
   Status: MOD_SECURITY enabled. Blog works. All good.<br />
   To implement this solution on your own blog, edit (or create, if it doesn&#8217;t exist) a file called .htaccess in the web root of your blog and add the above code to it.  .htaccess files define per-directory rules for the apache web server. The .htaccess file which I added to fix my blog is in the folder which contains my Wordpress folder. I think that if you put the file in your actual blog folder it will work as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://threeeighthsspacer.com/blog/2008/05/26/mad_security/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
