Rails with passenger only work in development

I have a problem with one of our web servers. I will try to explain this as clearly as possible, but I do not know 100% of the entire server configuration.

There are 2 sites working next to eachother (blcc_preprod and blcc_prod), so in the "support sites" apache I have the file "blcc" as follows:

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

My config / environment / production.log (from both) looks like this (I deleted all the comments because it is a mess 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 

It is strange that my production journal dates back months ago, so something is really wrong.

Can anyone help? If you need more information, just ask.

Thanks!

Edit: Error.log from apache shows the normal output for the event on the server (the situation here is that the web server is connecting to another business server through a java server) Access.log is empty

The content from other_vhosts_access.log after we go to ip / blcc_preprod is as follows

 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)" 
+4
source share
3 answers

The error refers to an internal error.

So:

 tail -f /var/log/apache2/error_log 

And try to access the site.

Errors go there because Passenger cannot initialize the Rails application, so it believes that the error is something outside of your application. Most likely, the module is missing or something is initialized incorrectly.

+1
source

Using RoR 3.x?
Try

 RackEnv development 

or

 RackEnv production 
+1
source

I don’t think that you can configure two applications on the same virtual host running in different Rails environments - at least not so.

The passenger documentation states the following for the RailsEnv parameter:

β€œIn each place, it can be indicated no more than once . The default is production.”

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

So, there is no way for one VirtualHost directive to point to multiple RailsEnv.

This may be the reason that you see only one application (although, I'm not sure why it is developing).

I suggest that you either separate production / development applications in separate VirtualHosts, or use a 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
source

Source: https://habr.com/ru/post/1310475/


All Articles