Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

3 Answers 3

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
add comment

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.

http://gabrito.com/post/running-ruby-on-rails-with-apache-2-and-mod_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.

https://help.ubuntu.com/community/RubyOnRails#Configure_Apache

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.