0
votes

On a remote server running Debian and running a web service written in php5;

At the time of transition from php to ruby on rails, I would like to operate simultaneously on the Apache php applications and ruby on rails applications.

I know that it is possible to implement using passenger, but I'm having trouble installing it. So, in the terminal I'm doing:

passenger-install-apache2-module

During installation, the following messages:

1)WARNING: Apache doesn't seem to be compiled with the 'prefork', 'worker' or 'event' MPM

Phusion Passenger has only been tested on Apache with the 'prefork', the 'worker' and the 'event' MPM. Your Apache installation is compiled with
the 'itk' MPM. We recommend you to abort this installer and to recompile Apache with either the 'prefork', the 'worker' or the 'event' MPM.

After: sudo apt-get install apache2-mpm-prefork - Apache stops working

If I continue the installation, the following problem arises:

2) Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module /home/user/.rvm/gems/ruby-2.1.3/gems/passenger-4.0.53/buildout/apache2/mod_passenger.so PassengerRoot /home/user/.rvm/gems/ruby-2.1.3/gems/passenger-4.0.53 PassengerDefaultRuby /home/user/.rvm/gems/ruby-2.1.3/wrappers/ruby

But if I'll put these lines in the config file, php stops working.

Who can tell how to solve this problem?
[
Hmm., Difficulties arose.

sudo apt-get install libapache2-mod-passenger

worked well
But, I still don't understand how to configure apache for both php and ruby on rails.
Could you illustrate examples of settings for httpd,sites-avaliable,mods-avaliable;
For available anywhere on the hard disk Ruby applications;
I hope it does not go beyond this issue.
]

1
While Apache and Passenger are used as tools for Stack Overflow, you might get better responses on Super User.the Tin Man
Thank you for the advice I'll tryfreeearth
@theTinMan Cross posting is not encouraged and you just sent a user to us, where we had to close the question. Next time when recommending another site, please at least explain that questions can be migrated on the OP's wish, and shouldn't be copied somewhere else.slhck

1 Answers

0
votes

I am guessing that Apache breaks for you when you try to use the prefork MPM because you are using options specific to the ITK MPM without wrapping them in an IfModule. Since you've switched from ITK to prefork, those options are no longer valid. An example of such an option would be AssignUserID. You'd find complaints about unknown options in your error log if that is the case.

Is there a specific reason you're using the ITK MPM? It's not that well tested with Passenger, but it should work, as the Passenger Apache User Guide lists some hints specific to ITK.

About the LoadModule for Passenger: Where did you put those lines? Did you create e.g. an /etc/apache2/mods-available/passenger.load file that you can enable? Then the Passenger module would load before the PHP one ("pa" comes before "ph") and if that breaks that could potentially be the reason for your problem, though usually Apache won't start if it can't load a module.

Is there anything useful in the Apache error log, about not being able to load the PHP module, for example?

You could also consider using the prebuilt Passenger packages for Debian available from Phusion. I've had good results with them. The dependencies list apache2-mpm-itk, so I'm reasonably sure they should work.