title: How does the apache lifecycle looks like?
body: <p>As part of my learning process, I thought it would be good if I expand a little more knowledge on what I know about apache. I have several questions, and while I know some of the stuff may require a rather lengthy explanation, I hope you can provide an overview so I know where to go looking. (preferably reference to <code>mod_wsgi</code>)I have read some resources after searching on google, and what I know arrive from there, so please bear with me.</p>
  
  <ol>
  <li><p>What does the apache lifecyle looks like before, during, and after it receives a http request? Does it spawns a new child process to do the work, or creates a thread in one of the child process?</p></li>
  <li><p>Does apache by default runs under <code>www-data</code>? So if that's the case, if I want a directory under my project folder to be used for logs, I can change just the folder group to www-data and allows write access?</p></li>
  <li><p>What user will the python interpreter run under, after being invoked by apache? And what will processes created by <code>Popen</code> or <code>multiprocessing</code> from there run under?</p></li>
  <li><p>I ran <code>ps U www-data</code>. Why are there so many processes with</p></li>
  </ol>
  
  <blockquote>
    <p>S      0:00 /usr/sbin/apache2 -k start</p>
  </blockquote>