About Us  |  Blog  |  Hosting Partners  |  Legal  |  Portal Login

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> RAILS_ENV and mod_fcgid
mta
post Aug 7 2007, 01:21 PM
Post #1


Celery
*

Group: Members
Posts: 40
Joined: 29-September 05
Member No.: 18,419



We have setup several high security ruby on rails sites using mod_fcgid.

Within these sites, we need to set the variable RAILS_ENV to development, staging, and production on the respective servers. Because we use svn to manage and populate the sites, it is not desirable to set RAILS_ENV in config/environment.rb, or even in dispatch.fcgi. RAILS_ENV needs to be set at the FastCGI level.

We are having difficulty accomplishing this. According to information received in a reply to a post to the mod_fcgid mailing list, this is due to Apache suexec's restriction of the environment variables that can be set.

However, we are able to accomplish this by replacing mod_fcgid with mod_fastcgi - not sure why.

Has anyone here experienced similar problems with mod_fcgid and Ensim and found a solution?

Suggestions greatly appreciated.

Michael
Go to the top of the page
 
+Quote Post
mta
post Aug 7 2007, 02:04 PM
Post #2


Celery
*

Group: Members
Posts: 40
Joined: 29-September 05
Member No.: 18,419



As I was explaining to someone earlier, all variables beginning with HTTP_ are accepted by suexec.

Therefore adding the following line to config/environment.rb appears to be a workable solution:

ENV['RAILS_ENV'] ||= ENV['HTTP_RAILS_ENV']

I then changed my Apache directive to state DefaultInitEnv HTTP_RAILS_ENV staging
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 9th February 2010 - 10:46 AM
 

Dedicated Servers

Managed Hosting

Colocation

Business Solutions

Why The Planet?

Contact Us