Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a single server process listen from multiple ports?

I know it's possible to serve more clients through a single port with different sockets, but can a single server process listen from different ports or do I need to make different processes each for every port?

In the case of the Apache web server HTTP and HTTPS ports, are there two different processes, one listening to HTTP 80 port and another listening to HTTPS 443 port?

like image 239
Maghio Avatar asked Feb 12 '26 14:02

Maghio


1 Answers

Yes,

a single process can listen on multiple ports, just like 80 + 443 are done. Apache has different ways to the handle the requests, the so called MPM (MultiProcessingModules).

A documentation about the MPM in apache can be found here Apache 2.4 MPM

Usually you have single process and then multiple threads handling the requests as they are comming in.

like image 62
André Schild Avatar answered Feb 15 '26 19:02

André Schild