How can i get Apache to run as www-data
?
Apache wont run as www-data
. ps aux
prints:
root 24525 0.0 0.3 69652 8932 ? Ss 12:22 0:00 /usr/sbin/apache2 -k start
root 24533 0.0 0.1 69652 4260 ? S 12:22 0:00 /usr/sbin/apache2 -k start
root 24534 0.0 0.1 69652 4248 ? S 12:22 0:00 /usr/sbin/apache2 -k start
root 24535 0.0 0.1 69652 4248 ? S 12:22 0:00 /usr/sbin/apache2 -k start
root 24536 0.0 0.1 69652 4248 ? S 12:22 0:00 /usr/sbin/apache2 -k start
root 24537 0.0 0.1 69652 4248 ? S 12:22 0:00 /usr/sbin/apache2 -k start
I expect the first process to be run as root since i need to bind to 81
but the rest i want running as www-data
.
My config envvars
file contains
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
And my apache2.conf
contains:
# These need to be set in /etc/apache2/envvars
User www-data
Group www-data
(I hard coded these as a desperate attempt)
I have even tried to run /usr/sbin/apache2 -c "User www-data"
with no luck.
nginx runs as www-data
, so i assume that the users exists and works.
The error.log shows only:
[Wed Jun 18 14:07:53 2014] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze19 with Suhosin-Patch configured -- resuming normal operations