I want to manage a Claroline website, (based on Symfony 2). So for my site mysymfony.com installed for user "theclient"
1 - 0 I added theclient to the www-data group : adduser theclient www-data
1 – 1 - modified /etc/hosts :
127.0.0.1 mysymfony.com
1 – 2 -created vhost /etc/apache2/sites-available/mysymfony.com :
<VirtualHost *:80>
ServerName mysymfony.com
DocumentRoot /var/www/mysymfony.com
<Directory /var/www/mysymfony.com/>
Options -Indexes
AllowOverride all
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost>
1 – 3 - Actived : a2ensite mysymfony.com
1 – 4 - Reload server : service apache2 reload
1 – 5 - link to var/www :
ln -s /home/theclient/www/mysymfony.com/ /var/www/mysymfony.com
Then as root I :
1 – 6 - change ownership : chown -hR theclient:www-data /home/theclient/www/mysymfony.com
1 – 7 - change rights : chmod -R 755 /home/theclient/www/mysymfony.co
m
and for the directories and files that can be written into :
chmod 775 app/cache/ app/logs/ app/config/ files/ templates/ vendor/ web/
chmod -R 775 app/cache/ app/logs/ vendor/ web/
chmod 775 composer.json composer.lock app/config/bundles.ini app/config/parameters.yml app/config/platform_options.yml
With this configuration i can correctly install the website (with the webinstaller or console based).
If i install a plugin as root, the plugin directory, its content, all
Symfony config files et cache files are root:root => I need to redo a
: chown -hR theclient:www-data /home/theclient/www/mysymfony.com
Uploaded files belong to www-data:www-data (which is expected, but is not practical with scripts from user theclient. Same "problem" of files/directory ownership happen when flushing the cache (as root)
So it's not a bug, but if i want to be able to manage daily this site (develop/try/install plugins, flushing cache, upgrade ...)
So my question is could you provide a "precise" way of setting this kind of website (rights/ownership, management...) ?
Should "chown" and "chmod" be used there other than for the initial setting ? Thank you