Apache request handling in MPMs
When a connection to port 80 is established, I read that these client requests are handled by child servers(in case of prefork MPM) or server thread(in worker MPM) but not by master server(the apache process that is started first by the root user an开发者_如何转开发d which is responsible for forking new child). But how, these child servers and server threads run as non-privileged users and so how can they access the privileged port 80 which can only be done by the 'master server'. Please throw some light on this. I have never seen any explanation anywhere.
You only need privileges to start listening on a privileged port. If the process is started as root, then it can bind() on port 80, and then drop privileges. It will no longer be root, but as long as it does not close the filedescriptor that listens to port 80, it will continue to be able to accept new connections on port 80.
To fork new processes, you need no special rights....
精彩评论