Q: Ubuntu 14.04 + Apache + suexec + php5-fpm run as user and group?

453 views Asked by At

i'm trying to install a apache2 on ubuntu 14.04 with mod_suexec and php5-fpm. What i want is, that the php scripts are running as the user and group that i've set in the fpm pool.conf for the virtual host. but it already runs as www-data. the tutorials i've found just explain how to setup php fpm on listening on a port with ProxyPassMatch or on a socket, but not explaining why or how to run it as an alternative user.

i've read that apache 2.4 in the ubuntu 14.04 packages could only run with the port listening fpm method, but how could i solve it on that way to run scripts with different pool configurations an run under the user set in the pool conf?

thanks a lot

1

There are 1 answers

0
HR123 On BEST ANSWER

Resolved it by setting each pool for a user with different Port listening on. After that RegexProxyPassMatch in the vhost includes the port.

To get unique port numbers i'm calculating with the user UID like this in a bash script

  BASEPORT=20000
  USRID=`id -u $1`
  NEWPORT=`echo $((USRID+BASEPORT))`

and write it into the pool and vhost conf.

thats all