title: Apache httpd.conf User/Group Setting
body: <p>I have an httpd.conf file that contains the following:</p>
  
  <pre><code>&lt;IfModule unixd_module&gt;
  &lt;If "env('OS') == 'Darwin'"&gt;
      User daemon
      Group admin
  &lt;/If&gt;
  &lt;Else&gt;
      User www
      Group scm
  &lt;/Else&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>What I'm trying to do is set the user id for the httpd instance in my development environment on OSX to one user, but a different user when it is deployed to Ubuntu.  I'm receiving a syntax error message:</p>
  
  <pre><code>AH00526: Syntax error on line 32 of /usr/local/apps/apache2/conf/httpd.conf:
  User not allowed here
  </code></pre>
  
  <p>I looked at the <a href="http://httpd.apache.org/docs/current/mod/core.html#if" rel="noreferrer">If</a> directive and it is allowed here.  If I comment out the User/Group I do not get the syntax error.  Without the IF/Else, and only using one user, this works.  If I try to use the condition with the user/group I receive an error.  Is this possible in the httpd.conf?  If so, then how?  Is there a different way to accomplish the same thing?  The "OS" environment variable is set in each environment with "export OS=<code>uname</code>".  This is in Apache httpd 2.4.4.</p>