I have an httpd.conf file that contains the following:
<IfModule unixd_module>
<If "env('OS') == 'Darwin'">
User daemon
Group admin
</If>
<Else>
User www
Group scm
</Else>
</IfModule>
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:
AH00526: Syntax error on line 32 of /usr/local/apps/apache2/conf/httpd.conf:
User not allowed here
I looked at the If 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=uname
". This is in Apache httpd 2.4.4.