Welcome Guest | Login

Install and Deploy Typo on HostingRails.com



This is a wiki article created by HostingRails users. Please login or signup to make edits.


    This tutorial shows you how to install the most recent 'bleeding edge' Typo version into a folder named 'typo' at your root directory to be run as the main application of a domain or subdomain.  If you need to save space (or the lastest SVN version is not stable) it is recommended to wget a stable version and install via the basic steps of this tutorial.  

----
Update:
You can wget Typo 4.1.1 from
http://rubyforge.org/frs/download.php/20466/typo-4.1.1.tgz

Also, Mongrel is required if you are using the Typo gem.  If you don't have dedicated memory with your account you need instead just download the typo.tgz and install it like any other rails application.
----




Login via SSH to your account and make your way to the command line. Stay at your root directory (/home/username/) and:

[~]# svn checkout http://svn.typosphere.org/typo/trunk typo
This will quickly dump the latest version of Typo into the folder 'typo'.



Rename the public_html directory (for backup) and create a symlink to the public folder of Typo:

[~]# mv ~/public_html ~/public_html_backup
[~]# ln -s ~/typo/public ~/public_html


Create a database to house typo and assign it a user.  For the the purpose of this tutorial let's say we created the database 'typo' with the username 'typouser' - note that the server automatically changes these names to 'username_typo' and 'username_typouser'.



Make for yourself a ~/typo/config/database.yml that looks like this:

login: &login
 adapter: mysql
 host: localhost
 username: username_typouser
 password: ******
 
development:
 database: typo_dev
 <<: *login

test:
 database: typo_tests
 <<: *login

production:
 database: username_typo
 <<: *login
and make sure it is indeed uploaded to the ~/typo/config/ folder



Double check that your ~/typo/config/environment.rb has this line uncommented (which it should):

      ENV['RAILS_ENV'] = 'production'


Make yourself a directory entitled ‘cache’ in your ~/typo/ directory and chmod it (and the log folder) to 777. Also make sure the ‘public’ directory is executable (chmod 755).



Populate your typo database with:

[~/typo]# rake db:migrate RAILS_ENV=production


Next, you need to change the shebang lines in ~/typo/public/dispatch.fcgi & ~/typo/public/dispatch.rb to:

#!/usr/local/bin/ruby
Then, change the permissions of those files by running:

[~/typo/public]# chmod 755 disp*
And in ~/typo/public/.htaccess, comment out the following line:

AddHandler fastcgi-script .fcgi
And that's it. You should be able to point your browser to your domain (or subdomain) and all should be working. If not, ask a question in the forums.  



EXTRAS / GOTCHAS:

A note on permissions from the Typo README:

"Typo needs write access to several directories in order to function correctly. These need to be writable by the user that runs the Typo process--in a hosted environment this may be your user; on dedicated systems it may be something like 'httpd' or 'www-data'.

The specific directories in question are 'log/' (and everything underneath it), 'cache/', and 'public/'. Strictly speaking, Rails will continue to work if public isn't writable, but Typo's page caching code will work properly and this will cause Typo to be slower and use much more CPU time. For the security conscious, Rails really only needs the ability to change a half-dozen files
and subdirectories under public/, ask on the Typo mailing list for more details."



Hello Guest! In order to edit this article you must be an active client with us, please log in or sign up today!






Contributing Author(s):
William
Brian
Codejoy
Willc