<?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>tylerdave.com &#187; Tech</title>
	<atom:link href="http://www.tylerdave.com/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tylerdave.com</link>
	<description></description>
	<lastBuildDate>Sun, 31 Jan 2010 04:42:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Script to correct missing AWStats statistics on Plesk</title>
		<link>http://www.tylerdave.com/2009/11/08/script-to-correct-missing-awstats-statistics-on-plesk/</link>
		<comments>http://www.tylerdave.com/2009/11/08/script-to-correct-missing-awstats-statistics-on-plesk/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 14:52:38 +0000</pubDate>
		<dc:creator>tylerdave (Dave Forgac)</dc:creator>
				<category><![CDATA[System Admin]]></category>
		<category><![CDATA[AWStats]]></category>
		<category><![CDATA[Plesk]]></category>

		<guid isPermaLink="false">http://www.tylerdave.com/?p=52</guid>
		<description><![CDATA[The Plesk statistics system doesn&#8217;t use any log data from previous months.  If you need to regenerate statistics for previous months, you can use this script.  Make sure that the logs are uncompressed in the statistics/logs directory for the domain and then run this script from within the domain&#8217;s root directory (eg. /var/www/vhosts/example.com):

#!/bin/bash
# [...]]]></description>
			<content:encoded><![CDATA[<p>The Plesk statistics system doesn&#8217;t use any log data from previous months.  If you need to regenerate statistics for previous months, you can use this script.  Make sure that the logs are uncompressed in the <code>statistics/logs</code> directory for the domain and then run this script from within the domain&#8217;s root directory (eg. <code>/var/www/vhosts/example.com</code>):</p>
<pre class="brush: bash;">
#!/bin/bash
# per http://kb.parallels.com/en/5550

# make sure to enter the actual domain name on the next line:
export vhost_name=ENTER-REAL-DOMAIN-NAME-HERE

export AWSTATS_BIN_D=`grep ^AWSTATS_BIN_D /etc/psa/psa.conf | awk '{print $2}'`
export HTTPD_VHOSTS_D=`grep ^HTTPD_VHOSTS_D /etc/psa/psa.conf | awk '{print $2}'`
export PRODUCT_ROOT_D=`grep ^PRODUCT_ROOT_D /etc/psa/psa.conf | awk '{print $2}'`
export awstats=${AWSTATS_BIN_D}/awstats.pl
export awstats_gen_opts=&quot;-staticlinks -configdir=${PRODUCT_ROOT_D}/etc/awstats -config=${vhost_name}-http&quot;

find $HTTPD_VHOSTS_D/$vhost_name/statistics/webstat -name '*.txt' -exec rm -f '{}' \;

$awstats $awstats_gen_opts -LogFile=$HTTPD_VHOSTS_D/${vhost_name}/statistics/logs/access_log.processed

# for both of these loops, change the year range to match those that need to be regenerated:

for y in 2007 2008 2009; do for m in `seq 1 12` ; do mkdir ${HTTPD_VHOSTS_D}/${vhost_name}/statistics/webstat/$y-$(printf &quot;%.2d&quot; $m) ; done ; done

for y in 2007 2008 2009; do \
 for m in `seq -w 1 12` ; do \
     dest_dir=$HTTPD_VHOSTS_D/$vhost_name/statistics/webstat/$y-$m ; \
     $awstats $awstats_gen_opts -month=$m -year=$y -output &gt; $dest_dir/awstats.${vhost_name}-http.html ; \
     ln -s $dest_dir/awstats.${vhost_name}-http.html $dest_dir/index.html ; \
     for output in alldomains allhosts lasthosts unknownip allrobots lastrobots session urldetail urlentry urlexit osdetail unknownos refererse refererpages keyphrases keywords errors404 ; do \
         $awstats $awstats_gen_opts -month=$m -year=$y -output=$output &gt; $dest_dir/awstats.${vhost_name}-http.$output.html ; \
     done ; \
 done ; \
done

$PRODUCT_ROOT_D/admin/sbin/statistics --calculate-one --domain-name=$vhost_name
</pre>
<p>This is based on the information in this Parallels KB: <a href="http://kb.parallels.com/en/5550">http://kb.parallels.com/en/5550</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerdave.com/2009/11/08/script-to-correct-missing-awstats-statistics-on-plesk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Passenger (mod_rails) on cPanel Systems</title>
		<link>http://www.tylerdave.com/2009/10/12/configuring-passenger-on-cpanel-systems/</link>
		<comments>http://www.tylerdave.com/2009/10/12/configuring-passenger-on-cpanel-systems/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 13:57:23 +0000</pubDate>
		<dc:creator>tylerdave (Dave Forgac)</dc:creator>
				<category><![CDATA[System Admin]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Passenger]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.tylerdave.com/?p=43</guid>
		<description><![CDATA[cPanel has built-in support for Rails apps using Mongrel but this involves multiple servers and port forwarding and only allows one applicaiton per cPanel user.  Phusion Passenger is an Apache (and Nginx) module that allows Rails applications to be run directly through the web server without further configuration.  Normal installation of Phusion Passenger [...]]]></description>
			<content:encoded><![CDATA[<p>cPanel has built-in support for Rails apps using Mongrel but this involves multiple servers and port forwarding and only allows one applicaiton per cPanel user.  Phusion Passenger is an Apache (and Nginx) module that allows Rails applications to be run directly through the web server without further configuration.  Normal installation of Phusion Passenger is very straight-forward but on cPanel servers, it must be installed in a cPanel-friendly way.</p>
<p><em>All of the following commands need to be run as root or with the use of sudo:</em></p>
<p>First, make sure Ruby is installed:</p>
<pre class="brush: plain; light: true;">root@host:[~]$ /scripts/installruby</pre>
<p>Next, install Passenger:</p>
<pre class="brush: plain; light: true;">root@host:[~]$ gem install passenger</pre>
<p>Then set the paths to Apache and the Apache dev headers and run the installer:</p>
<pre class="brush: plain; light: true;">root@host:[~]$ APXS2=/usr/local/apache/bin/apxs PATH=$PATH:/usr/local/apache/bin passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v2.2.5.

This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.

Here's what you can expect from the installation process:

1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.</pre>
<p>Hit enter and the installer will compile the Apache 2 module.  If this is successful you will get a message with directions for modifying the Apache conf:</p>
<pre class="brush: plain; light: true;">The Apache 2 module was successfully installed.

Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5
PassengerRuby /usr/bin/ruby

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!

Press ENTER to continue.</pre>
<p>Copy the configuration directives and place them in <code>/usr/local/apache/conf/includes/pre_main_global.conf</code>. <em>Do not directly edit the httpd.conf!</em></p>
<p>These are the lines that should be added (with server-specific version numbers):</p>
<pre class="brush: plain; light: true;">LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5
PassengerRuby /usr/bin/ruby</pre>
<p>Add the following to the httpd.conf (<a href="http://www.modrails.com/documentation/Users%20guide%20Apache.html#_compatibility_options Compatibility options">passenger docs</a>):</p>
<pre class="brush: plain; light: true;">PassengerResolveSymlinksInDocumentRoot on</pre>
<p>Run the httpd.conf config distiller to save these changes:</p>
<pre class="brush: plain; light: true;">root@host:[~]$ /usr/local/cpanel/bin/apache_conf_distiller --update
Distilled successfully</pre>
<p>Then rebuild the <code>httpd.conf</code> using the cPanel rebuild script. Stop and correct any errors before restarting Apache:</p>
<pre class="brush: plain; light: true;">root@host:[~]$ /scripts/rebuildhttpdconf
Built /usr/local/apache/conf/httpd.conf OK</pre>
<p>Restart Apache and verify Passenger is installed by running this command:</p>
<pre class="brush: plain; light: true;">root@host:[~]$ apachectl -t -D DUMP_MODULES</pre>
<p>Check for &#8216;passenger_module (shared)&#8217;.</p>
<p>By default, <code>RailsAutoDetect</code> is on so it will detect a directory that is a Rails application.  If this is off, you will need to add a custom vhost configuration to let Apache know to load Passenger for a particular site.  To do this add the following to the site&#8217;s vhost container:</p>
<pre class="brush: plain; light: true;">RailsBaseURI /</pre>
<p>(or whatever URI is the base of the application)</p>
<p>Directions for adding custom directives to a vhost in cPanel: <a href="http://www.cpanel.net/documentation/easyapache/customdirectives.html#vhost">Add Custom Apache Directives to a vhost in cPanel</a></p>
<p>If the Rails application will be the root of the site, you will need to create a symlink from the Rails application&#8217;s <code>public</code> directory to <code>/home/[username]/public_html</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerdave.com/2009/10/12/configuring-passenger-on-cpanel-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirecting MovableType URLs to WordPress using mod_rewrite / .htaccess</title>
		<link>http://www.tylerdave.com/2009/08/19/redirecting-movabletype-urls-to-wordpress-using-mod_rewrite-htaccess/</link>
		<comments>http://www.tylerdave.com/2009/08/19/redirecting-movabletype-urls-to-wordpress-using-mod_rewrite-htaccess/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 03:50:25 +0000</pubDate>
		<dc:creator>tylerdave (Dave Forgac)</dc:creator>
				<category><![CDATA[System Admin]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[MovableType]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.tylerdave.com/?p=17</guid>
		<description><![CDATA[After following the steps outlined here to import the old MovableType content, I created the following mod_rewrite rules to redirect requests for old content to the new archive copy of the site:

RewriteEngine On
RewriteBase /
    # Redirects individual posts:
RewriteCond %{REQUEST_URI} ^/weblog/archives/[0-9]{6}\.html.*$
RewriteRule ^weblog/archives/([0-9]+)\.html.*$ http://archive.tylerdave.com/$1/ [R=301,L]
    # Redirects monthly archives:
RewriteCond %{REQUEST_URI} ^/weblog/archives/20[0-9]{2}\_[0-9]{2}\.html.*$
RewriteRule [...]]]></description>
			<content:encoded><![CDATA[<p>After following the steps <a href="/2009/08/17/the-archive/">outlined here</a> to import the old MovableType content, I created the following mod_rewrite rules to redirect requests for old content to the new archive copy of the site:</p>
<pre class="brush: plain;">
RewriteEngine On
RewriteBase /
    # Redirects individual posts:
RewriteCond %{REQUEST_URI} ^/weblog/archives/[0-9]{6}\.html.*$
RewriteRule ^weblog/archives/([0-9]+)\.html.*$ http://archive.tylerdave.com/$1/ [R=301,L]
    # Redirects monthly archives:
RewriteCond %{REQUEST_URI} ^/weblog/archives/20[0-9]{2}\_[0-9]{2}\.html.*$
RewriteRule ^weblog/archives/20([0-9]{2})\_([0-9]{2})\.html.*$ http://archive.tylerdave.com/date/20$1/$2/ [R=301,L]
    # Redirects individual posts:
RewriteCond %{QUERY_STRING} ^entry_id=([0-9]{1})$
RewriteRule ^mt/mt-comments\.cgi http://archive.tylerdave.com/00000%1/? [R=301,L]

    # Redirects old comments URLs to the posts:
RewriteCond %{QUERY_STRING} ^entry_id=([0-9]{2})$
RewriteRule ^mt/mt-comments\.cgi http://archive.tylerdave.com/0000%1/? [R=301,L]

RewriteCond %{QUERY_STRING} ^entry_id=([0-9]{3})$
RewriteRule ^mt/mt-comments\.cgi http://archive.tylerdave.com/000%1/? [R=301,L]

    # Redirects other requests to me-comments.cgi to the archive's home page:
RewriteCond %{REQUEST_URI} ^/mt/mt-comments\.cgi.*$
RewriteRule . http://archive.tylerdave.com/ [R=301,L]

    # Redirects the index page::
RewriteCond %{REQUEST_URI} ^/weblog/archives/index.html$
RewriteRule . http://archive.tylerdave.com/ [R=301,L]

    # Redirects RDF feed:
RewriteCond %{REQUEST_URI} ^.*index.rdf$
RewriteRule . http://archive.tylerdave.com/feed/rdf/
</pre>
<p>These rules account for more than 95% of the traffic to the old site.  I will continue to monitor the logs and update the rules as necessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerdave.com/2009/08/19/redirecting-movabletype-urls-to-wordpress-using-mod_rewrite-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Archive</title>
		<link>http://www.tylerdave.com/2009/08/17/the-archive/</link>
		<comments>http://www.tylerdave.com/2009/08/17/the-archive/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 04:07:44 +0000</pubDate>
		<dc:creator>tylerdave (Dave Forgac)</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[MovableType]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.tylerdave.com/?p=10</guid>
		<description><![CDATA[I&#8217;ve owned the domain &#8216;tylerdave.com&#8217; since May 1999.  I&#8217;ve used it for a variety of purposes (mainly email) over that time.
From 2002 to 2004 I kept friends up-to-date with my mundane goings-on using Movable Type.  When I originally decided to revive my blog I was going to just scrap the old content.  However after finding [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve owned the domain &#8216;tylerdave.com&#8217; since May 1999.  I&#8217;ve used it for a variety of purposes (mainly email) over that time.</p>
<p>From 2002 to 2004 I kept friends up-to-date with my mundane goings-on using <a href="http://www.movabletype.org/" target="_blank">Movable Type</a>.  When I originally decided to revive my blog I was going to just scrap the old content.  However after finding a number of my old posts still getting a decent amount of traffic I decided to archive the content in another installation of WordPress: <a href="http://archive.tylerdave.com/" target="_blank">archive.tylerdave.com</a></p>
<p>Thanks to <a href="http://www.zader.com/">Joshua Zader</a> for his excellent instructions for <a href="http://www.muditajournal.com/archives/000280.php" target="_blank">importing form MovableType to WordPress</a> while preserving the post IDs.   This will allow me to 301-redirect all of the old URLs to their new location.</p>
<p>All that&#8217;s left to do is some mod_rewrite trickeration so the old URLs map to the new locations and we&#8217;re all set!</p>
<p>Update: <a href="/2009/08/19/redirecting-movabletype-urls-to-wordpress-using-mod_rewrite-htaccess/">mod_rewrite rules for redirecting old ULRs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tylerdave.com/2009/08/17/the-archive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
