<?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>/dev/null &#187; Apache</title>
	<atom:link href="http://blog.alien109.com/category/development/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alien109.com</link>
	<description>development, design, and random goodness</description>
	<lastBuildDate>Fri, 10 Sep 2010 02:40:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Running PHP cron jobs on a MediaTemple DV server</title>
		<link>http://blog.alien109.com/2010/06/08/running-php-cron-jobs-on-a-mediatemple-dv-server/</link>
		<comments>http://blog.alien109.com/2010/06/08/running-php-cron-jobs-on-a-mediatemple-dv-server/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 22:24:02 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.alien109.com/?p=373</guid>
		<description><![CDATA[Recently I was attempting to create some cron jobs to run PHP scripts on a DV server or at MediaTemple, with PHP installed as an Apache module (rather than CGI). I was able to execute the php file, however all of my include and require statements were totally failing. My first idea was to set [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.alien109.com/wp-content/uploads/2010/06/Crystal_Project_alarm.png" alt="" title="Crystal_Project_alarm" class="wp-image-377" style="float:right; width:190px;height:190px;"/></p>
<p>Recently I was attempting to create some cron jobs to run PHP scripts on a DV server or at MediaTemple, with PHP installed as an Apache module (rather than CGI). I was able to execute the php file, however all of my include and require statements were totally failing.</p>
<p>My first idea was to set the include paths in PHP. This failed and the scripts still reported errors. My next attempt was to use absolute paths for my includes. This correctly found the includes, but resulted in safe mode errors.</p>
<p>I finally resolved the issue by creating a custom .ini file for PHP, making the appropriate setting changes and then supplying that ini file as an argument to PHP in the cron command.</p>
<p>SSH into the server, and copy the ini file. Something like:<br />
<code>#cp /etc/php.ini /var/www/vhosts/domain/includes/cron/php.ini</code></p>
<p>Now open up the new ini file in vi or emacs (I&#8217;m not getting into that debate). First you&#8217;ll want to disable safe mode by changing the line &#8220;safe_mode = On&#8221; to &#8220;safe_mode = Off&#8221;. Next, you can comment out the openbase_dir setting by changing the line &#8220;open_basedir = &#8220;/usr/share/pear&#8221; to be &#8220;; open_basedir = &#8220;/usr/share/pear&#8221;. And finally, set the includes path for your php scripts.</p>
<p>The last step is to make sure you execute the correct command in cron. Remember, you&#8217;ll need to pass the custom .ini file as an argument to PHP. Something like:</p>
<p><code>php -c /var/www/vhosts/domain/includes/cron/php.ini /var/www/vhosts/domain/includes/cron/test.php<br />
</code></p>
<p>This isn&#8217;t rocket science, and probably a no brainer to some. But, I found it useful and hope someone else does too.</p>
<p>The best thing about this, is I can leverage existing PHP code without having to write a ton of junk in PERL (yuck). Less code = less frustration.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alien109.com/2010/06/08/running-php-cron-jobs-on-a-mediatemple-dv-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>gZip your JavaScript</title>
		<link>http://blog.alien109.com/2009/03/17/gzip-your-javascript/</link>
		<comments>http://blog.alien109.com/2009/03/17/gzip-your-javascript/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 22:06:35 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Science/Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blog.alien109.com/?p=170</guid>
		<description><![CDATA[Most browsers these days (with the exception of Safari, I think?) will accept gzip encoded content. This means you can drastically reduce the size of all those bloated javascript libraries you might be using on your web site. So how do you serve gzipped js files? There a few methods out there. I chose the [...]]]></description>
			<content:encoded><![CDATA[<p>Most browsers these days (with the exception of Safari, I think?)  will accept gzip encoded content. This means you can drastically reduce the size of all those bloated javascript libraries you might be using on your web site.</p>
<p><strong>So how do you serve gzipped js files?</strong></p>
<p>There a few methods out there. I chose the one below since it was fast, easy and I&#8217;m hella freakin&#8217; lazy.</p>
<p>The first step is to gzip all of the javascript files that you might be serving up. The fastest way I found was to just telnet into the server, and execute the following bash command:</p>
<p><code>gzip -cr &lt;javascript directory&gt;</code></p>
<p>Of course you&#8217;ll need to replace &lt;javascript directory&gt; with the correct directory that your javascript files are located in. The -c option tells gzip to keep the originals. This is important so that you can still serve non gzipped versions to browsers that don&#8217;t handle gzip! The -r option tells it to recurse through the directory. Now you should have a directory full of javascript files and their gzipped counterparts.</p>
<p><code>init.js<br />
init.js.gz<br />
jquery-ui.js<br />
jquery-ui.js.gz<br />
jquery.easing.js<br />
jquery.easing.js.gz<br />
jquery.history.js<br />
jquery.history.js.gz<br />
jquery.js<br />
jquery.js.gz<br />
swfobject.js<br />
swfobject.js.gz</code></p>
<p>Yay.  How exiciting, no?</p>
<p>The next step is to modify .htaccess to do some URL rewriting.</p>
<p><code>AddEncoding gzip .gz<br />
RewriteCond %{HTTP:Accept-encoding} gzip<br />
RewriteCond %{HTTP_USER_AGENT} !Safari<br />
RewriteCond %{REQUEST_FILENAME}.gz -f<br />
RewriteRule ^(.*)$ $1.gz [QSA,L]</code></p>
<p>Essentially your telling the web server to server up gzip files, if the browser accepts them and the user is not on Safari and if there is a compressed version of the file available.</p>
<p>That&#8217;s really about it.</p>
<p>Here&#8217;s the difference in file sizes:</p>
<table class="data">
<thead>
<tr>
<th>File</th>
<th>Size</th>
<th>Size (gZip)</th>
</tr>
</thead>
<tbody>
<tr>
<td>init.js</td>
<td>7628</td>
<td>1992</td>
</tr>
<tr>
<td>jquery-ui.js</td>
<td>127787</td>
<td>50756</td>
</tr>
<tr>
<td>jquery.easing.js</td>
<td>8097</td>
<td>2003</td>
</tr>
<tr>
<td>jquery.history.js</td>
<td>5079</td>
<td>1771</td>
</tr>
<tr>
<td>jquery.js</td>
<td>31033</td>
<td>15666</td>
</tr>
<tr>
<td>swfobject.js</td>
<td>6722</td>
<td>2233</td>
</tr>
</tbody>
</table>
<p>Pretty significant size difference! </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alien109.com/2009/03/17/gzip-your-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE and responseXML issues</title>
		<link>http://blog.alien109.com/2009/03/13/ie-and-responsexml-issues/</link>
		<comments>http://blog.alien109.com/2009/03/13/ie-and-responsexml-issues/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 18:33:55 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.alien109.com/?p=165</guid>
		<description><![CDATA[After working on a small AJAX library, I decided to test it in IE. Everything worked great, except when requesting XML. The responseXML property of the XHR was null. I&#8217;ve had this issue in the past where the server isn&#8217;t returning the appropriate Content-Type (text/xml). But that wasn&#8217;t the issue this time. I checked my [...]]]></description>
			<content:encoded><![CDATA[<p>After working on a small AJAX library, I decided to test it in IE. Everything worked great, except when requesting XML. The responseXML property of the XHR was null. I&#8217;ve had this issue in the past where the server isn&#8217;t returning the appropriate Content-Type (text/xml). But that wasn&#8217;t the issue this time. I checked my resin config and everything was correct.</p>
<p>So, I uploaded to a remote server and tried again. Blammo. Chit just worked the way it was supposed to. This left me scratching my head however.</p>
<p>I installed Charles (www.charlesproxy.com), which is a great debugging HTTP proxy/monitor, to see what was going on. Everything worked as it should in FireFox, but still no dice in IE.</p>
<p>Then I noticed that traffic wasn&#8217;t being captured for Localhost when using IE. After a bit of stumbling around the net I found that if you add a period right after localhost, Charles will capture the traffic.</p>
<p>http://localhost:8080/ajaxTest.html</p>
<p>becomes:</p>
<p>http://localhost<strong>.</strong>:8080/ajaxTest.html</p>
<p>When I reloaded the page, I got a very nice surprise. Not only did Charles capture the traffic, but the XHR returned with a proper responseXML property!</p>
<p>I&#8217;m no network engineer, so I&#8217;m not even going to try and guess as to WTF. But, I&#8217;m happy it works as expected and thought I&#8217;d post about it in case someone else ever runs into this issue. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alien109.com/2009/03/13/ie-and-responsexml-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site updates!</title>
		<link>http://blog.alien109.com/2009/02/04/site-updates/</link>
		<comments>http://blog.alien109.com/2009/02/04/site-updates/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 08:56:15 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Art/Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javscript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[keywords]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[url rewriting]]></category>

		<guid isPermaLink="false">http://blog.alien109.com/?p=70</guid>
		<description><![CDATA[So I&#8217;ve finally updated my web site. www.alien109.com Ported all of the javascript over to jQuery and ditched those ancient JavaScript libraries I&#8217;d written years ago Implemented some keyword searching on projects so you can see projects based on languages or technologies. Reworked the backend so that everything was a little more search engine friendly [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve finally updated my web site.<br />
<a href="http://www.alien109.com">www.alien109.com</a></p>
<ul>
<li>Ported all of the javascript over to jQuery and ditched those ancient JavaScript libraries I&#8217;d written years ago</li>
<li>Implemented some keyword searching on projects so you can see projects based on languages or technologies.</li>
<li>Reworked the backend so that everything was a little more search engine friendly (url rewritting for prettier urls and hidden javascript calls)</li>
<li>Added a bunch of new (and old) work into the mix.</li>
</ul>
<p>Creating a search engine friendly ajax app is a pain in the butt, if it&#8217;s an after thought <img src='http://blog.alien109.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alien109.com/2009/02/04/site-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Apache, PHP and MySQL on Vista</title>
		<link>http://blog.alien109.com/2007/07/27/installing-apache-php-and-mysql-on-vista/</link>
		<comments>http://blog.alien109.com/2007/07/27/installing-apache-php-and-mysql-on-vista/#comments</comments>
		<pubDate>Sat, 28 Jul 2007 05:26:16 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.alien109.com/2007/07/27/installing-apache-php-and-mysql-on-vista/</guid>
		<description><![CDATA[I was expecting the worst, but got everything up and running in about 30 minutes due to some damn easy to follow tutorials. I guess I probably could have figured it out myself, but it&#8217;s nice to just get it done. Installing Apache on Vista Installing PHP on Vista Installing MySQL is a no-brainer. Hell, [...]]]></description>
			<content:encoded><![CDATA[<p>I was expecting the worst, but got everything up and running in about 30 minutes due to some damn easy to follow tutorials. I guess I probably could have figured it out myself, but it&#8217;s nice to just get it done.</p>
<p><a href="http://senese.wordpress.com/2007/06/06/installing-apache-on-windows-vista/" target="_blank">Installing Apache on Vista</a><br />
<a href="http://senese.wordpress.com/2007/06/06/install-php-5-under-apache-22-and-windows-vista/" target="_blank">Installing PHP on Vista</a></p>
<p>Installing MySQL is a no-brainer. Hell, even I could do it. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alien109.com/2007/07/27/installing-apache-php-and-mysql-on-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
