<?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>aaron-kelley.net &#187; WordPress</title>
	<atom:link href="http://aaron-kelley.net/blog/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://aaron-kelley.net</link>
	<description>My little corner of the Internet</description>
	<lastBuildDate>Fri, 18 May 2012 19:32:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>WordPress on Mac OS X &#8212; Server Error 500</title>
		<link>http://aaron-kelley.net/blog/2010/02/wordpress-on-mac-os-x-server-error-500/</link>
		<comments>http://aaron-kelley.net/blog/2010/02/wordpress-on-mac-os-x-server-error-500/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 22:28:04 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Mac OS X Server]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://aaron-kelley.net/?p=780</guid>
		<description><![CDATA[I ran into this problem with WordPress running on a Mac OS X server.  I suppose that this may happen on other servers running Apache as well.  Attempting to access the WordPress site threw this error at you: Server error! The server encountered an internal error and was unable to complete your request. Either the [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into this problem with WordPress running on a Mac OS X server.  I suppose that this may happen on other servers running Apache as well.  Attempting to access the WordPress site threw this error at you:</p>
<blockquote><p><tt>Server error!<br />
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.<br />
If you think this is a server error, please contact the webmaster.<br />
Error 500</tt></p></blockquote>
<p>Turned out that the <tt>.htaccess</tt> file in the root of the WordPress install had some gibberish in it.  It looks like this gibberish replaced some of the actual contents of the file.  I don&#8217;t know how it got there, but fixing the <tt>.htaccess</tt> file solved the problem.  So, that&#8217;s something to check if you are having this problem as well!</p>
]]></content:encoded>
			<wfw:commentRss>http://aaron-kelley.net/blog/2010/02/wordpress-on-mac-os-x-server-error-500/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Flash uploader fails in an SSL administrative session</title>
		<link>http://aaron-kelley.net/blog/2009/12/wordpress-flash-uploader-fails-in-an-ssl-administrative-session/</link>
		<comments>http://aaron-kelley.net/blog/2009/12/wordpress-flash-uploader-fails-in-an-ssl-administrative-session/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 22:51:27 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://aaron-kelley.net/?p=646</guid>
		<description><![CDATA[WordPress has a configuration option that you can set to force administrative sessions to happen over an SSL connection (https).  Just add define('FORCE_SSL_ADMIN', true); to your wp-config.php file and you&#8217;re set, as long as your web server supports https and it is configured properly.  Of course, this means that you must have an SSL certificate [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress has a configuration option that you can set to force administrative sessions to happen over an SSL connection (https).  Just add <tt>define('FORCE_SSL_ADMIN', true);</tt> to your <tt>wp-config.php</tt> file and you&#8217;re set, as long as your web server supports https and it is configured properly.  Of course, this means that you must have an SSL certificate for your server.</p>
<p>It turns out that if your SSL certificate is not trusted, attempts to use the Flash uploader to upload files will give you a cryptic &#8220;IO error&#8221; message.  In my case, this I was using Firefox when I first encountered this.  My SSL certificate is self-signed, and even though I added an exception for it in Firefox, the Flash uploader still fails.</p>
<p>Here&#8217;s what I learned about this problem after banging on it for a few days.</p>
<p><span id="more-646"></span>This isn&#8217;t a new problem.  There are <a href="http://core.trac.wordpress.org/ticket/9187" target="_blank">plenty</a> <a href="http://wordpress.org/support/topic/240263" target="_blank">of</a> <a href="http://en.forums.wordpress.com/topic/cant-upload-images-io-error-error-2038" target="_blank">people</a> who have noticed this behavior with WordPress before.  In fact, there are <a href="http://swfupload.org/forum/generaldiscussion/117" target="_blank">plenty</a> <a href="http://swfupload.org/forum/generaldiscussion/347" target="_blank">of</a> <a href="http://swfupload.org/forum/generaldiscussion/203" target="_blank">people</a> who have noticed this issue with SWFUpload, which is the tool that WordPress actually uses to do the Flash uploads.  Some of them point to a <a href="http://bugs.adobe.com/jira/browse/FP-201" target="_blank">bug in Adobe Flash Player</a>.  However, it&#8217;s actually because the SSL certificate on your server isn&#8217;t trusted by your operating system for some reason or another.</p>
<p>Flash doesn&#8217;t use your web browser to decide whether or not it trusts an SSL certificate.  Instead, it asks the operating system.  On Windows, you can add your self-signed certificate to the trusted root certificate store (right-click on your <tt>.crt</tt> file and choose &#8220;Install certificate,&#8221; and then make sure it ends up in that store).  This will make the certificate trusted by default in Internet Explorer, and in any other program that asks Windows if a certificate is OK.  Firefox (and other some browsers) maintain their own database of certificates and certificate authorities, but Flash will always check the central Windows list of certificates, no matter which web browser you are using.</p>
<p>(Note that Mac OS X and Linux also have a central location for trusted root certificates, so the same type of thing applies there.)</p>
<p>This is actually reasonable behavior on Flash&#8217;s part.  Firefox&#8217;s &#8220;certificate trust list&#8221; (or whatever you want to call it) isn&#8217;t available via the NAPI plug-in interface, so there&#8217;s no way for Flash to check to see if Firefox trusts a given SSL certificate.  It can, however, use the Windows API to check to see if the system trusts it.  And if an SSL certificate looks suspicious, Flash won&#8217;t send data over the https connection.  This is what causes the error.</p>
<p>So, how do we fix this problem?  There are a few possible solutions.</p>
<p>(1)  If you are using a self-signed certificate, <strong>add your certificate to your operating system&#8217;s list of trusted certificate authorities</strong>.  If you are using a certificate signed by a non-trusted authority (like <a href="http://cacert.org/" target="_blank">cacert.org</a>), add that authority to your operating system&#8217;s list of trusted certificate authorities.  Of course, this carries a small risk.  If your certificate is self-signed, and your private key were compromised, now someone would be able to fake messages that your computer would trust.  And if your certificate was signed by a non-trusted CA, now you trust all certificates signed by that CA, which may not be what you want.</p>
<p>Now, this doesn&#8217;t help you if you&#8217;re in my boat and you want to run multiple WordPress sites on one server.  You can get one of them working, but since you have to use the same SSL certificate for all of them (unless you have a unique IP address to run each of them on), any sites that don&#8217;t match the site that your certificate as for will still have the error, because the certificate won&#8217;t be trusted <em>even if you add it to the list of trusted CAs</em> if the site you are accessing doesn&#8217;t match the site in the certificate.  In this case, we need a different solution.</p>
<p>(2)  <strong>Have Flash uploads to your WordPress site not use SSL.</strong> Of course, this means that the files you are uploading won&#8217;t be encrypted during transmission, but maybe that&#8217;s OK with you.  I can think of two ways to implement this solution.  But here, I am going to begin to descend into the depths of WordPress.</p>
<p>(2a)  <strong>WordPress plug-in to disable SSL for the Flash uploader</strong>.</p>
<p>I have actually <a href="/tech/wordpress/plugin-flashssl/">completed and published</a> such a plug-in.  The file <tt>wp-admin/async-upload.php</tt> is used to accept uploads from the Flash uploader.  If the <tt>FORCE_SSL_ADMIN</tt> configuration option is set, WordPress will automatically bump you over to an https connection if you try to access this file via http.  So the first thing we need to do is keep that from happening:</p>
<ul>
<li>Add a filter to &#8216;<tt>admin_url</tt>&#8216; that removes the https from the URL to <tt>async-upload.php</tt>, whenever it is about to show up in a WordPress admin page.</li>
<li>Add a filter to &#8216;<tt>wp_redirect</tt>&#8216; so that when WordPress decides that it needs to redirect you to an https session, the redirect is canceled if you are accessing <tt>async-upload.php</tt>.</li>
<li>Modify the &#8216;<tt>auth_redirect</tt>&#8216; function so that WordPress does not bail after attempting to redirect you to https, if <tt>async-upload.php</tt> is the file you are accessing.</li>
</ul>
<p>Now, <tt>async-upload.php</tt> can be accessed without using https.  There&#8217;s another problem, though.  WordPress has two cookies that it may use to authenticate you, one of them is referred to as <tt>AUTH_COOKIE</tt> and used for regular connections, and the other one is referred to as <tt>SECURE_AUTH_COOKIE</tt> and is used for https connections.  The idea is, the <tt>SECURE_AUTH_COOKIE</tt> will never be sent in the clear, so if you force SSL connections, there is no way that someone can hijack your authentication cookie, even if they managed to grab one from back when you were using a regular connection.  (In fact, <tt>SECURE_AUTH_COOKIE</tt> is marked as for use with secure connections only, so your web browser won&#8217;t ever send it with a regular http request.)</p>
<p>Now, Flash doesn&#8217;t always send cookies properly, so WordPress packages up the authentication cookie that you are using and sends it along with the Flash upload request as a <tt>POST</tt> variable.  <tt>async-upload.php</tt> takes the cookie from the <tt>POST</tt> variable and stores it back in the <tt>COOKIE</tt> variable where it belongs.  However, since our admin session is SSL, but <tt>async-upload.php</tt> isn&#8217;t accessed via SSL, it stores the cookie that was sent in <tt>AUTH_COOKIE</tt> instead of <tt>SECURE_AUTH_COOKIE</tt>, and then it fails to authenticate you.  So, we need to&#8230;</p>
<ul>
<li>Modify the &#8216;<tt>wp_parse_auth_cookie</tt>&#8216; function so that WordPress notices the cookie in the <tt>POST</tt> variable, if you are accessing <tt>async-upload.php</tt>.</li>
</ul>
<p>(By the way, this hack sends your <tt>SECURE_AUTH_COOKIE</tt> along with the regular http request to upload your file, so&#8230; so much for never sending it in the clear.)</p>
<p>Almost done.  Now, requests to <tt>async-upload.php</tt> are made by your web browser (not Flash) to view and edit information about the uploaded files, right after the uploads are done.  Because the <tt>SECURE_AUTH_COOKIE</tt> is marked for secure connections only, your browser won&#8217;t send it along with these requests, so you won&#8217;t be able to view or edit file data right after you upload the files.  To work around this, we take the login cookie as acceptable credentials to do this.</p>
<ul>
<li>Modify the &#8216;<tt>auth_redirect</tt>&#8216; function to look for the login cookie and accept it as good authentication, if <tt>async-upload.php</tt> is the file being accessed.</li>
</ul>
<p>(This means that if someone hijacked your login cookie, they might be able to mess with your file data.)</p>
<p>So, we add a couple of obscure security holes to WordPress and the Flash uploader is working with your bad SSL certificate.  Is the tradeoff worth it?  That&#8217;s up to you.</p>
<p>Oh, but I said I could think of two ways to ditch SSL for the Flash uploader&#8230;</p>
<p>(2b)  <strong>Modify WordPress itself for a more clean workaround.</strong></p>
<p>The &#8216;<tt>auth_redirect</tt>&#8216; and &#8216;<tt>wp_parse_auth_cookie</tt>&#8216; functions mentioned above are both pluggable.  However, the functions we&#8217;d need to modify for a more clean solution are not.  How might a more clean solution work?</p>
<p>Obviously, the files you are uploading with the Flash plug-in won&#8217;t be encrypted.  However, we&#8217;d like anything else that is transmitted unencrypted to be useless in hacking into your site.  The <tt>SECURE_AUTH_COOKIE</tt> should never be sent in the clear, and the login cookie shouldn&#8217;t be sufficient credentials for messing with the data associated with your uploaded files.</p>
<p>I think the solution to this is some sort of key exchange between the application running on the server and your web browser (using PHP on the server and Javascript in the browser) to come up with a random, secret phrase that can be sent along with requests to <tt>async-upload.php</tt> as a <tt>POST</tt> or <tt>GET</tt> variable.  A challenge-response system would need to be used along with this so that the secret wouldn&#8217;t be transmitted in the same form twice (to prevent replay attacks).</p>
<p>I know this sounds a little vague, but I have an idea in my head about how it would work.  Maybe I will take a stab at implementing it and present it to the WordPress devs, if I ever get the time and motivation.</p>
<p>But it seems like an awful lot of trouble to go through just to work around this edge case.  Just fix your SSL certificate!</p>
]]></content:encoded>
			<wfw:commentRss>http://aaron-kelley.net/blog/2009/12/wordpress-flash-uploader-fails-in-an-ssl-administrative-session/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; _wp_unfiltered_html_comment causing pages to fail (X)HTML validation</title>
		<link>http://aaron-kelley.net/blog/2009/08/wordpress-_wp_unfiltered_html_comment-causing-pages-to-fail-xhtml-validation/</link>
		<comments>http://aaron-kelley.net/blog/2009/08/wordpress-_wp_unfiltered_html_comment-causing-pages-to-fail-xhtml-validation/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 05:10:46 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://aaron-kelley.net/?p=482</guid>
		<description><![CDATA[If you have a WordPress blog, and you log in, you may notice pages failing HTML or XHTML validation because of code like this: &#60;input type="hidden" id="_wp_unfiltered_html_comment" name="_wp_unfiltered_html_comment" value="xxxxxxxxxx" /&#62; This code only shows up if you are logged in, and allows your comments to bypass HTML validation, so you can use whichever HTML tags [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a WordPress blog, and you log in, you may notice pages failing HTML or XHTML validation because of code like this:</p>
<p><tt>&lt;input type="hidden" id="_wp_unfiltered_html_comment" name="_wp_unfiltered_html_comment" value="xxxxxxxxxx" /&gt;</tt></p>
<p>This code only shows up if you are logged in, and allows your comments to bypass HTML validation, so you can use whichever HTML tags you like.  What is causing the problem is the &#8220;<tt>id</tt>&#8221; attribute.  According to the XHTML standard, the ID must start with a letter, and here it starts with an underscore.</p>
<p><span id="more-482"></span>There&#8217;s some <a href="http://wordpress.org/support/topic/177476?replies=3" target="_blank">discussion of this</a> <a href="http://core.trac.wordpress.org/ticket/5120" target="_blank">over on the</a> <a href="http://core.trac.wordpress.org/ticket/6592" target="_blank">WordPress end</a>, with various opinions.  Depending on which spec you read, it might be valid XHTML.  It&#8217;s not super-critical, since no one sees the invalid code besides you.  Still, it looks like it might be fixed in WordPress 2.9.  But until then, my page is going to fail against the validator addon I have in my web browser?</p>
<p>What&#8217;s annoying is this code is not part of the WordPress theme, so you cannot fix it without modifying WordPress itself.  That&#8217;s not really acceptable, because you&#8217;d have to repeat the modification every time a new version of WordPress comes along.</p>
<p>Well, actually, you can fix it in your theme, it&#8217;s just a little tricky.  To do it, open the <tt>comments.php</tt> file in your theme, and find this line:</p>
<blockquote><p><tt>do_action('comment_form', $post-&gt;ID);</tt></p></blockquote>
<p>Replace it with this:</p>
<blockquote><p><tt>ob_start();<br />
do_action('comment_form', $post-&gt;ID);<br />
$output = ob_get_contents();<br />
ob_end_clean();</tt></p>
<p><tt>echo str_replace(' id="_wp', ' id="wp', $output);</tt></p></blockquote>
<p>This will strip the underscore from the beginning of the &#8220;<tt>id</tt>&#8221; attribute.  Because the <tt>do_action()</tt> function prints stuff out, we have to capture the output, modify it, and print it.</p>
<p>Since the underscore is still part of the &#8220;<tt>name</tt>&#8221; attribute (which does not fail validation), and the &#8220;<tt>name</tt>&#8221; attribute is used to build PHP&#8217;s <tt>$_POST</tt> array, I do not think that this modification will have any affect on WordPress&#8217;s operation &#8212; seems to work as intended when I test it.  And now my pages will validate as well.  Great!</p>
]]></content:encoded>
			<wfw:commentRss>http://aaron-kelley.net/blog/2009/08/wordpress-_wp_unfiltered_html_comment-causing-pages-to-fail-xhtml-validation/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Welcome to the new aaron-kelley.net!</title>
		<link>http://aaron-kelley.net/blog/2009/08/welcome-to-the-new-aaron-kelley-net/</link>
		<comments>http://aaron-kelley.net/blog/2009/08/welcome-to-the-new-aaron-kelley-net/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 02:00:11 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Site Updates]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://aaron-kelley.net/?p=263</guid>
		<description><![CDATA[Hello!  First post in a while. Welcome to the new aaron-kelley.net.  I&#8217;ve migrated all of my previous content to WordPress, which now powers my site.  This makes the site much easier to manage than the makeshift CMS that I had in place before.  Hopefully, now I will be able to find the time to add [...]]]></description>
			<content:encoded><![CDATA[<p>Hello!  First post in a while.</p>
<p>Welcome to the new aaron-kelley.net.  I&#8217;ve migrated all of my previous content to <a href="http://wordpress.org/" target="_blank">WordPress</a>, which now powers my site.  This makes the site much easier to manage than the makeshift CMS that I had in place before.  Hopefully, now I will be able to find the time to add some useful content.</p>
<p>There will be some changes to the appearance/theme over the next few days and weeks as everything gets settled.  However, all of the old content is now available here, and the site is completely usable.</p>
<p>WordPress is a pretty cool platform to build a web site on.  It&#8217;s really starting to take off now, too.  I&#8217;ve known about it for a long time, but some of the features that made me decide to go ahead and move only came in as of version 2.7 ot 2.8 (or, in the last 8 months).  I recommend looking into it if you are looking to build a simple site; it&#8217;s not only for running blogs, you can manage static content pages on it as well, and it is pretty easy to extend if you know any PHP.  There&#8217;s even chatter about <a href="http://wordpress.org/development/2009/07/2-9-vote-results/" target="_blank">media albums coming to WordPress</a> in the near future, so I&#8217;m hopeful that I&#8217;ll be able to move all of my content from the photo gallery into this site, just to have everything in one place.  More on this later.</p>
<p>Probably, next up will be a series of blog posts on <a href="http://www.ubuntu.com/" target="_blank">Ubuntu Linux</a> &#8212; the operating system in general, and fixes to some specific issues that I&#8217;ve come across as well as other general tips.  I&#8217;ve been collecting these since I switched to Ubuntu last November but never got around to posting them online.  How can I not, now that it is so easy for me?  I&#8217;ll also be posting whatever random useful information that I come up with &#8212; after all, my main audience is Googlers who find a page on this site while looking for something specific, and that&#8217;s how I plan to run things for a while longer.</p>
]]></content:encoded>
			<wfw:commentRss>http://aaron-kelley.net/blog/2009/08/welcome-to-the-new-aaron-kelley-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

