Project

General

Profile

Help with changinge Redmine 2.4 to Production Mode

Added by Jim T about 10 years ago

I'm running RHEL 6.5, Redmine 2.4 with Apache and FCGI. I can't get Redmine to run in production mode, it will only run in development mode. I've tried adding RAILS_ENV production values in various places but it hasn't worked.
Does someone know the secret dance to fix this?

Thanks


Replies (9)

RE: Help with changinge Redmine 2.4 to Production Mode - Added by Marco Gutsche about 10 years ago

What is the error message when you start redmine in production mode?

RE: Help with changinge Redmine 2.4 to Production Mode - Added by Jim T about 10 years ago

There is no error, it just starts in development mode. I only know that it is in development mode because the log/development.log is being written to. My concern is that this is a lot of data and I don't know what else happens in development mode.
I have tried changing config/environments/development to be the same as production, setting RAILS_ENV in various files and using SetEnv in the apache conf.

RE: Help with changinge Redmine 2.4 to Production Mode - Added by Marco Gutsche about 10 years ago

I've set the mode in my apache VirtualHost configuration file:

....
RailsEnv production
....

RE: Help with changinge Redmine 2.4 to Production Mode - Added by Jim T about 10 years ago

I'm not using passenger so I don't have the RailsEnv parameter in the apache conf. I did try SetEnv but that didn't work.

RE: Help with changinge Redmine 2.4 to Production Mode - Added by James H about 10 years ago

does it run webrick fine in production mode?

RE: Help with changinge Redmine 2.4 to Production Mode - Added by Jim T about 10 years ago

It is very slow but it does run in production mode. Speed isn't a problem through apache.

RE: Help with changinge Redmine 2.4 to Production Mode - Added by James H about 10 years ago

I assume you have already looked at:
http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Apache_to_run_Redmine

I think the only thing that will put your redmine into production or development mode is:

ENV['RAILS_ENV'] ||= 'production'

Not sure if there's another option when using just Apache.
I am on Win7, so I set my Rails_Env environmental variables to production.

Set RAILS_ENV = production

Maybe someone else can clarify.

If your webrick works fine in production mode, then the only issue I can see would be your Apache configuration.
Any particular reason why you are trying to use just Apache?
I would suggest that you think about using Passenger, Thin, or Unicorn with Apache. In my experience, it was far easier to set up Redmine using those than it was to set it up with just Apache (although I think that's weird since they require Apache).

Otherwise, you can just get rid of all the settings for "development" mode and force redmine to run "default" or default as "production." I.E. delete the "development:" section in "database.yml"

RE: Help with changinge Redmine 2.4 to Production Mode - Added by Jim T about 10 years ago

Thanks James but I have followed those instructions, I have tried adding ENV['RAILS_ENV'] ||= 'production' to various places including environment.rb, boot.rb, application.rb. This isn't in the environment.rb file as the doco says so I've tried adding it.
I've tried using Apache SetEnv as well but it hasn't worked.

If I remove the development sections from database.yml do I have to run command for the change to be picked up?

I'm only using APache with fcgi because of the limited environment I am working in and I am unable to build the other systems (passenger, thin etc). Well not completely unable but it is extreamly difficult. Also the only problem with my current set up is that it's running in development mode.

RE: Help with changinge Redmine 2.4 to Production Mode - Added by Jim T about 10 years ago

Its working now.

for mod_fcgid you need to use the following in the apache conf:
FcgidInitialEnv RAILS_ENV "production"

    (1-9/9)