This forum is no longer active. Please post your questions to our new community site

Passenger with remote MySQL

Subscribe to Passenger with remote MySQL 6 post(s), 2 voice(s)

 
Avatar galaxygaming... 4 post(s)

I’ve installed RubyStack-2.0-1 on Ubuntu 9.10 running within Amazon EC2 server. My rails app is using the Amazon RDS service.

Everything works with Mongrel, but Passenger trys to use the local MySQL rather than the remote server.

What am I missing? Shouldn’t the database.yml of the rails app define both Mongrel and Passenger?

Thanks in advance,
Dan

 
Avatar danoo Administrator 81 post(s)

Hi,

can you please copy&paste your database.yml file here ? Do you use the same RAILS_ENV setting for both Mongrel and Passenger ?

Cheers,
Danoo

 
Avatar galaxygaming... 4 post(s)

Yes, using the same app and database.yml for both mongrel and passenger configurations, so don’t understand why it would be different. Here’s the database.yml with the names and pwd edited out. Nothing unusual, and it works for mongrel, but passenger gives an error that it can’t connect with tmp/mysql.sock which is the local copy.

  1. Database configuration file
    development:
    adapter: mysql
    database: xxx_development
    username: xxxx
    password: xxxx
    host: xxxx.c3j0t7pxllez.us-east-1.rds.amazonaws.com
    port: 3306
  2. Warning: The database defined as ‘test’ will be erased and
  3. re-generated from your development database when you run ‘rake’.
  4. Do not set this db to the same as development or production.

test:
adapter: mysql
database: xxx_test
username: xxx
password: xxx
port: 3306

production:
adapter: mysql
database: xxx_production
username: xxx
password: xxx
port: 3306

 
Avatar danoo Administrator 81 post(s)

You know Passenger runs with RAILS_ENV=production by default ? Are you changing this default behavior in Apache config file ?

Danoo

 
Avatar galaxygaming... 4 post(s)

Thanks for the comment, and no, I am not changing it in the Apache file. Are you recommending I should?

 
Avatar galaxygaming... 4 post(s)

Thanks for the suggestion, adding the RailsEnv setting to the Apache VirtualHost seemed to fix the strange passenger errors.