Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
How mongrel works with Apache?
6 Posts
How mongrel works with Apache?

Hello, Can any one explain me of how mongrel works with apache with diagram? I need to know whole work flow actually from browser end to server end.How and who execute ruby code and how apache behaves with this whole procedure?

Thanks

Person
Forum Rating: 100
Sign In To Rate Post

As far as I know ... I've used Apache + Mongrel with mod_proxy only, so Apache worked only as a front proxy and Mongrel did the rest. So, ruby was executed by Mongrel. Apache ran port 80, each of my Mongrel instance ran on separate port (8001, 8002 etc)

The cool kids use "Passenger":http://www.modrails.com/

Hello,

Usually apache acts as a proxy (balancer) for mongrel. Use apache for static content, handle https, etc, and mongrel for processing your application.

Regards

Apache with mongrel cluster works. For this Mongrel server has to run on the 8001,8002,8003 like that in a clusters. We configure the apache server to take load balance and redirects to the one of the server.

I have used an .htaccess file with the following line:

RewriteRule .* "http\:\/\/www.domain.com\:12001%{REQUEST_URI}" [P,QSA,L]

This way Apache will take all request and redirect them at the port 12001 with their QueryString. Then Mongrel will produce the HTML back to apache I hope that helps a little.

Note : We do not have any static content on the public_html folder that is why I used the *.

6 Posts
Login to add your message