Archive for the 'Uncategorized' Category

Dec 06 2009

Installing Sinatra on Site5 Passenger

Published by Stephen under Uncategorized

This is a just a quick note about how to deploy Sinatra on Site5.com Passenger

Gems

My gems are installed in my user folder:

INSTALLATION DIRECTORY:

  • ~/.gem/ruby/1.8
GEM PATHS:
- /home/it808com/.gem/ruby/1.8
- /usr/lib/ruby/gems/1.8

GEM PATHS:

  • ~/.gem/ruby/1.8
  • /usr/lib/ruby/gems/1.8

In my public_html/sinatra_app/.htaccess

# Phusion Passenger Start
PassengerEnabled on
PassengerAppRoot ~/public_html/sinatra_app
RackBaseURI /sinatra_app
# Phusion Passenger End

My sinatra_app folder consists of

app.rb
config.ru
public/
tmp/

Getting my gems into the sinatra environment requires 2 lines in the config.ru file

ENV['GEM_HOME'] = '~/.gem/ruby/1.8'
ENV['GEM_PATH'] = '~/.gem/ruby/1.8:/usr/lib/ruby/gems/1.8'

require 'rubygems'
require 'sinatra'
require 'app'
run Sinatra::Application

My app.rb looks like

get '/' do
  "Hello World #{Time.now.utc} #{params.inspect}"

end

No responses yet

Jul 22 2009

Site5 Wordpress Phusion Passenger and Rails

Published by Stephen under Uncategorized

I recently created a little toy rails app to see how easy it was to bring up rails with Site5’s Phusion Passenger. Following the instructions at first everything went as planned and my rails app was working flawlessly.

A few days later I was writing a 2nd rails app and noticed a Wordpress 404 error whenever I asked for a route other than the root URL. I tried my original rails app and it was broken also. I hadn’t touched a thing.

After a chat session with Site5 support (awesome response), it wasn’t resolved. Their level 1 support said it was my .htaccess file, and provided no other help (poor response).

After opening a ticket myself and providing them my .htaccess, environment.rb and symlink they again said it was my .htaccess file, but this time it was my public_html .htaccess file that was wrong. But still no other url or hint.

Turns out my public_html .htaccess file has some wordpress rewrite rules in it. I needed to exclude the rails subdirectories so that wordpress wouldn’t see them.

Here’s what I added to my public_html .htaccess
RewriteCond %{REQUEST_URI} !^/rails_app_name/

One response so far

Jul 11 2009

Setting up github from Site5

Published by Stephen under Uncategorized

After setting up my account at github I created my first repository and followed their directions for configuring my local copy.

Things were going well but I got stuck on the public key portion. The rest of this is what I did to complete the configuration:
Followed the steps in the github for adding public keys

My first problem was this error when I tried to git push

Permission denied (publickey).

I had to follow these steps to generate my public key correctly

ssh-agent /bin/bash
ssh-add (without the .pub)

Now I could push to github.

No responses yet

Jul 05 2009

Wpremix3 and Site 5 permissions

Published by Stephen under Uncategorized

I just spent several hours looking at a error code 500 for a wpremix3 style.php page in Firebug. When I tried the url manually I got the same error with a generic Apache error page.

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Resolution:

This post in the Site 5 forums lists the correct folder and file permissions.

I set the permissions for wpremix folder to 755 and files to 644. Problem solved.

No responses yet