<?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>42 &#187; Dreamhost</title>
	<atom:link href="http://www.42.mach7x.com/category/dreamhost/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.42.mach7x.com</link>
	<description>Thoughts and tips about programming with Ruby on Rails</description>
	<lastBuildDate>Wed, 01 Feb 2012 14:38:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Upgrading your Rails 3.0.3 application</title>
		<link>http://www.42.mach7x.com/2011/02/10/upgrading-your-rails-3-0-3-application/</link>
		<comments>http://www.42.mach7x.com/2011/02/10/upgrading-your-rails-3-0-3-application/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 19:45:28 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[Ruby on Rails 3.0.3]]></category>
		<category><![CDATA[Ruby on Rails 3.0.4]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=313</guid>
		<description><![CDATA[Problem After the announcements in the previous posts about the security vulnerabilities in Rails 3.0.3, you would like to update your application and deploy with the latest 3.0.4 version. Solution Change your Gemfile to replace gem 'rails', '3.0.3' with gem 'rails', '3.0.4' Run: bundle update rails Remove the old gems by using: git status and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
After the announcements in the previous posts about the security vulnerabilities in Rails 3.0.3, you would like to update your application and deploy with the latest 3.0.4 version.</p>
<p><strong>Solution</strong></p>
<ul>
<li>Change your Gemfile to replace<br />
              <code>gem 'rails', '3.0.3'</code><br />
              with<br />
              <code>gem 'rails', '3.0.4'</code></li>
<li>Run:<br />
             <code>bundle update rails</code></li>
<li>Remove the old gems by using:<br />
             <code>git status</code><br />
             and then<br />
             <code>git rm name_of_3.0.3_gem</code></li>
<li>Add the new gems to your git<br />
              <code>git add vendor/cache</code></li>
<li>Check in to your repository the new files<br />
             <code>git commit vendor/cache -m 'upgrade to rails 3.0.4'</code></li>
<li>Make sure that you also check in both your Gemfile and Gemfile.lock into your git repository<br />
             <code>git commit Gemfile Gemfile.lock -m 'update Gemfiles to use 3.0.4'</code><br />
             otherwise when you try to deploy you will see the error:<br />
             <code>You have modified your Gemfile in development but did not check the resulting snapshot (Gemfile.lock) into version control</code></li>
<li>push everything to your git repository:<br />
              <code>git push</code></li>
<li>Deploy your application with capistrano as usual:<br />
             <code>cap deploy</code></li>
<li>Your new gems for 3.0.4 should be installed on the share/bundle folder</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2011/02/10/upgrading-your-rails-3-0-3-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Internal 500 server error &#8211; Dreamhost &#8211; Rails 3.0.3 &#8211; Capistrano</title>
		<link>http://www.42.mach7x.com/2011/01/13/internal-500-server-error-dreamhost-rails-3-0-3-capistrano/</link>
		<comments>http://www.42.mach7x.com/2011/01/13/internal-500-server-error-dreamhost-rails-3-0-3-capistrano/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 12:31:42 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[500 Internal Server Error]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[Rails 3.0.3]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=292</guid>
		<description><![CDATA[Problem You want to deploy your Rails 3.0.3 in Dreamhost with capistrano, but even though you follow the steps from a previous post here, when you go to the application&#8217;s main page you still get an error: 500 Internal Server Error Solution Thanks to a blog post from Brendon Wilson here, the last missing piece [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You want to deploy your Rails 3.0.3 in Dreamhost with capistrano, but even though you follow the steps from a previous post <a href="http://www.42.mach7x.com/2011/01/13/rails-3-bundler-dreamhost-capistrano/">here</a>, when you go to the application&#8217;s main page you still get an error: </p>
<p><code>500 Internal Server Error</code></p>
<p><strong>Solution</strong><br />
Thanks to a blog post from Brendon Wilson <a href="http://www.brendonwilson.com/blog/2011/01/07/rails-3-on-dreamhost-via-capistrano/">here</a>, the last missing piece from the puzzle in order to have your application running is to add the following line to the top of your deploy.rb file:</p>
<p><code>require 'bundler/capistrano'</code></p>
<p>and redo your cap deploy.</p>
<p>Thanks Brendon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2011/01/13/internal-500-server-error-dreamhost-rails-3-0-3-capistrano/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails 3 &#8211; Bundler &#8211; Dreamhost &#8211; Capistrano</title>
		<link>http://www.42.mach7x.com/2011/01/13/rails-3-bundler-dreamhost-capistrano/</link>
		<comments>http://www.42.mach7x.com/2011/01/13/rails-3-bundler-dreamhost-capistrano/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 12:01:39 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[bundler]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[Rails 3.0.3]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=289</guid>
		<description><![CDATA[Problem You want to deploy your Rails (3.0.3) application to Dreamhost using Capistrano, but you get errors like: bundle command not found or Enter your password to install the bundled RubyGems to your system: Solution You may be able to see in your deploy.rb file a commented section that says the following: As Capistrano executes [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You want to deploy your Rails (3.0.3) application to Dreamhost using Capistrano, but you get errors like:</p>
<p><code>bundle command not found</code><br />
or<br />
<code>Enter your password to install the bundled RubyGems to your system:</code></p>
<p><strong>Solution</strong><br />
You may be able to see in your deploy.rb file a commented section that says the following:</p>
<blockquote><p>As Capistrano executes in a non-interactive mode and therefore doesn&#8217;t cause<br />
any of your shell profile scripts to be run &#8230;.</p></blockquote>
<p>So in order for capistrano to be able to find your bundle command you should add in your deploy.rb file a line with your paths (ie):</p>
<p><code>default_environment['PATH']='/usr/lib/ruby/gems/1.8/bin:/home/your_name/.gems/bin:/usr/local/bin:/usr/bin:/bin'</code></p>
<p>If you have the previous line your bundle command can run, but if you try to do cap:deploy your bundler will probably give you an error as it would ask for your sudo password. In order to avoid this error and to make it work you have to add another line with your gem path (ie):</p>
<p><code>default_environment['GEM_PATH']='/home/your_name/.gems:/usr/lib/ruby/gems/1.8'</code></p>
<p>making sure that your home directory path for your gems is first in the list.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2011/01/13/rails-3-bundler-dreamhost-capistrano/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Security upgrade for WordPress</title>
		<link>http://www.42.mach7x.com/2010/12/30/security-upgrade-for-wordpress/</link>
		<comments>http://www.42.mach7x.com/2010/12/30/security-upgrade-for-wordpress/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 12:01:07 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Dreamhost]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=281</guid>
		<description><![CDATA[Security Upgrade According to a dreamhost post here, you should be upgrading your WordPress installation as soon as possible.]]></description>
			<content:encoded><![CDATA[<p><strong>Security Upgrade</strong></p>
<p>According to a dreamhost post <a href="http://www.dreamhoststatus.com/2010/12/29/wordpress-hack-cropping-up-on-some-customer-sites/">here</a>, you should be upgrading your WordPress installation as soon as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/12/30/security-upgrade-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>converting MySQL sysdate to local timezone</title>
		<link>http://www.42.mach7x.com/2010/10/12/converting-mysql-sysdate-to-local-timezone/</link>
		<comments>http://www.42.mach7x.com/2010/10/12/converting-mysql-sysdate-to-local-timezone/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 13:09:20 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[converting dates]]></category>
		<category><![CDATA[convert_tz]]></category>
		<category><![CDATA[local timezone]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=263</guid>
		<description><![CDATA[Problem You are hosting your MySQL server in a shared host which is in a different country from your application&#8217;s local timezone, and you cannot change the MySQL system timezone, but you would like to use sysdate for date comparisons. Solution In your SQL query that you use for comparing with the system date/time, use [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You are hosting your MySQL server in a shared host which is in a different country from your application&#8217;s local timezone, and you cannot change the MySQL system timezone, but you would like to use sysdate for date comparisons.</p>
<p><strong>Solution</strong><br />
In your SQL query that you use for comparing with the system date/time, use the convert_tz function in MySQL, using the appropriate local time zone (ie Europe/London):<br />
<code>convert_tz(sysdate(),'SYSTEM','Europe/London')</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/10/12/converting-mysql-sysdate-to-local-timezone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>capistrano deployment fails after dreamhost server move</title>
		<link>http://www.42.mach7x.com/2010/10/08/capistrano-deployment-fails-after-dreamhost-server-move/</link>
		<comments>http://www.42.mach7x.com/2010/10/08/capistrano-deployment-fails-after-dreamhost-server-move/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 10:27:29 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[permission denied]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=259</guid>
		<description><![CDATA[Problem You have set up your capistrano recipe for deployment to dreamhost using password less logins, but after dreamhost moves your git repository server to a different server, the deployment breaks, with &#8216;permission denied&#8217; when trying to get the git repository. Solution As the server was moved you would need to copy your ssh public [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You have set up your capistrano recipe for deployment to dreamhost using password less logins, but after dreamhost moves your git repository server to a different server, the deployment breaks, with &#8216;permission denied&#8217; when trying to get the git repository.</p>
<p><strong>Solution</strong><br />
As the server was moved you would need to copy your ssh public key from the deployment server to the new server again for the password-less logins to work again.<br />
Follow the details <a href="http://www.42.mach7x.com/2008/02/06/password-less-logins-and-aliases-with-ssh/">here</a> how to copy your public key across, login in once with your password, and after that your capistrano recipe should be working again as normal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/10/08/capistrano-deployment-fails-after-dreamhost-server-move/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git and dreamhost : refusing to update checked out branch: refs/heads/master</title>
		<link>http://www.42.mach7x.com/2010/09/30/git-and-dreamhost-refusing-to-update-checked-out-branch-refsheadsmaster/</link>
		<comments>http://www.42.mach7x.com/2010/09/30/git-and-dreamhost-refusing-to-update-checked-out-branch-refsheadsmaster/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 11:43:18 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[server moving]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=247</guid>
		<description><![CDATA[Problem After dreamhost decided to move my account that hosted the git repository to a new server, first time I&#8217;ve tried to push some changes to the git repository I was faced with the followng error: Counting objects: 13, done. Delta compression using up to 4 threads. Compressing objects: 100% (7/7), done. Writing objects: 100% [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
After dreamhost decided to move my account that hosted the git repository to a new server, first time I&#8217;ve tried to push some changes to the git repository I was faced with the followng error:</p>
<p><code>Counting objects: 13, done.<br />
Delta compression using up to 4 threads.<br />
Compressing objects: 100% (7/7), done.<br />
Writing objects: 100% (7/7), 699 bytes, done.<br />
Total 7 (delta 6), reused 0 (delta 0)<br />
error: refusing to update checked out branch: refs/heads/master<br />
error: By default, updating the current branch in a non-bare repository<br />
error: is denied, because it will make the index and work tree inconsistent<br />
error: with what you pushed, and will require 'git reset --hard' to match<br />
error: the work tree to HEAD.<br />
error:<br />
error: You can set 'receive.denyCurrentBranch' configuration variable to<br />
error: 'ignore' or 'warn' in the remote repository to allow pushing into<br />
error: its current branch; however, this is not recommended unless you<br />
error: arranged to update its work tree to match what you pushed in some<br />
error: other way.<br />
error:<br />
error: To squelch this message and still keep the default behaviour, set<br />
error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.<br />
To ssh://dh_user@dh_domain/home/repository_path/projects/project.git</code></p>
<p><strong>Solution</strong><br />
After searching and finding out various solutions to solve the problem, none of which was specific to a server move, I&#8217;ve tried the following:</p>
<ul>
<li>Followed the steps <a href="http://www.42.mach7x.com/2010/03/12/getting-your-github-git-project-to-dreamhost/">here</a> to set up a new repository project_asm.git</li>
<li>went to local project changed the config file to add the new remote repository</li>
<li>issued <code>git push new_remote master</code></li>
<li>make a code change and then <code>git push</code></li>
</ul>
<p>And everything should work as normal again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/09/30/git-and-dreamhost-refusing-to-update-checked-out-branch-refsheadsmaster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying a Rails project in a server that hosts the git repository</title>
		<link>http://www.42.mach7x.com/2010/09/20/deploying-a-rails-project-in-a-server-that-hosts-the-git-repository/</link>
		<comments>http://www.42.mach7x.com/2010/09/20/deploying-a-rails-project-in-a-server-that-hosts-the-git-repository/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 23:07:34 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[local repository]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=228</guid>
		<description><![CDATA[Problem You want to deploy your project in a server (dreamhost), that also hosts your git repository. When you try to do that by only setting the set_repository, you get errors like &#8216;permission denied, please try again&#8217;, even though if you try to checkout the git repository on your server works. Solution Set your :repository [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You want to deploy your project in a server (dreamhost), that also hosts your git repository. When you try to do that by only setting the set_repository, you get errors like &#8216;permission denied, please try again&#8217;, even though if you try to checkout the git repository on your server works.</p>
<p><strong>Solution</strong><br />
Set your :repository as a file in your host as in:<br />
<code>set :repository, "file:///home/username/git_on_server/projects/repo_name.git"</code></p>
<p>
Then also set up your local_repository, as in:<br />
<code>set :local_repository,  "user_name@server_domain_name:/home/username/git_on_server/projects/repo_name.git"</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/09/20/deploying-a-rails-project-in-a-server-that-hosts-the-git-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Passenger Staging environment problem in Dreamhost</title>
		<link>http://www.42.mach7x.com/2010/09/09/rails-passenger-staging-environment-problem-in-dreamhost/</link>
		<comments>http://www.42.mach7x.com/2010/09/09/rails-passenger-staging-environment-problem-in-dreamhost/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 09:28:07 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Phusion Passenger]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Passenger]]></category>
		<category><![CDATA[phusion passenger]]></category>
		<category><![CDATA[Staging]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=226</guid>
		<description><![CDATA[Problem You want to deploy your rails application using Passenger in Dreamhost, but on a staging environment. It doesn&#8217;t work just changing your Capistrano recipe or your environment files, as the default environment for passenger is &#8216;production&#8217;. Solution Looking at the Passenger documentation here, there are four different ways of achieving that by changing the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You want to deploy your rails application using Passenger in Dreamhost, but on a staging environment. It doesn&#8217;t work just changing your Capistrano recipe or your environment files, as the default environment for passenger is &#8216;production&#8217;.</p>
<p><strong>Solution</strong><br />
Looking at the Passenger documentation <a href="http://www.modrails.com/documentation/Users%20guide%20Apache.html#rails_env">here</a>, there are four different ways of achieving that by changing the RailsEnv option. If you don&#8217;t want to change the Apache configuration files, and as long as the option AllowOverride is on (which should be on Dreamhost), then you would need to create an .htaccess file in your application&#8217;s public folder with the following:</p>
<p><span class="code">RailsEnv staging</span> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/09/09/rails-passenger-staging-environment-problem-in-dreamhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dreamhost &#8211; SquirrelMail &#8211; old-messages folder</title>
		<link>http://www.42.mach7x.com/2010/08/05/dreamhost-squirrelmail-old-messages-folder/</link>
		<comments>http://www.42.mach7x.com/2010/08/05/dreamhost-squirrelmail-old-messages-folder/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 17:14:50 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[old-messages]]></category>
		<category><![CDATA[squirrelmail]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=210</guid>
		<description><![CDATA[Problem You have left a message in a squirrel mail account in dreamhost for a long time and it gets archived by dreamhost. According to the dreamhost you should be able to get to your archived messages, by looking at the old-messages folder. The problem is that just by logging in to squirrel mail the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You have left a message in a squirrel mail account in dreamhost for a long time and it gets archived by dreamhost. According to the dreamhost you should be able to get to your archived messages, by looking at the old-messages folder.<br />
The problem is that just by logging in to squirrel mail the folder doesn&#8217;t get displayed on the left hand side.</p>
<p><strong>Solution</strong><br />
Log on to squirrel mail and go to &#8216;Folders&#8217; menu at the top.<br />
In the &#8216;Create Folder&#8217; put &#8216;test&#8217; or anything that you would like in the text box, and make sure that in the dropdown box you select &#8216;INBOX.old-messages&#8217;, so your newly created folder is a subfolder of the &#8216;inbox/old-messages&#8217; folder.<br />
Create the subfolder, refresh the page, and in your left hand the old-messages folder should appear.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/08/05/dreamhost-squirrelmail-old-messages-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

