Installing Typo in the root of your domain on Site5

Posted by Matt Osentoski Tue, 02 Jan 2007 19:42:00 GMT

Site5 has an automated process for adding Typo blogs to your website. This works fine except the blog is created in a directory off of the domain. For example: www.test.com/blog instead of www.test.com. Follow the steps below to install Typo into the root of your domain. This process should also work for your own custom Rails apps.

1. Setup SSH access on your Site5 account. Contact: shared@site5.com.

2. Download the latest version of Typo at: http://rubyforge.org/projects/typo/

3. Create a directory for your Rails applications. SSH into your account and create a rails_apps directory.
	> cd ~
	> mkdir rails_apps
4. SFTP your Typo file into the rails_apps directory you just created. The directory should be something like: /home/your_site_name/rails_apps

5. Expand the Typo file. SSH back into your account and issue the following commands:
	> cd rails_apps
	> gunzip -c typo-4.0.3.tar | tar xvf -
(NOTE: replace typo-4.0.3.tar with the name of the file you grabbed from rubyforge.org.)

6. Rename the original public_html directory.
	> cd ~
	> mv public_html public_html_orig
7. Create a symbolic link to typo's public directory.
	> cd ~
	> ln -s /home/your_site_name/rails_apps/typo-4.0.3/public public_html
8. Create the Typo database and database user. Login to the SiteAdmin for your account and create a new database user and database. Make sure you give the user the appropriate rights to the database you just created.

9. Prepopulate the typo database. (NOTE: This can also be accomplished using the import function in phpMyAdmin from SiteAdmin.)
	> mysql -u sitename_username -p
	use your_database_name
	source /home/your_site_name/rails_apps/typo-4.0.3/db/schema.mysql.sql
10. Modify the environment.rb file. This file should be located at:
/home/your_site_name/rails_apps/typo-4.0.3/config/environment.rb
Uncomment the following line:
ENV['RAILS_ENV'] = 'production'
Then add the RAILS_ROOT after:
RAILS_ROOT = '/home/your_site_name/rails_apps/typo-4.0.3'
11. Modify the database.yml file. This file should be located at:
/home/your_site_name/rails_apps/typo-4.0.3/config/database.yml

Modify the entries for the production application using the database information from Step 8.

12. Verify your .htaccess file. Located at: /home/your_site_name/rails_apps/typo-4.0.3/public/.htaccess
This file should contain the following lines:
RewriteEngine On

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
13. Restart dispatch.fcgi. From a command prompt, run the following line:
	> pkill -9 -u your_username_here -f dispatch.fcgi
(NOTE: replace your_username_here with the username you used to SSH into the server.)

You should be all set! Try to access your domain, you should be greeted with the Typo setup screen.

Posted in  | Tags , ,  | no comments