Any plug-ins similar to mongrel_proctitle for Phusion passenger - ruby-on-rails

We migrated our rails app. from Mongrel to Phusion Passenger recently. We had this mongrel_proctitle, which used to show the process title in top.
This was useful feature for troubleshooting. Are there anyway of getting similar functionality with Phusion Passenger?

Passenger already automatically sets useful process titles. All your Ruby apps are called "Passenger RackApp: /path-to-your-app". If you need to obtain statistics, just run passenger-status.

Related

Phusion Passenger RequestHandler issue

I'm running ror app(rails 2.3.5,ruby 1.8.7) on my vps.
Whenever I restart my apache server all the working subdomains are going down. I've passenger version as 4.0.5, I wonder what would be the reason. I'm pasting my apache error log
Check this page on the Phusion Passenger wiki for solutions.
Also, you should upgrade to the latest version (4.0.29) which fixes many bugs and brings many improvements. The error message in the latest version actually links to the page that I linked to.

Error using Passenger with RVM: "Passenger RequestHandler warning: someone tried to connect with an invalid connect password"

As we (finally) port our apps away from Ruby 1.8.7, I am trying to set up Phusion Passenger and Apache, with RVM, to serve apps using both Ruby 1.87/Rails 2.3.x and Ruby 1.9.3/Rails 3.2.x. This is all on my development machine; in production we us separate VMs to serve the two different platforms--but needless to say, that would be inconvenient in development.
The Good: I've got Passenger 3.0.7 installed using Ruby 1.8.7 (and RVM), and 1.8.7/Rails 2.3.x apps work great as they have in the past (the only thing changed from my past setup is having (re)installed Passenger via RVM).
The Bad: I also have installed Passenger 4.0.20 as a gem using Ruby 1.9.3 (and RVM), and if I configure Apache to use them, it is able to serve up a 1.9.3/Rails 3.2.x app just fine. But Passenger can't serve the Ruby 1.8.7/Rails 2.3.x app.
Another developer here has essentially the same setup working but we are unable to see any clear differences between her installation and mine. But her success tells me it is possible.
The Ugly: When I try to run the 1.8.7/2.3.x app with Passenger 4.0.20, Passenger logs a bunch of output to the Apache error.log, including these lines:
[ 2013-10-22 13:12:30.1770 21240/7fe89ad0e700 Pool2/SmartSpawner.h:301 ]: Preloader for /home/username/workspace/app started on PID 21284, listening on unix:/tmp/passenger.1.0.21232/generation-0/backends/preloader.21284
[ 2013-10-22 13:12:30.2547 21240/7fe89ac8c700 Pool2/Implementation.cpp:1274 ]: [App 21284 stderr] [ 2013-10-22 13:12:30.2547 21385/0x7f9bf1fd0b80(Worker 1) request_handler/thread_handler.rb:197 ]: *** Passenger RequestHandler warning: someone tried to connect with an invalid connect password.
It's the last bit (scroll to the right!) that seems the most bizarre.
Some online searching reveals that Passenger supports some sort of 'connect password' but we are using no such thing. There are few Passenger-related references to 'someone tried to connect with an invalid connect password' outside of the Passenger source code.
I actually have solved this problem, but due to the dearth of references on the web, and my failure to find any mention of the 'invalid connect password' error here on SO, I am posting this to help the next person. I haven't included lots of other log snippets, configuration file contents and the like, because I have already mentioned all the relevant information.
If you think you know the answer, here's your chance to get some more 'reputation'. Otherwise, I'll post my answer in a couple days.
Phusion Passenger author here. The connect password is a security mechanism in Phusion Passenger to prevent unauthorized processes on the local system to connect to the spawned application processes. The connect password is only known to the HelperAgent, the app process and admin tools like passenger-status.
I'm not sure what went wrong in your case. I'd like to analyze your problem more deeply. Could set PassengerLogLevel to 3, trigger the problem, and post the contents of your Apache error log file to the community discussion forum?
I found my answer in a passing remark on the Passenger forum.
Quoting my question, here is the real problem: "I also have installed Passenger 4.0.20 as a gem using Ruby 1.9.3 (and RVM)..."
I was able to solve it by re-installing Passenger 4.0.20 as a gem using Ruby 1.8.7 (and RVM). With this configuration, Passenger is able to serve up both Ruby 1.8.7 and Ruby 1.9.3 applications.
I have read that in addition to its mainly-native code, Passenger uses a bit of Ruby internally, interpreted by whatever version of Ruby it was installed with. Apparently (and wonderfully) this Ruby code is compatible with Rubies as ancient as 1.8.7. Equally wonderful, it will serve up applications with whatever Ruby their PassengerRuby directives specify... but apparently this isn't the case if Passenger is installed using a newer Ruby than the one needed by the application.
Big thanks to the Passenger and RVM teams, and also to Maximilian Herold for solving my mystery.

Multiple Rubies under apache in production server

I want to run multiple rubies on our production server. We have some ruby 1.9.3 rails 3.2 sites going live as well as keep older 1.8 sites. I understand that Passenger 3.2 will be able to do this natively but isn't live yet.
So for now, is this the best way to do this?
http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/
The apache passenger module can't do this. You could however run passenger standalone for each app (with a different ruby version) and then proxy from apache to passenger standalone.
You could of course also proxy to unicorn, thin etc.
What about using multiple VMs/Slices for your different versions of ruby and rails, that way you have more control of your enviroment and don't have to worry about your different rubies/rails causing headaches with each other.
EDIT
Another solution that I have heard of but haven't tried is setting multiple users and running each version of ruby/rails per a different user

Which is the best web server for Ruby on Rails application on Ubuntu?

I tried it by installing Phusion passenger..Phusion passenger was succeessfully installed but while configuring it to Apache i'm facing a problem ....
So can anybody tell me what is the best websever for ruby on rails applications to host them on Ubuntu ...
The combination of Apache and Passenger is a very good web server for Ruby on Rails applications on Ubuntu.
There is very good support, on the web, from Apache, from Phusion and here on Stackoverflow.
Many sites are running Rails on Passenger. The technology is robust and well understood.
Same for Ubuntu.
Same for Apache, only more so.
Basically I'd say that if you are just starting out that you should go with Passenger/Apache unless you have a compelling need for some other stack. Given that you are asking the question without any other details, I'm assuming that you don't have such a compelling need.
The other thing that is true today is that there are lots of choices. You can combine Passenger, or Thin, or Mongrel, or Unicorn with Apache, or Nginx or alone, and you can mix them with Varnish or other cache. Once you have your site configured on one stack, you can move it to another without too much difficulty.
First though, you have to configure it once, and for that Passenger and Apache are a good combination on Ubuntu.
Apache and passenger is reliable and configurable way to go. But if you just want to run single application, the zero configuration way is passenger standalone
gem "passenger"
in your Gemfile and
$ passenger start -e production -p 80
in console should start nginx server in port 80 with production environment. It would automatically install nginx server for you.
If port 80 is not blocked by the firewall, you can access your application from the internet by
http://your-server-ip-address/

Current ver of Passenger with Rails 1.2.6 app?

Due to a number of issues, my app is currently stuck in Rails 1.2.6-land. Converting it to Rails 2.3 is planned, but will be awhile.
Question: Does current Passenger support Rails 1.2.6? I've heard different things.
I'm currently using nginx and mongrels but 'dem dogs are getting tired.
Thanks!
Larry
Yes it does, we are in 1.2.6-land as well and using passenger for staging and dev servers.

Resources