<?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>Postpostmodern &#187; Media Temple</title>
	<atom:link href="http://postpostmodern.com/tag/media-temple/feed/" rel="self" type="application/rss+xml" />
	<link>http://postpostmodern.com</link>
	<description>Speaking of web development.</description>
	<lastBuildDate>Wed, 11 Jan 2012 00:21:50 +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>Capistrano on Media Temple</title>
		<link>http://postpostmodern.com/instructional/a-recipe-for-capistrano-rails-deployment-on-media-temples-grid-server/</link>
		<comments>http://postpostmodern.com/instructional/a-recipe-for-capistrano-rails-deployment-on-media-temples-grid-server/#comments</comments>
		<pubDate>Thu, 30 Nov 2006 00:25:58 +0000</pubDate>
		<dc:creator>Jason Johnson</dc:creator>
				<category><![CDATA[Instructional]]></category>
		<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Media Temple]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://blog.postpostmodern.com/2006/11/29/a-recipe-for-capistrano-rails-deployment-on-media-temples-grid-server/</guid>
		<description><![CDATA[A tutorial for deploying a Rails app on Media Temple's Grid Server using Capistrano]]></description>
			<content:encoded><![CDATA[<h2>[UPDATE 1/6/07]</h2>

<p>I had originally left out the step where you create the &#8216;rails&#8217; directory inside the container directory. I thought that the mtr add utility might do that automatically, but it doesn&#8217;t look it. So, make sure you do #8 of Step 1 if you&#8217;re starting from scratch.</p>

<h2>[UPDATE 12/1/06]</h2>

<p>When I first wrote this article, WordPress was converting my double hyphens to en dashes (like a hyphen/dash but longer). Consequently, copy/pasting the command line input didn&#8217;t work. Now, it should be fixed and copy/pasting the commands should work. When in doubt, re-type it.</p>

<p>&#8230;easy as pie! You could even call it a recipe for pie!</p>

<p>I had the pleasure of deploying a Rails site on Media Temple&#8217;s new Grid Server recently. I have to say, it&#8217;s probably the easiest set up I&#8217;ve used for Rails.</p>

<p>There are basically three simple steps to setting up and deploying once you have the account set up: installing the container and rails; configuring your Capistrano recipe; and deploying.</p>

<p>I have created <a href="http://blog.postpostmodern.com/download/mt-gs-deploy.rb.zip">my own deploy.rb recipe</a> which makes things even easier than the default <a href="http://gems.mediatemple.net/deploy.rb">MT recipe</a>.</p>

<h3>Step 1: Rails and the Container</h3>

<p>The following is mostly taken straight from MT&#8217;s Server Guide. The part that differs is in Step 2 and 3.</p>

<ol>
    <li>The first thing you need to do is enable ssh access for your server admin on your Grid Server account. That&#8217;s done via the Account Center control panel.</li>
    <li>Next, you need to activate the container. That&#8217;s also done via the control panel (under Ruby on Rails).</li>
    <li>SSH into your acocunt and set up your gems:
<kbd class="block">mtr  setup_rubygems -u serveradmin@domain.com -p</kbd></li>
    <li>Load your newly created environment variables:
<kbd class="block">source ~/.bash_profile</kbd></li>
    <li>Install Rails and dependencies:
<kbd class="block">gem install rails -y</kbd></li>
    <li>Install MySQL driver (postgres is also available):
<kbd class="block">gem install mysql --source=http://gems.mediatemple.net/</kbd></li>
    <li>Install Mongrel:
<kbd class="block">gem install daemons gem_plugin -y
gem install mongrel --source=http://gems.mediatemple.net/</kbd></li>
    <li>Create a rails directory:
<kbd class="block">mkdir ~/../../containers/rails</kbd></li>
</ol>

<p>Rails is pretty much ready for an app now.</p>

<h3>Step 2: Configuring your Application</h3>

<p>This is standard Capistrano procedure except for the specialized gem and deploy recipe.</p>

<p>[UPDATE] I should mention that the rest of this procedure takes place on your local (development) machine.</p>

<ol>
    <li>If you don&#8217;t have Capistrano installed, do it:
<kbd class="block">sudo gem install capistrano</kbd></li>
    <li>Install MT&#8217;s special Capistrano tasks (all one line):
<kbd class="block">sudo gem install mt-capistrano --source=http://gems.mediatemple.net/</kbd></li>
    <li>&#8220;Capistranize&#8221; your application by cd-ing into your rails root and running:
<kbd class="block">cap --apply-to ./ <var>YourApplicationName</var></kbd></li>
    <li>Download my <a href="http://blog.postpostmodern.com/download/mt-gs-deploy.rb.zip">Grid Server deployment recipe</a>, unzip it and use it to replace your default config/deploy.rb file.</li>
    <li>Open up the new deploy.rb in your favorite text editor and fill in the config info at the top.</li>
    <li>Check your app in to your svn repository.</li>
</ol>

<p>Now, your app is properly set up.</p>

<h3>Step 3: Deploy (the fun part)</h3>

<ol>
    <li>Set up the directory structure:
<kbd class="block">cap setup</kbd></li>
    <li>Do a &#8220;cold deploy&#8221;:
<kbd class="block">cap cold_deploy</kbd></li>
    <li>Visit your site, and revel in your overwhelming sense of accomplishment.</li>
</ol>

<h3>Disclaimer</h3>

<p>The above worked for me. Unless I&#8217;ve mis-documented something, it should work for you, but I can&#8217;t guarantee it. Please don&#8217;t blame me for any damage, and let me know if you find errors. I&#8217;ll do my best to address questions in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://postpostmodern.com/instructional/a-recipe-for-capistrano-rails-deployment-on-media-temples-grid-server/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Quick Email Aliases on Media Temple</title>
		<link>http://postpostmodern.com/downloadable/quick-email-aliases-on-media-temple/</link>
		<comments>http://postpostmodern.com/downloadable/quick-email-aliases-on-media-temple/#comments</comments>
		<pubDate>Wed, 29 Nov 2006 05:17:41 +0000</pubDate>
		<dc:creator>Jason Johnson</dc:creator>
				<category><![CDATA[Downloadable]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Media Temple]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.postpostmodern.com/2006/11/29/adding-email-aliases-on-a-media-temple-dv-server/</guid>
		<description><![CDATA[A script to create instant email aliases on a MT (dv) account]]></description>
			<content:encoded><![CDATA[<h2>The Short Story:</h2>

<p>If you have a Media Temple (dv) vps server account with Ruby<sup><a href="#footnote-1-41" id="footnote-link-1-41" title="See the footnote.">1</a></sup> installed and root/sudo access, you can use my <a title="gist" href="http://gist.github.com/60650">handy-dandy script to create instant email aliases</a> for any of your hosted domains.</p>

<p>Usage<sup><a href="#footnote-2-41" id="footnote-link-2-41" title="See the footnote.">2</a></sup>:</p>

<p><kbd class="block">sudo ./alias.rb email_alias@hosted-domain.com recipient@anydomain.com</kbd></p>

<p>That&#8217;s it. 5 seconds and you have a new email alias. No Plesky mess involved.</p>

<p>I even aliased my alias script in my .bashrc file:</p>

<p><code>alias ealias='sudo ~/alias.rb'</code></p>

<h2>The Backstory (and how the script works):</h2>

<p>I use a lot of email aliases. I rarely give out my real email address. I usually create an alias that forwards to my real address. For example, if Amazon.com thinks my email address is amazon (@ my domain.com). That way, if I ever start getting spam, I know who gave away my address, and I can just delete the alias.</p>

<p>I use Media Temple&#8217;s Dedicated Virtual (dv) hosting plan. The Plesk control panel is kinda limited (and a pain) when it comes to creating lots of email aliases. I&#8217;ve yet to find a way to create an alias that forwards to an external email address, and any alias creation takes a crapload of mouse clicks. So, I decided to figure out a simpler way. After looking under hood, I discovered qmail. I didn&#8217;t know a thing about qmail, but I was willing to do some research to get to a solution for my alias thing. It turns out, qmail has kind of a neat way of dealing with aliases: for each domain, there is a directory. Each file in this directory represents an email alias<sup><a href="#footnote-3-41" id="footnote-link-3-41" title="See the footnote.">3</a></sup>. The files are named thusly: &#8216;.qmail-<em>alias</em>&#8217; where <em>alias</em> is the actual <em>name</em> part of the alias address. The contents of the file consist of the actual recipient addresses (prefixed by &#038; and separated by newlines). So, a file called .qmail-amazon in /var/qmail/mailnames/postpostmodern.com that contains my real email address, prefixed by an ampersand, would be all that is needed for a functioning alias. All my script does is parse the input to figure out the name of the file, the contents of the file and where to put the file. Then, of course, it just creates the file.</p>

<p>The nice thing about qmail&#8217;s system is that the files are utilized instantly. There is no <em>reloading</em> of alias info or anything. It just works.</p>

<p>Oh, and adding a bash alias like this:</p>

<p><code>alias emails='sudo ls -a /var/qmail/mailnames/hosteddomain.com/'</code></p>

<p>will give you a list of existing aliases.<br /></p>

<ol class="footnotes"><li id="footnote-1-41">Yes, I could have used Bash or something, but I&#8217;m more comfortable with Ruby, okay?  <a href="#footnote-link-1-41">&#8593; back up there</a></li><li id="footnote-2-41">Please adjust the shebang line for your ruby installation. And don&#8217;t forget to chmod the script so it&#8217;s executable (755)!  <a href="#footnote-link-2-41">&#8593; back up there</a></li><li id="footnote-3-41">There are also subdirectories for each real email account.  <a href="#footnote-link-3-41">&#8593; back up there</a></li></ol>
]]></content:encoded>
			<wfw:commentRss>http://postpostmodern.com/downloadable/quick-email-aliases-on-media-temple/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

