Created Dreamhost (textile)

bsag 2011-07-16 08:24:29 -07:00
parent 3c17f123e9
commit 11ec90e258

127
Dreamhost.textile Normal file

@ -0,0 +1,127 @@
h1. Dreamhost
h2. Tested with 1.7RC2
The Dreamhost installation was very easy. I set it up as the only application in the domain (actually created a subdomain for this purpose):
* Create a (sub)domain, Fully Hosted
* Enable:
** Extra Web Security
** FastCGI Support
** Ruby on Rails Passenger (mod_rails)
* Set the field "Specify your web directory" to:
** /home/username/ your.domain.name/tracks/public
Note 06.17.09: When you install tracks, that is, when you unzip the files, you will be _replacing the tracks (and thus public) directory you just created in the Dreamhost control panel_. That is, go to your domain via SSH or FTP and rename the 'track' directory (for example: your.domain.name/xtracks/public). Unzip the file in your.domain.name, and you will see that you now have a 'tracks' directory (amongst others), and inside it a 'public' directory.
* Set all the rest of the domain settings to your liking
* Follow the instructions in http://www.getontracks.org/doc/chapter/2-installation.html with the exceptions below
Now I like to set shell access to my account and log in to Dreamhost via SSH, but I guess it can be done otherwise. The idea is to either unzip the tracks zip file inside the home directory for the site. If you're like me, you'd need to do:
(log in to your dreamhost account that you associated with the domain using your favorite ssh client)
* cd your.domain.name
* wget url-to-tracks-zip-file
* unzip zip-file.zip
* You'll get a folder named tracks-<version>. Let's create a symlink to it:
<code>ln -s tracks--<version> tracks</code>
Then continue with the installation.
If you don't like to shell-access your account, you could also download and unzip on your local computer, rename the folder "tracks" and upload the whole thing to Dreamhost. Never tested it myself.
Also - you do not need to run the web server that comes with tracks. Just go to the url http://your.domain.name/signup and you should be fine.
Clarification 06.16.09: Skip this step: script/server -e production. You don't need a Mongrel server. Dreamhost is providing your server.
-- Arik
h2. Solving 404 for stats page
There are just a couple of lines to add to the config/routes.rb file
<pre>
map.statistics 'statistics', :controller => 'stats', :action => 'index'
map.connect 'statistics/:action', :controller => 'stats', :action =>':action'
</pre>
I added them just before
<pre>
map.resources :recurring_todos,
</pre>
which was around line 70 originally.
(copied from the forum "here":http://www.getontracks.org/forums/viewthread/427/P15/)
also mentioned on the forum by deadman:
alternatively, you can edit your .htaccess file to include this code:
<pre>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC]
RewriteRule . - [L]
</IfModule>
</pre>
taken from their wiki here: http://wiki.dreamhost.com/Making_stats_accessible_with_htaccess
h2. Installing 1.8 (devel)
The devel version of Tracks depends on the 'sanitize' gem, which is not installed as of April 2010 on Dreamhost's servers. Additionally, the normal mechanism of installing this gem in $HOME/.gem will fail, because nokogiri (which is required by sanitize) must compile native code which links against libxstl, and the libxstl-devel headers are not present on Dreamhost.
To get things working, it is necessary to 1) manually install libxstl in your user space, then 2) manually install the nokogiri gem (so that you can provide the customized include and library paths for your version of libxslt), 3) installing the sanitize gem will then work.
Installing libxslt is fairly trivial. On your Dreamhost shell, do the following:
1) Fetch the appropriate tarball from ftp://xmlsoft.org/libxslt/
2) Extract the tarball in a scratch workspace.
3) ./configure --prefix=$HOME && make && make install
As for installing the gem manually, [Editor's note: I am not that familiar with the Ruby gems system, so there is probably a better way to do this, but the following worked for me.] The version numbers below may be slightly different for you.
1) Attempt to install the gem automatically, with 'gem install sanitize'. It will fail, but do so anyway to bootstrap the process.
2) cd ~/.gem/ruby/1.8/gems/nokogiri-1.4.1/ext/nokogiri
3) vi extconf.rb; Find the HEADER_DIRS and LIB_DIRS arrays, and add /home/username/include and /home/username/lib to them respectively.
4) cd ../../
5) rake
6) gem spec ../../cache/nokogiri-1.4.1.gem --ruby > ../../specifications/nokogiri-1.4.1.gemspec
Note on #5: If running rake in nokogiri fails due to some missing dependencies, just gem install whatever it complains about, and try again. It should work eventually.
Note on #6: This is needed to let gem know that you've manually built nokogiri.
At this point, 'gem install sanitize' should work.
h2. Installing 2.0
As of May 2011, these steps work for installing on DreamHost.
After going through the setup on DreamHost, I would say its a lot easier if you install tracks on a subdomain. First, by doing so, you can run it under a separate user account than whats used for your root domain (See below why this is good). Second, if you want to use Passenger, you pretty much have to have the tracks application installed to the root directory of the website on DreamHost, otherwise, youre limited to FastCGI only.
The steps I took to get it working at http://tracks.smajn.net were:
* Added a subdomain with a new user account (SSH enabled) and Passenger enabled
* Installed the RedCloth gem under the new account
** @gem install --no-ri --no-rdoc@
* Download and unpack the tracks application to the home directory
** @unzip bsag-tracks-v2.0-0-g22a0c94.zip@
* Edit @site.yml@ and @database.yml@
* Run your migration
** @rake db:migrate RAILS_ENV=production@
Now, to get it working under Passenger, I did the following:
* Rename /home/username/tracks.smajn.net to /home/username/tracks.smajn.net.bak
** @mv tracks.smajn.net tracks.smajn.net.bak@
* Linked bsag-tracks-22a0c94 to tracks.smajn.net
** @ln -s /home/username/bsag-tracks-22a0c94 /home/username/tracks.smajn.net@
You can verify that Passenger is being used by accessing the app from the website and then look at the output of @ps -AF@ from the shell, if you see @Passenger ApplicationSpawner@ in the output, then its running under Passenger. On the other hand, if you see @ruby dispatch.fcgi@ then its running under FastCGI.
[b]Why should you run tracks under a separate user account?[/b] DreamHost runs a daemon that kills applications that use too much memory. From my testing, it appears that when you run multiple sites under the same user, for instance, a Rails application and a PHP application, then the Rails application will frequently get killed when the combined memory use exceeds somewhere in the neighborhood of 125MB. However, it appears that the daemon only monitors on a per user basis as I am able to run a Rails app under one user account, a Perl FastCGI app under another, and a PHP app under a third all simultaneously without issue.
"http://wiki.dreamhost.com/Killed":http://wiki.dreamhost.com/Killed