开发者

Rails with passenger only runs in development

开发者 https://www.devze.com 2022-12-31 18:57 出处:网络
I have a problem on one of our webservers. I\'ll try to explain it as clear as possible, but I\'m not 100% a开发者_如何学运维ware of all the configuration of the server.

I have a problem on one of our webservers. I'll try to explain it as clear as possible, but I'm not 100% a开发者_如何学运维ware of all the configuration of the server.

There are 2 sites running next to eachother (blcc_preprod and blcc_prod), so in the 'sites-enabled' of apache this i have a file 'blcc' like this:

<VirtualHost *:80>
    DocumentRoot /opt/dn/blcc/www
    RailsBaseURI /blcc_preprod
    RailsBaseURI /blcc_prod
    RailsEnv production
</VirtualHost>

My config/environments/production.log (from both) looks like this(I removed all comments, because it messes with the layout)

config.cache_classes = true

config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching             = true
config.action_view.cache_template_loading            = true

config.log_level = :debug

The weird thing is, that my production log dates from months ago, so something is really wrong.

Could someone help? If you need more info, just ask.

Thanks!

Edit: Error.log from apache show the normal output for a event to the server (the situation here is that the webserver plugs in to another business (java) server via a framework) Access.log is empty

Content from other_vhosts_access.log after we surf to ip/blcc_preprod is the following

blcc.localdomain:80 192.168.21.194 - - [25/May/2010:08:33:04 +0200] "GET/ blcc_preprod
HTTP/1.1" 500 594 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET 
CLR 1.1.4322; .NET CLR 2.0.50727)"


Error refers to internal error.

So:

tail -f /var/log/apache2/error_log

And try to access the site.

The errors goes to there because Passenger isn’t able to initialize the Rails application, so it thinks error is something outside your application. Most likely a module is missing or something is initialized wrong.


Using RoR 3.x ?
Try

RackEnv development  

or

RackEnv production  


I don't think it's possible to setup two apps in one virtual host working in different Rails environments - at least not like this.

Passenger documentation says following for RailsEnv setting:

"In each place, it may be specified at most once. The default value is production."

(http://www.modrails.com/documentation/Users%20guide.html#rails_env)

So, there's no way for one VirtualHost directive to multiple RailsEnv specified.

This might be the reason why you are seeing only one app running (although, I am not sure why it's development).

I suggest that you either separate production/development apps in separate VirtualHosts or you could use block. Maybe something like this:

<VirtualHost *:80>
  DocumentRoot /opt/dn/blcc/www
  RailsBaseURI /blcc_preprod
  RailsBaseURI /blcc_prod

  <Location /blcc_preprod>
    RailsEnv development
  </Location>

  <Location /blcc_prod>
    RailsEnv production
  </Location>
</VirtualHost>
0

精彩评论

暂无评论...
验证码 换一张
取 消