Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Ubuntu box 10.04 that already has a LAMP stack configured on it.

I would like to play around with Rails on this machine as well. Is there a way I can install Rails without messing up the PHP stuff? Maybe have it default to the PHP server and switch to the Rails server when I use a certain port?

share|improve this question

You're misunderstanding how rails and php work.

When you run rails server in the rails project, it runs it on port 3000 by default (for development).

LAMP traditionally runs on port 80, so you can run both rails and LAMP at the same time.

For instructions on properly install rails on Ubuntu, take a look at this answer.

share|improve this answer

For production environment you should consider using Apache to serve your Rails projects.

The easy way is using Apache mod-fcgid and run rail projects via fcgid.

For better performance, mod-passenger is usually preferred. But it might be harder to setup for beginners as Ubuntu install apache2-mpm-prefork + mod-php5 by default. mod-messenger depends on apache2-mpm-worker, but mod-php5 is incompatible with apache2-mpm-worker.

I use mod-passenger with apache2-mpm-worker and run php script using mod-fcgid.

share|improve this answer

Yes! as long as you run them in different ports... for example localhost:3000 for Rails and 8888 for PHP will work fine!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.