Troubleshooting
While Typo isn't all that complex of an application, it can be challenging to install in some environments. Shared hosting providers like Dreamhost and Textdrive can be especially challenging for many users.
Here are a few debugging steps that we've found to help when problems occur. We'll assume that you're trying to run Typo in production mode under Apache, although most of the steps are the same for other HTTP servers.
The most common error that we see is people who are completely unable to access Typo at all, receiving a '500' error from Apache and a statement like "Application Error / Typo could not be reached". There are a number of different things that can cause this error. Here are a few things to try:
1. Run public/dispatch.fcgi by hand from the command line. If this fails with an error like "can't find interpreter for public/dispatch.fcgi" then check out the first line of the file. Verify that you have Ruby installed and edit dispatch.fcgi to have the first line match. Make sure that there isn't a hidden carriage return at the end of the first line--this can happen if you upload Typo via Windows. Run 'cat v public/dispatch.fcgi | head -1' and make sure that there's no hidden '^M' at the end of the line. If this still fails to get dispatch.fcgi working, then try running 'ruby public/dispatch.fcgi'. If that works then spend another minute or two looking at the first line of dispatch.fcgi-it's probably still wrong. If that doesn't help, then send mail to the Typo mailing list with as many details as possible, and we'll see what we can do.
2. Look at your Apache logs, especially the error.log. This will frequently contain much more error detail then you see via your web browser.
3. Look at Typo's log files. They're in log/production.log and log/fastcgi.crash.log.
4. Verify that your web user has write access to log/* and public/*.
5. Verify that you have the ability to use .htaccess files, and that Apache is seeing the one in public/.htaccess. Typo needs several lines from this file in order to work correctly.
6. If you're running Typo in a subdirectory of your web server, then see TypoInSubdirectory.
7. If you are getting null headers, check more closely your database config. Be sure that the database driver for Ruby is installed. u/p
8. If you are using MySQL 5.0 check out this fix for Active Record
9. Make sure your database permissions are set up correctly. Ex., if MySQL is used, is your user and host set up to access your database?
10. Make sure your database config are set up correctly. Run script/console by hand from the command line. Execute "Article.find(:all)". If this fails with an error like 'Errno: ENOENT: No such file or directory - /tmp/mysql.sock' maybe you must set socket in config/database.yml. Ex: 'socket: /var/run/mysqld/mysqld.sock'.
Specific Errors
- If you get an error like the following...
/usr/lib/ruby/1.8/cgi/session/pstore.rb:25:in @[]='
clear your "sessions" table to correct the problem.
- If you unpack Typo on a Windows system, edit public/dispatch.fcgi and then copy it to a UNIX system, requests may timeout
Further if you try to run public/dispatch.fcgi from your shell you get an error like...
sh: no such file or directory: public/dispatch.fcgi
The line-endings in public/dispatch.fcgi are DOS-type rather than UNIX-type because of the edit. Open the file with
vim public/dispatch.fcgi
and either delete the ^M in the first line or if there isn't one type:set fileformat=unix
, thenzz
, this should fix the line endings.
- If your posting times are different between the "public" blog interface and the admin interface you might want to check the timezone settings of your server and client. Typo uses Javascript to calculate the
posted X minutes ago
passages and as such the browser timezone matters there vs. server timezone in the admin interface
- If you use McAfee brand virus scanners and it detects
JS/Exploit-CrossSite
, there is in fact nothing wrong at all. One of the files in source:trunk/vendor/bluecloth/tests has a lot of x's in it. It appears a particular series of x's and whitespace triggers this out-of-place virus warning from McAfee's products. Please contact McAfee for a fix to this issue if it bothers you.
Upgrading from 2.5.3 to 2.6.0
- Download typo 2.5.3
- Extract it on your webserver
- Copy config/database.yml from your old typo install into your extracted 2.5.2 directory
- Bring down your apache/lighttpd/webrick instance that's serving your typo installation.
- Run rake migrate RAILS_ENV="production" in your new typo directory.
- move your old typo install outta the way
- mv typo typo-2.0.6
- mv typo-2.5.3 typo
- Bring your apache/lighttpd/webrick instance back up
- Login to the /admin/ url on your blog and look at all the new administrative features.
- Enjoy the new typo.
- Note, all the templates and stylesheets have changed, if you modified yours then go look in typo/theme/layouts for your article layouts and related files.
Typo 2.5.6 Installed on InstantRails (quick step by step)
Via the mailing listTypo + SCGI + Apache2
Ok, I had some problems using Typo in conjunction with scgi and Apache2. Using the proposed config from the SRR tutorial resulted in not working themes. So i added another rule which seems to work:
# handle all requests throug SCGI
SCGIMount / 127.0.0.1:YOUR_PORT
<LocationMatch \..+$>
# don't handle those with SCGI
SCGIHandler Off
</LocationMatch>
<LocationMatch ".+/theme/.+">
# don't handle those with SCGI
SCGIHandler On
</LocationMatch>
<Directory "/YOUR_PATH/typo/public">
Options +FollowSymLinks
Order allow,deny
allow from all
</Directory>
I hope it helps.
Random Problems
RewriteBase in Apache2 on Ubuntu Breezy was giving me issues. For some reason, its not processing correctly. While I can load the content of the page, the themes, javascript, etc. fail. I'm sure it has to do with the fact that I'm hosting about six different sites, all name based, of one box, but whatever. Editing public/.htaccess to include /typo/ in front of each rewrite rule fixed the problem. For example, one line in my .htaccess now looks like this:RewriteRule ^([^.]+)$ /typo/$1.html [QSA]
Also, I've got an issue with FastCGI (I'm still working on this one...), but this seems to work. Edit the public/.htaccess again, and change the top to:
#AddHandler fastcgi-script .fcgi AddHandler fcgid-script .fcgi
Hope this helps someone avoid my pain :).
Error on the article page when using the Origami theme
When using Origami v1.0, you might get an error when you view an article. The solution is simple: edit
themes/origami/views/articles/read.rhtmland change
full_htmlto
body_html.
