how webserver handle multiple requests?

Viewed 22

I've read many posts on the internet including stackoverflow about how webserver works. Answers differ from each other in the posts. I really wonder what is the most correct answer on that topic.

  • User IP: UI
  • User Port: UP
  • Server IP: SI
  • SERVER PORT: SP
  • PROTOCOL: P

Scenario:

  • I want to visit www.example.com/file.php (IP: SI and PORT: SP)

  • TCP Connection established between user and server

  • In the server site, Apache listening on the SP port all the time.

  • The http request from browser /GET file.php

  • Apache finds file.php and want php to proccess it and send it back to apache

  • Apache retrieves output from php and send it back to user

  • User browser renders it at application level.

This is what I know, what I don't understand here, how does Apache behave when multiple connection made. Does Apache creates new thread for every connection? If so, how do those threads communicate to the users?

I hope my question was clear. Thank for anyone helping me understand this concept.

0 Answers
Related