0
votes

I use Apache as Reverse Proxy, and behind it I use Phusion Passenger(a Rails Server) as Application Server. I'm confused about how Apache communicate with Phusion Passenger(which is Application Server behind it). Here is what I get of httpd:

> ps aux | grep /MyWebsite/bin/httpd
googly    8353  0.0  0.0  73856  3280 ?        Ss   Aug26   0:00 /MyWebsite/bin/httpd -d /MyWebsite -f var/state/apache-1080/httpd.conf
googly    8391  0.0  0.0  73856  1828 ?        S    Aug26   0:00 /MyWebsite/bin/httpd -d /MyWebsite -f var/state/apache-1080/httpd.conf
... # showing that 8353 forks 10 process, and 8353 is the father process

When a HTTP request comes, Apache allocates a process to handle this request(for example process 8391), passing it to the Application Server.

My question is, what is really happening about this? How Apache communicate with an Application Server? I think different Application Server are similar under this condition.

Does 8391 pass the request to Phusion Passenger? If so, Phusion Passenger should have its own separate process running, right? Or 8391 can be regarded as Phusion Passenger process and it can handle the request itself?

1

1 Answers

1
votes
  • Apache accepts the request which is generated in term of thread
  • It sends request back to your application server.
  • Till it get response from Application server, Apache thread would be in waiting/running state.
  • Apache sends back request to client.
  • Apache closes connections once it acknowledges data.
  • Application server thread closes once apache acknowledges data.