<?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>Tiffany B. Brown &#187; Server management</title>
	<atom:link href="http://tiffanybbrown.com/category/server-management/feed/" rel="self" type="application/rss+xml" />
	<link>http://tiffanybbrown.com</link>
	<description>A web log about web development and internet culture with frequent detours into other stuff.</description>
	<lastBuildDate>Wed, 23 May 2012 16:23:51 +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>HTML5 for AS3 Developers: cross-domain.xml and Cross-Origin Resource Sharing</title>
		<link>http://tiffanybbrown.com/2011/10/10/html5-for-as3-developers-cross-domain-xml-and-cross-origin-resource-sharing/</link>
		<comments>http://tiffanybbrown.com/2011/10/10/html5-for-as3-developers-cross-domain-xml-and-cross-origin-resource-sharing/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 10:00:47 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[ActionScript, Flash & Flex]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server management]]></category>
		<category><![CDATA[cors]]></category>
		<category><![CDATA[html5foras3devs]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=6226</guid>
		<description><![CDATA[This is the second post in an occasional series designed to bridge the gap between ActionScript 3.0 and emerging front-end technologies. Flash, like JavaScript, more-or-less adheres to a same-origin policy by default. Under a same-origin policy, requests for data must come from the same scheme, hostname, and port. If http://foo.example tries to request data from [...]]]></description>
			<content:encoded><![CDATA[<p class="editors-note">This is the <a href="http://tiffanybbrown.com/tag/html5foras3devs">second post</a> in an occasional series designed to bridge the gap between ActionScript 3.0 and emerging front-end technologies.</p>
<p>Flash, like JavaScript, more-or-less adheres to a <a href="http://www.w3.org/Security/wiki/Same_Origin_Policy">same-origin</a> policy by default. Under a same-origin policy, requests for data must come from the same scheme, hostname, and port. If <code>http://foo.example</code> tries to request data from <code>http://bar.example</code>, the request will usually fail.</p>
<p>Same-origin policies are designed to prevent the unauthorized leakage of data to a third-party server. Without it, a script or SWF hosted on <code>http://mightbeevil.foo</code> could read data hosted on <code>http://goodsite.foo</code> and send it to <code>http://muhahahaevilsite.foo</code>. This kind of cross-domain activity could be used to exploit cookie and authentication data. It&#8217;s clearly a bad thing.</p>
<p>Recent browsers have safeguarded against these kinds of cross-site scripting exploits by <a href="https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript">preventing</a> JavaScript from making cross-origin requests. <code>XMLHttpRequest</code>, for example, will throw a security exception if you attempt a cross-origin request.</p>
<p>Flash, meanwhile has long supported a means for enabling cross-origin requests: the <a href="https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html">policy file</a>. The policy file is a way of white-listing requests for data or credentials from specific origins. It lives on the server from which you are requesting data, and gives the Flash player a &#8220;yay&#8221; or &#8220;nay&#8221; when asked whether the request from a specific origin should be allowed to complete.</p>
<p>Cross-origin restrictions, though necessary, are also quite limiting.  You can&#8217;t (or <em>couldn&#8217;t</em>), for example, request data for a mash-up using <code>XMLHttpRequest</code>. Though there are workarounds &#8212; using dynamic script insertion, or using the <a href="https://developer.mozilla.org/en/DOM/document.domain"><code>document.domain</code></a> &#8212; those workarounds also leave the DOM vulnerable to cross-site scripting. </p>
<p>To to mitigate the dangers of cross-site scripting while still enabling it, the W3C is developing the <a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a> (CORS) specification. It functions similarly to Flash&#8217;s cross-domain policy file, but uses HTTP headers instead of an XML configuration file. </p>
<p>CORS request headers are automatically generated by conforming browsers when a script attempts a cross-domain request. Response headers must be set in the server&#8217;s configuration file, or dynamically per URL using a server-side language.</p>
<p>Let&#8217;s compare a sample cross-domain.xml file to how we&#8217;d achieve the same thing using CORS.</p>
<h2>Cross-origin requests from Flash</h2>
<p>To use the domains from our example above, if <code>http://mightbeevil.foo</code> made a request to data hosted on <code>http://goodsite.foo</code>, <code>http://goodsite.foo</code> would need to permit the request by including mightbeevil.foo it in its policy file. For example:</p>
<pre>
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!DOCTYPE cross-domain-policy SYSTEM &quot;http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd&quot;&gt;
&lt;cross-domain-policy&gt;
    &lt;allow-access-from domain=&quot;mightbeevil.foo&quot;/&gt;
&lt;/cross-domain-policy&gt;</pre>
<p>This file must be stored in the web root of <code>http://goodsite.foo</code>. It explicitly permits mightbeevil.foo &#8212; and permits only mightbeevil.foo &#8212; to make requests for its data (from within a Flash movie). </p>
<h2>Cross-origin requests from the DOM</h2>
<p>To reuse our example from above, let&#8217;s use <a href="http://www.w3.org/TR/XMLHttpRequest2/"><code>XMLHttpRequest</code></a> to make a request from <code>http://mightbeevil.foo</code> to <code>http://goodsite.foo</code>.</p>
<pre>
var xhr, onLoadHandler 

onLoadHandler = function(event){
     alert('It is done!');
}

xhr = new XMLHttpRequest();
xhr.open('GET','http://goodsite.foo/data.json');
xhr.onload = onLoadHandler;
xhr.send(null);
</pre>
<p>It looks just like a regular XHR request, except for the fact that we&#8217;re requesting data from another origin. Let&#8217;s take a look at our headers.</p>
<pre>Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Encoding:gzip, deflate
Accept-Language:en-us,en;q=0.5
Connection:keep-alive
Host:goodsite.foo
Origin:http://mightbeevil.foo
Referer:http://mightbeevil.foo/make_cross_domain_request/
User-Agent: Awesome/9.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0) FantasticEngine/8889876 Awesome Browser/9.0</pre>
<p>Notice that our headers include <code>Origin:http://mightbeevil.foo</code>. </p>
<p>Goodsite.foo responds with the following headers.</p>
<pre>Access-Control-Allow-Origin:http://mightbeevil.foo
Connection:Keep-Alive
Content-Length:1349
Content-Type:application/json
Date:Mon, 26 Sep 2011 04:44:50 GMT
Keep-Alive:timeout=5, max=100
Server:Apache/2.2.20</pre>
<p>Here we see that an <code>Access-Control-Allow-Origin</code> response header is returned by the server. Like <code>allow-access-from</code>, it indicates which domain(s) are allowed to make requests. Here, we want to know whether <code>mightbeevil.foo</code> is allowed to request data. It is, so the request will be completed. </p>
<p>Acceptable values for <code>Access-Control-Allow-Origin</code> include an origin (scheme + host + port), a comma-separated list of origins&dagger;, or a wildcard (*). As with cross-domain.xml, if the value of <code>Access-Control-Allow-Origin</code> had instead been <code>http://notevil.foo</code>, the request would have failed. Using a wildcard allows requests from <em>any</em> domain.</p>
<p>Of course, both specifications are more complex than what I have covered here. These examples illustrate how to enable a basic cross-origin request. It is also possible with both CORS and Flash to permit or exclude custom headers. And in the case of CORS, it is possible to use methods such as <code>PUT</code> or <code>DELETE</code> if the user agent supports it.</p>
<table class="browsersupport">
<caption>Browser support for Cross-Origin Resource Sharing as of 10 January 2012</caption>
<tr>
<th>Opera</th>
<th>Opera Mini</th>
<th>Opera Mobile</th>
<th>IE</th>
<th>Firefox</th>
<th>Chrome</th>
<th>Safari</th>
<th>iOS Safari</th>
<th>Android WebKit</th>
</tr>
<tr>
<td class="yes center">11.60+</td>
<td class="no center mobile">no</td>
<td class="no center mobile">no</td>
<td class="yes center">8.0+</td>
<td class="yes center">4.0+</td>
<td class="yes center">5.0+</td>
<td class="yes center">4.0+</td>
<td class="yes center mobile">3.2+</td>
<td class="yes center mobile">2.1+</td>
</tr>
</table>
<h2>Learn more</h2>
<ul>
<li><a href="https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html">Flash cross-domain policy file specification</a></li>
<li><a href="http://www.w3.org/TR/cors/">Cross-origin Resource Sharing</a></li>
<li><a href="http://www.w3.org/TR/XMLHttpRequest2/">XMLHttpRequest Level 2</a></li>
</ul>
<p class="footnote">&dagger; Most browsers do not yet support multiple origin values. The specification is also a working draft, and subject to change.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2011/10/10/html5-for-as3-developers-cross-domain-xml-and-cross-origin-resource-sharing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On the limits of free speech</title>
		<link>http://tiffanybbrown.com/2010/12/29/on-the-limits-of-free-speech/</link>
		<comments>http://tiffanybbrown.com/2010/12/29/on-the-limits-of-free-speech/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 20:38:43 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Server management]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[corporate overlords]]></category>
		<category><![CDATA[free speech]]></category>
		<category><![CDATA[wikileaks]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/?p=5480</guid>
		<description><![CDATA[Winer&#8217;s explanation is purely speculative, and some might call it a conspiracy theory. But it points to a big issue for free speech in the cloud: what happens if one, smaller customer criticizes a bigger customer? In the Web 1.0 era, if you got kicked off a Web host you just found another. Today, the [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Winer&#8217;s explanation is purely speculative, and some might call it a conspiracy theory. But it points to a big issue for free speech in the cloud: what happens if one, smaller customer criticizes a bigger customer? In the Web 1.0 era, if you got kicked off a Web host you just found another. Today, the number of providers like AWS are small. As AWS&#8217;s promotion material points out, cloud computing gives smaller outfits the ability to take advantage of high-performance computing.</p></blockquote>
<p>So are Amazon and Apple jeopardizing small(er)-fry companies to keep their lucrative Federal contracts? What does such action mean for customers of all sizes?  That&#8217;s what Klint Finley asks in <i class="website title">Read/Write Web</i>&#8217;s <a href="http://www.readwriteweb.com/cloud/2010/12/amazon-web-services-wikileaks.php">Amazon Web Services, WikiLeaks and the Elephant in the Room</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2010/12/29/on-the-limits-of-free-speech/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Amazon S3 for hard drive backups</title>
		<link>http://tiffanybbrown.com/2007/09/17/amazon-s3-service/</link>
		<comments>http://tiffanybbrown.com/2007/09/17/amazon-s3-service/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 15:30:52 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Gadgets & Personal Tech]]></category>
		<category><![CDATA[Internet life]]></category>
		<category><![CDATA[Server management]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/2007/09/17/amazon-s3-service/</guid>
		<description><![CDATA[After reading Baratunde&#8216;s heart-wrenching post about losing an entire terabyte of data, including recordings of his late mother, I decided it was time for me to investigate some backup solutions. I half-assedly make DVD backups of my blog data and important files. But that stuff changes so frequently that a DVD system is really inadequate. [...]]]></description>
			<content:encoded><![CDATA[<p>After reading <strong>Baratunde</strong>&#8216;s heart-wrenching post about losing an <a href="http://baratunde.com/blog/archives/2007/09/please_backup_your_hard_drive_now_twice.html">entire terabyte of data</a>, including recordings of his late mother, I decided it was time for me to investigate some backup solutions.</p>
<p>I half-assedly make <strong>DVD backups</strong> of my blog data and important files. But that stuff changes so frequently that a DVD system is really inadequate. An <strong>external hard drive</strong> is great for on-site backups, but hard drives and DVDs are subject to the <strong>same vulnerabilities</strong>. What do I do if: </p>
<ol>
<li>the hard drive fails or the DVD gets scratched?</li>
<li>the hard drive gets lost or stolen?</li>
<li>the hard drive or DVD gets destroyed in a fire?</li>
<li>I do some dumb sh*t like accidentally knock over a glass of wine onto the hard drive.</li>
</ol>
<p>Yeah, an <strong>external storage solution</strong> is <em>so</em> the right idea.<br />
<span id="more-1154"></span></p>
<p>Enter <a href="http://www.amazon.com/S3-AWS-home-page-Money/b/ref=sc_fe_l_2/103-2058348-5251053?ie=UTF8&#038;node=16427261&#038;no=342430011&#038;me=A36L942TSJ2AJA">Amazon.com&#8217;s Simple Storage Service</a>, part of the company&#8217;s web services offerings. Until recently, the program was only useful for developers. S3 uses <a href="http://en.wikipedia.org/wiki/REST">REST</a> and <a href="http://en.wikipedia.org/wiki/SOAP">SOAP</a> to send and retrieve data. If you didn&#8217;t know what to do with either of those, good luck taking advantage of the service.</p>
<p>Since S3&#8242;s launch, however, a few companies and developers have created <strong>easy-to-use interfaces</strong> for interacting with S3. Now just about anyone can take advantage of S3 to store data.</p>
<p>Why would you do such a thing? Three words: <strong>S3 is cheap.</strong> You can <a href="http://calculator.s3.amazonaws.com/calc5.html">calculate</a> just how cheap. Simply <strong>pay for what you use.</strong> And unlike with most online backup services, you have the added ability to <strong>manipulate your data</strong> using standard protocols. There&#8217;s some serious media serving potential there, particularly if coupled with Amazon&#8217;s <a href="http://aws.amazon.com/ec2">Elastic Compute Cloud</a>.</p>
<p>For storing and retrieving data you have quite a few options. Here are four of my picks:</p>
<h3><a href="http://www.jungledisk.com/">JungleDisk</a></h3>
<ul>
<li>Operating system(s): Mac, Windows, Linux</li>
<li>Cost: $20; unlimited installations</li>
<li>Basics: Mounts like a disk drive, allowing you to easily upload and download files.</li>
</ul>
<h3><a href="http://www.maluke.com/s3man/">S3 Backup</a> (Beta version)</h3>
<ul>
<li>Operating system(s): Windows </li>
<li>Cost: Free for now. Beta versions have set expiry dates.</li>
<li>Basics: Easy-to-use upload/download utility. Interface operates much like any other FTP software.</li>
</ul>
<h3><a href="http://www.panic.com/transmit/">Transmit 3.6</a></h3>
<ul>
<li>Operating system(s): Mac OS X</li>
<li>Cost: $29.95</li>
<li>Basics: Fabulous FTP software for Mac with support for S3 in the same familiar Transmit interface.</li>
</ul>
<h3><a href="https://addons.mozilla.org/en-US/firefox/addon/3247">Amazon S3 Firefox Organizer (S3Fox)</a></h3>
<ul>
<li>Operating system(s):  Mac OS X, Windows, Linux &#8212; any platform that can run Firefox</li>
<li>Cost: Free(-ish; Don&#8217;t be a freeloadin&#8217; jacka**. Make a donation)</li>
<li>Basics: A Firefox extension with an interface similar to <a href="https://addons.mozilla.org/en-US/firefox/addon/684">FireFTP</a>. It functions in much the same way.</li>
</ul>
<p><ins datetime="2007-09-17T15:47:42+00:00">Do you use S3? What tools have you used to store and retrieve data? Do  you prefer another online storage service? Make your case in the comments.</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2007/09/17/amazon-s3-service/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Creating a faux directory structure using mod_rewrite and switch()</title>
		<link>http://tiffanybbrown.com/2005/09/15/creating_a_faux_directory_structure_using_mod_rewrite_and_switch/</link>
		<comments>http://tiffanybbrown.com/2005/09/15/creating_a_faux_directory_structure_using_mod_rewrite_and_switch/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server management]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/2005/09/15/creating_a_faux_directory_structure_using_mod_rewrite_and_switch</guid>
		<description><![CDATA[The below example is just one way to create a faux directory structure using the magic of Apache&#8217;s mod_rewrite and the PHP switch statement. Sample re-write rules using mod_rewrite. These would be included in your .htaccess file for the directory whose URLs you wish to rewrite. More exacting patterns / rewrite rules are possible. RewriteEngine [...]]]></description>
			<content:encoded><![CDATA[<p>The below example is just one way to create a faux directory structure using the magic of Apache&#8217;s <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">mod_rewrite</a> and the <abbr class="say">PHP</abbr> <a href="http://www.php.net/switch">switch</a> statement.</p>
<p>Sample re-write rules using mod_rewrite. These would be included in your .htaccess file for the directory whose <abbr class="say">URL</abbr>s you wish to rewrite. More exacting patterns / rewrite rules are possible.</p>
<pre>
RewriteEngine On
RewriteBase /

RewriteRule ^requested_directory$ index.php?page=$0
RewriteRule ^requested_directory/$ index.php?page=$0
RewriteRule ^requested_directory/.*$ index.php?page=$0
</pre>
<p>Above: ^ starts the beginning of the pattern. $ designates the end of a pattern line. A period indicates &#8216;any single character.&#8217; the * means &#8216;0 or N of the preceding text&#8217; (where N is greater than 0).</p>
<p>The stuff after the $ is the replacement request. In this case, we are saying &#8220;When requested_directory is requested, get index.php instead.&#8221; And when we get index.php, we&#8217;re going to pass the requested file/directory as the value for the variable &#8216;page&#8217;. The requested file is the value of $0. It&#8217;s a recursive variable. Mod_rewrite rules adhere to <a href="http://sitescooper.org/tao_regexps.html">regular</a> <a href="http://etext.lib.virginia.edu/services/helpsheets/unix/regex.html">expression</a> syntax.</p>
<p>A request for http://www.foo.com/requested_directory/bar would be re-written to<br />
http://www.foo.com/index.php?page=requested_directory/bar. Once the <abbr class="say">URL</abbr> is rewritten, you can parse it like any other. Here, we&#8217;re going to require certain content files based on the value of <code>$_GET['page']</code> using switch.</p>
<pre>
&lt;?php

switch($_GET['page']){
   case 'requested_directory':
   require('../../req_dir_content.inc');
   break;

   case 'requested_directory/bar';
   require('../../bar_content.inc');
   break;

   default:
   require('../../default_content.inc');
}
?&gt;
</pre>
<h3>More information</h3>
<ul>
<li><a href="http://httpd.apache.org/docs/1.3/misc/rewriteguide.html">Apache 1.3<br />
URL Rewriting Guide</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2005/09/15/creating_a_faux_directory_structure_using_mod_rewrite_and_switch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix/Linux tip: Listing files with a wild card</title>
		<link>http://tiffanybbrown.com/2005/09/08/unixlinux_tip_listing_files_with_a_wild_card/</link>
		<comments>http://tiffanybbrown.com/2005/09/08/unixlinux_tip_listing_files_with_a_wild_card/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Server management]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/2005/09/08/unixlinux_tip_listing_files_with_a_wild_card</guid>
		<description><![CDATA[Say you want to view all files in a directory that start with foo. Simple, just type &#62; ls foo* That will return all files that begin with foo, including foo.php, foo_bar.php and foot.php. Want to check the permissions on those files too? Type: &#62; ls -l foo*]]></description>
			<content:encoded><![CDATA[<p>Say you want to view all files in a directory that start with foo.</p>
<p>Simple, just type</p>
<pre>&gt; ls foo*</pre>
<p>That will return all files that begin with foo, including foo.php,<br />
foo_bar.php and foot.php.</p>
<p>Want to check the permissions on those files too? Type:</p>
<pre>&gt; ls -l foo*</pre>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2005/09/08/unixlinux_tip_listing_files_with_a_wild_card/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Never, EVER, neverever in life &#8230;</title>
		<link>http://tiffanybbrown.com/2005/08/17/never_ever_neverever_in_life/</link>
		<comments>http://tiffanybbrown.com/2005/08/17/never_ever_neverever_in_life/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server management]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/2005/08/17/never_ever_neverever_in_life</guid>
		<description><![CDATA[&#8230; should you include put a file with your database passwords in your web document root and give it an .inc extenstion. I ran across an example of this today and it&#8217;s just a really bad practice. These files are web-readable, and by saving it as an .inc file, you are exposing your data to [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; should you include put a file with your database passwords in your web document root and give it an .inc extenstion.</p>
<p>I ran across an example of this today and it&#8217;s just a really <span class="b">bad</span> practice. These files are web-readable, and by saving it as an .inc file, you are exposing your data to whoever stumbles across &#8216;db.inc&#8217; or &#8216;globals.inc&#8217;. </p>
<p>If you <em>must</em> save files in your document root, save them with a .php extension (.php files are better,  but at least one developer <a href="http://shiflett.org/archive/110">argues not by much</a>.)</p>
<p><ins datetime="2005-08-25T20:04"><br />
<span class="b">UPDATE:</span> <a href="http://www.benramsey.com">Ben Ramsey</a> fills me in on the reasoning behind Chris Shiflett&#8217;s mandate.</p>
<p>There is a twofold reason Chris says that storing PHP includes within the Web root is not a good practice (there may be more than two reasons, but there are two that I know of):</p>
<blockquote>
<ol>
<li>your PHP scripts should never be accessed out of context, and leaving an include file within the Web root allows users to execute it out of context, potentially doing things you didn&#8217;t intend them to do, and</li>
<li>on the off-chance that the server crashes and reboots &#8212; but Apache doesn&#8217;t quite load PHP successfully &#8212; and it takes 30 minutes to an hour or more to get your hosting company to fix it, then all of your PHP files will be readable to the public as plain text, exposing your code and any passwords contained therein.</li>
</ol>
<p>Both reasons are enough to convince me to place only those files that need to be accessed directly by the client in the Web root and all others above it.
</p></blockquote>
<p>Sound advice.<br />
</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2005/08/17/never_ever_neverever_in_life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Now with (validated!) RSS!</title>
		<link>http://tiffanybbrown.com/2004/05/27/now_with_validated_rss/</link>
		<comments>http://tiffanybbrown.com/2004/05/27/now_with_validated_rss/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server management]]></category>
		<category><![CDATA[XML (including RSS and Atom)]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/2004/05/27/now_with_validated_rss</guid>
		<description><![CDATA[I&#8217;ve been meaning to create an RSS feed for my site for quite some time now. Today, I jumped in and did it. I confess I cheated a bit by hijacking the basic code from a Search Engine Watch article on creating RSS feeds. But I still had to figure out how to automate the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to create an <abbr title="Really Simple Syndication">RSS</abbr> feed for my site for quite some time now. Today, I jumped in and did it.</p>
<p>I confess I cheated a bit by hijacking the basic code from a Search Engine Watch article on <a href="http://searchenginewatch.com/sereport/article.php/2175271">creating <abbr title="Really Simple Syndication">RSS</abbr> feeds</a>.</p>
<p>But I still had to figure out how to automate the updating of the feed. Enter my old friend <a href="http://www.php.net/"><abbr title="hypertext pre processor">PHP</abbr></a> and the magic Apache directive <a href="http://httpd.apache.org/docs/mod/mod_mime.html#addtype">AddType</a>.</p>
<p>I created a new directory (feeds), then created an .htaccess file in that directory with the following line: <code>AddType application/x-httpd-php .xml</code>. That lets the server know to parse X M L files in that directory as <abbr title="hypertext pre processor">PHP</abbr></a> files.</p>
<p>A few database calls later, and I&#8217;ve got a dynamically-generated <a href="/feeds/site.xml"><abbr title="Really Simple Syndication">RSS</abbr> feed</a> available for your pleasure. </p>
<p>You will need an aggregator, however. If you&#8217;re on a Windows box with <a href="http://www.mozilla.org/">Mozilla</a> installed, I&#8217;d like to suggest <a href="http://www.newsmonster.org/">Newsmonster</a>. You&#8217;ll also need the <a href="http://java.com/en/index.jsp">latest version of Java</a>. </p>
<p>Or try a service like <a href="http://kinja.com/">Kinja</a></p>
<p><ins datetime="2004-05-28"><span style="font-weight:bold;">UPDATE:</span> Now your browser will recognize it as an <abbr title="eXtensible Markup Language">XML</abbr> document, and your news reader will recognize it as a valid <abbr title="Really Simple Syndication">RSS</abbr> feed. I had to modify the code a smidge, adding <code>header("Content-type: text/xml");</code> to the script, stripping out <abbr title="Hypertext Markup Language">HTML</abbr> tags, and converting special characters.</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2004/05/27/now_with_validated_rss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X H T M L and MIME types</title>
		<link>http://tiffanybbrown.com/2003/09/14/x_h_t_m_l_and_mime_types/</link>
		<comments>http://tiffanybbrown.com/2003/09/14/x_h_t_m_l_and_mime_types/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[(x)HTML]]></category>
		<category><![CDATA[Server management]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/2003/09/14/x_h_t_m_l_and_mime_types</guid>
		<description><![CDATA[For the nerd in you, here&#8217;s an article on which MIME type you should use when serving XHTML pages. MIME types are an interesting thing. They determine what types of content a server or mail application can handle. The problem with using an XHTML MIME type is that most browsers do not support the type. [...]]]></description>
			<content:encoded><![CDATA[<p>For the nerd in you, here&#8217;s an article on which <a href="http://www.webstandards.org/learn/askw3c/sep2003.html">MIME type</a> you should use when serving <abbr title="=eXtensible Hyper Text Markup Language">X<acronym title="Hypertext Markup Language">HTML</acronym></abbr> pages.</p>
<p>MIME types are an interesting thing. They determine what <a href="http://archive.ncsa.uiuc.edu/SDG/Software/XMosaic/rfc1521.txt">types of content</a> a server or mail application can handle.</p>
<p>The problem with using an <abbr title="=eXtensible Hyper Text Markup Language">X<acronym title="Hypertext Markup Language">HTML</acronym></abbr> MIME type is that most browsers do not support the type. Not surprising since there&#8217;s usually a few years&#8217; lag between what the World Wide Web Consortium says and what the browsers do. The good news is that <abbr title="=eXtensible Hyper Text Markup Language">X<acronym title="Hypertext Markup Language">HTML</acronym></abbr> has backward-compatibility built in.</p>
<p>For more information about X<acronym title="Hypertext Markup Language">HTML</acronym> and MIME types, you can also read Mark Pilgrim&#8217;s article &quot;<a href="http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html">The Road to X<acronym title="Hypertext Markup Language">HTML</acronym> 2.0: MIME Types</a>&quot;</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2003/09/14/x_h_t_m_l_and_mime_types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to stop (most) search engine crawlers</title>
		<link>http://tiffanybbrown.com/2003/08/23/how_to_stop_most_search_engine_crawlers/</link>
		<comments>http://tiffanybbrown.com/2003/08/23/how_to_stop_most_search_engine_crawlers/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>tiffany</dc:creator>
				<category><![CDATA[Server management]]></category>

		<guid isPermaLink="false">http://tiffanybbrown.com/2003/08/23/how_to_stop_most_search_engine_crawlers</guid>
		<description><![CDATA[Most search engines adhere to the Robots Exclusion Standards when crawling a site. If you want to stop it,you&#8217;ll need to write a proper robots.txt file. How to write one, you ask? Check out the Web Robots pages.]]></description>
			<content:encoded><![CDATA[<p>Most search engines adhere to the Robots Exclusion Standards when crawling a site. If you want to stop it,you&#8217;ll need to write a proper robots.txt file. How to write one, you ask? Check out the <a href="http://www.robotstxt.org/wc/robots.html">Web Robots</a> pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiffanybbrown.com/2003/08/23/how_to_stop_most_search_engine_crawlers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

