DreamHost Installation
Note: This is for installing typo on the top level of your domain with one database. Also see http://wiki.dreamhost.com/index.php/Typo
Pre-Installation:
Before installing typo you need to go to The DreamHost Control Panel and set up a few things- Go to Domains > Manage Domains > [Select Domain to edit] > Web and edited the domain you want to install typo on
- Change the Web Directory to yourdomain.com/public
- Go to Goodies > MySQL and add a new database
Installation:
- Go to the phpMySQLAdmin address for your database
- Should be the same as the hostname you configured when adding a new database. If the server is not yet accessible -- it can take hours for the DNS changes to propagate -- you can do it via SSH, with the command "mysql -u thedatabaseuser -p -h thesqlserver.yourdomain.com thedatabase < typo/db/schema.mysql.sql" Note that everything goes on the same line.
- Click on the database name in the left section of the screen
- Click on the SQL tab and find the location to typo/db/schema.mysql.sql and upload it
The database layout should now ready.
Note: Typo 2.6.0 does not support Rails 1.1.x | Current Versions (svn) will work with 1.1.x
- To install Typo, log into your dreamhost SSH server (user@hoover.dreamhost.com)
- The following command will install the current SubVersion of Typo to a directory you choose, make sure the directory is one up from /public (Example: ~/typo/ not ~/typo/public)
svn checkout svn://typosphere.org/typo/trunk filenamehere
- The following command will install the current SubVersion of Typo to a directory you choose, make sure the directory is one up from /public (Example: ~/typo/ not ~/typo/public)
- Congradulations! You just installed Typo! Give yourself a pat on the back!
- Now edit the database.yml file in typo/config to match your database information
- If you are using one database, just make production, test, and development the same
- Fill in the database host details
- The hostname is whatever you chose while you were configuring your database in the DreamHost panel (dbname._yourdomain.com_)
- Specify a port value of 3306 (you cannot specify a socket on some servers)
- Fill in the username and password with the values you entered when creating your database
rake db:migrateor
rake migrate RAILS_ENV=production** If you run into problems with the
rakeprocesses hanging, you may want to fill those tables from within the mysql client, e.g.
mysql -u your_db_user -p -h mysql.your.domain mysql> create database typo; mysql> source db/schema.mysql.sql;
- Edit the first line of the following files from " #!/usr/bin/env ruby " to " #!/usr/bin/ruby "
- typo/public/dispatch.fcgi
- typo/public/dispatch.rb
- Change the permissions of the /_yourdomain.com_/public directory, public/dispatch.fcgi and public/dispatch.rb to 755
- Change the permissions of /_yourdomain.com_/log to 666
Post-Installation:
- In a web browser go to yourdomain.com and create your login and edit your preferences
- Modify your .htaccess to expose the dreamhost statistics package. It should look like the following
AddHandler fastcgi-script .fcgi AddHandler cgi-script .cgi Options +FollowSymLinks +ExecCGI RewriteEngine On RewriteCond %{REQUEST_URI} ^/failed_auth.html$ [OR] RewriteCond %{REQUEST_URI} ^/stats/(.*)$ RewriteRule .*$ - [L] RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] # In case Typo experiences terminal errors # Instead of displaying this message you can supply a file here which will be rendered instead # # Example: # ErrorDocument 500 /500.html ErrorDocument 500 "<h2>Application error</h2>Typo failed to start properly"I found that .htaccess to just leave the index of the directory open so I use the following:
RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/stats/(.*)$ RewriteCond %{REQUEST_URI} !^/failed_auth.html$ RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
Intermittent 500 errors ("Typo could not be reached")
- Try some of these tactics: [http://work.alexyoung.org/archives/102/dreamhost-and-rails-500-errors]
