I use AssignUserID
option to differentiate access rights for my user and server user, if you also use this option, then you need to install an additional apache2
module mpm-itk
, instructions below.
sudo apt update
sudo apt install libapache2-mpm-itk
sudo service apache2 reload
<VirtualHost *:80>
ServerName localhost
ServerAlias www.m2.local m2.local
ServerAdmin [email protected]
DocumentRoot /var/www/m2/public_html/
SetEnv APPLICATION_ENV "development"
AssignUserID user www-data
<Directory /var/www/m2/public_html>
DirectoryIndex index.php
Options All
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/www/m2/logs/error.log
CustomLog /var/www/m2/logs/access.log combined
</VirtualHost>