3

Is it possible to pair PHP and Ruby on Rails on the same server? Although I'd be using RoR More, I'd still like to have PHP, is this possible? And are there any major drawbacks?

2 Answers 2

3

Yes, it is definitely possible. You can enable / set up both mod_php and mod_passenger. It will depend on your OS how to do this. Basically, you need to enable both modules, then have separate virtual hosts: one for PHP and one for Ruby.

If you let me know your OS or more about what you want to achieve I can make this answer more detailed.

The drawback is increased memory usage, and possibly more complex security needs by enabling PHP. But it's not a huge drawback.

Sign up to request clarification or add additional context in comments.

3 Comments

A dedicated Linux box running Apache could handle this I suppose then?
For sure, even a cloud server or VPS can handle it. It all depends on the memory requirements of each app. For ubuntu, you can sudo a2enmod php (if not already) and also sudo a2enmod passenger. It's probably better to get the latest passenger via ruby gems than via the apt repository.
Hi Ivanoats, could you please have a look here? stackoverflow.com/questions/13090988/…
1

This is definitely possible.

There are many ways to go about it. One way is to install both PHP and Passenger modules in Apache and route requests through Apache.

Another method, and the one I personally use to handle PHP and Rails on the same server, is to setup nginx in front of your PHP / Rails server mechanism of choice and have nginx rewrite requests.

Cookie (and sessions) can be shared between PHP and Rails to make the experience smooth for your users.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.