Replace Mongrel with Apache - ruby-on-rails

I am new to Rails, so bear with me, I need to have apache tomcat as application server. How do i configure that by replacing the default Mongrel

first of all, to deploy a rails app on tomcat, you need jRuby (a ruby version that runs on JVM).
I'll suggest you to read this tutorial to make an idea: http://thenice.tumblr.com/post/133345213/deploying-a-rails-application-in-tomcat-with-jruby-a

http://wiki.joyent.com/accelerators:apache_rails_mongrel
helps you

Related

How to start rails server like windows service

I've just finished to write a rails app, and now is(unfortunately) time to deply this app on Windows.
I'm running:
Windows server 2008
Ruby 1.9.3
Rails 3.2.9
Now my web server is Thin, and i want to start it (or something else if it is easier) like a windows service.
I followed 3 or 4 tutorial but it never works and the deadline of the project is everyday nearest.
Hope someone can help me.
Thanks.
You could deploy use capistrano
Or using 3rd party extensions capistrano deploy rails apps to Windows servers :
capistrano-windows-server

should I be using passenger in dev to match prod for a ruby on rails project?

Should I be using passenger in dev to match prod for a ruby on rails project? (as opposed Webrick)
Noting I'll be deploying to dreamhost which uses passenger.
(Also if yes, does it have it's own web-server or do I need to install one?)
Set up a passenger staging server on your production machine. Use same configuration as pro server.
This has just saved my bacon. A recent upgrade we recently pushed broke application and took me a week to get sorted. Fortunately production server continued to function which we found prob.
Use capistrano multistage to manage the same.
You don't have to (mostly). But there might be cases where things can go wrong due to the mismatch between production & dev environment. Using staging environment will catch such issues.
If you want to test things like SSL, then webrick wont work. You need apache/nginx(or other web servers) to use passenger. I also noticed that there is no significant difference in the performance between the two options

Can someone explain to me in simple terms what Passenger is?

I was researching to set up my linux (ubuntu) vps for rails. And almost all of the guides I've read tells me to install passenger. But none of the guides explain what it is (atleast not in simple terms). So I was wondering if someone could explain in simple terms what exactly passenger is.
I'm trying to set up my VPS so I can easily push code to it from git, and deploy my app (Easy as heroku?) Any suggestions?
Your web server (apache/nginx) serves HTTP requests for files, like stylesheets and images. But, it doesn't know how to process programming code. In PHP, for example, you have to enable mod_php to allow PHP to run.
Passenger is to ruby/rails what mod_php is to PHP.
Your web server still serves static files, but has passenger run your ruby code.
Passenger usually works with Apache/nginx.
Passenger does the dynamic things, Apache/nginx serves
static files and helps passenger to communicate with user-agents
mod passenger or phusion passenger is a module to deploy ruby on rails application in nginx or apache . Currently you must be using either web brick or mongrel. using mod passenger you can have the full power of nginx or apache at your disposal,

Setting up Apache for Rails production

I am developing a Rails 3 application and I have installed Capistrano on the client side and Passenger with Apache 2 on the server side.
I make a deployment and the files are sent to a folder called u/apps/.
But when I visit the IP address I am currently using I only get to an empty folder, how do I configure Apache to look for my app in the current folder? So that I only need to visit my IP/domain to see my app?
I have done this using Rails 2.x but I think for Rails 3 also pretty much the same thing. For this you need to use Passenger and then configure Apache.
Following are some useful resources
http://www.modrails.com/install.html
http://railscasts.com/episodes/122-passenger-in-development
If you browse to your URL and you see an apache files/folders list that means that passenger is not triggered for that location...
Test your server environment by running a mongrel/thin in your application folder and see that your application runs correctly. After that, look at your Apache configuration (see Passenger docs).

Can I run LAMP and Rails from the same Apache instance?

We have a RedHat box with Apache2, PHP5 and MySQL 5 for much of our development. Now, we have a Rails client, and we need to set up a Rails app on the same server. Can we install Ruby and the Rails framework with the same Apache, or should we avoid this? Why or Why not? Is it possible to direct subdomains to either PHP or Ruby in the individual V-host definitions?
Yes, you can configure your virtual hosts to Rails, PHP, or anything else with the proper configuration. The details depend largely on how you are connecting to Rails, but generally however you would configure a single purpose Apache server should work for the virtual hosts.
Yeah - Install passenger, then you can configure your sites through your apache conf files. The passenger docs contain everything you'll need to know!

Resources