views:

181

answers:

3

Hey, I have a problem on one of our webservers. I'll try to explain it as clear as possible, but I'm not 100% aware 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)"
A: 

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>
Slobodan Kovacevic
Hmm, maybe I wasn't as clear as I thought.The two apps run perfectly next to eachother in development. So when i add 'RailsEnv "development"' it works perfect. (When I surf to ip/blcc_preprod and ip/blcc_prod, both are accessible)But when I want to switch to production neither works
Ignace
Ah, quite different question. :) Do you get any response from server? You said that Rails app production logs (log/production.log) don't log any errors; did you check Apache logs (error_log and access_log)?
Slobodan Kovacevic
Yes I did, acces_log is empty, error_log produced something that looked like a normal startup, but nothing much else.We do work here with a remote business server that rails plugs into via a framework.Error log show that he registers everything, uses a pool and then nothing more...Very strange...
Ignace
I've edited the original post with logging info
Ignace
And there isn't anything in Rails app log dir? I don't understand completely what type of the setup you have, but I would guess that this is not a Ruby/Rails code issue - more likely you are having problems with "remote business server that rails plugs into via framework". Maybe you could try and post your question on http://serverfault.com/ (Stack Overflow site for server related questions).
Slobodan Kovacevic
+1  A: 

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.

Smar
A: 

Using RoR 3.x ?
Try

RackEnv development  

or

RackEnv production  
Norbert Vieten