Project

General

Profile

Can't make Redmine start in production

Added by Andreatta Sébastien over 11 years ago

Hello,

I searched on google without much success. I can't make Redmine start in production .

I'm on centos 6.3 with redmine 2.1.2 ( ruby : 1.8.7.352-7 , Rails : 3.2.8, MySql : 5.1.66-1 and apache : 2.2.15 with mod_passenger : 3.0.17 ) .
I followed this howto

But when i try to access Redmine i have this in the apache error log :

Rails Error: Unable to access log file. Please ensure that /var/www/html/vm.local/projects/log/development.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
OpenIdAuthentication.store is nil. Using in-memory store.
usr/lib64/ruby/gems/1.8/gems/activerecord-3.2.8/lib/active_record/connection_adapters/mysql_adapter.rb:411:in `real_connect': Access denied for user 'root'@'localhost' (using password: NO) (Mysql::Error)

I don't have a development instance.. I tried this :

echo "Rails.env.production?" >> /var/www/projects/config/environment.rb
RAILS_ENV="production" && touch /var/www/projects/restart.txt

And this :

<VirtualHost *:80>
        ServerAlias projects.localhost
        DocumentRoot /var/www/projects/public
        ServerName projects.localhost
        RailsEnv production
RAILS_ENV=production script/about

Environment:
  Redmine version                          2.1.2.stable
  Ruby version                             1.8.7 (x86_64-linux)
  Rails version                            3.2.8
  Environment                              production
  Database adapter                         MySQL
Redmine plugins:
  no plugin installed

Could you help me please ?

( Sorry for the basic english, and sorry if the solution was already been given, but I could not find )

Thanks


Replies (4)

RE: Can't make Redmine start in production - Added by Attila Bujáki over 11 years ago

Hi!

I think first you should fix the problems associated to the user rights. You should use chmod
to do this. (This is just to enable logging.)

Database connection - you can find a configuration file describing connection settings for redmine.
It is in config/database.yml

I think you should check the settings in this file, whether they are valid both for production and
development environment.

This looks like this for me:

# Default setup is given for MySQL with ruby1.8. If you're running Redmine
# with MySQL and ruby1.9, replace the adapter name with `mysql2`.
# Examples for PostgreSQL and SQLite3 can be found at the end.

production:
  adapter: mysql
  database: bitnami_redmine
  host: localhost
  port: 3306
  username: bitnami
  password: pass
  encoding: utf8

development:
  adapter: mysql
  database: bitnami_redmine
  host: localhost
  port: 3306
  username: bitnami
  password: pass
  encoding: utf8

...

I am very new to redmine, but I think this error message you get means that the database server refusees your connection.
This is should be easily solved by using correct credentials to authenticate against the database server. Have luck! :-)

RE: Can't make Redmine start in production - Added by Andreatta Sébastien over 11 years ago

I know that, i can make redmine working but only if i have a valid development environement defined.

I just don't know how to tell redmine that i want to use "production" only

Thanks for your reply

RE: Can't make Redmine start in production - Added by Andreatta Sébastien over 11 years ago

Basically I do not know where to set the environment variable RAIL_ENV
As shown early on I tried several things

RE: Can't make Redmine start in production - Added by Andreatta Sébastien over 11 years ago

Since this commit the ENV['RAILS_ENV'] ||= 'production' is missing in environment.rb, so what is the recommended method to set the environment to production ?

Thanks a lot

    (1-4/4)