How can apache's children, which are running as a non-root user, access the private key (used with the SSL certificate) which only root should have access to?
Indeed, when Apache is starting, only the main process is still running as root. Threads are being run as a non-root user. Normally, when following the security guides, your private key's owner is root and its permissions are 600.
So how are those children able to establish an SSL connection? Is there shared memory between the main process and children, it there a temporary file being used or is the main process responsible for the establishment of the SSL connection?
Also (this is a bit off-topic but it's still interesting) does this mean that being able to compromise a web-server means being able to compromise the private key? For example, let's say we are able to get access to a PHP webshell (as PHP and Apache often share the same user), does this mean we could retrieve (one way or another) the private keys?
Thanks.