execute a vhost with a user's account instead of apache account
apt-get install libapache2-mpm-itk php7.0 libapache2-mod-php7.0
a2enmod alias
a2enmod actions
a2enmod rewrite
a2enmod authz_groupfile
a2enmod ssl
service apache2 restart
emacs /etc/apache2/apache2.conf
add %D somewhere
LogFormat "%v:%p %h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i" %D" vhost_combined
apachectl restart
apachectl -V
Server version: Apache/2.4.7 (Ubuntu)
Server built: Mar 10 2015 13:05:59
Server's Module Magic Number: 20120211:27
Server loaded: APR 1.5.1-dev, APR-UTIL 1.5.3
Compiled using: APR 1.5.1-dev, APR-UTIL 1.5.3
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
useradd --home=/home/example example -m -U -s /bin/bash
add a vhost : just add AssignUserId (it seems to be ignored. the effective user launching the file is the owner of the file)
ServerName example.com
AssignUserId example example
DocumentRoot /home/example/site/
check rights :
emacs /etc/apache2/apache2.conf
replace
with
and add
AllowOverride All
Require all granted
chown -R example:example /home/example
chmod -R 700 /home/example
you can test it with :
emacs index.php