YunoHost-Apps / dolibarr_ynh

Dolibarr ERP & CRM is a modern software to manage your organization's activity. This is an integration of Dolibarr in YunoHost
https://www.dolibarr.org/
GNU Affero General Public License v3.0
12 stars 18 forks source link

Change owner of htdocs folder #39

Closed SiM closed 3 years ago

SiM commented 3 years ago

Hi,

Trying to install a custom module on my Dolibarr instance (admin/modules.php?mode=deploy), I have an error message regarding access rights of htdocs folder :

L'installation de module externe est impossible depuis l'interface web pour la raison suivante :
Impossible d'écrire dans le répertoire /var/www/dolibarr/htdocs/custom

Indeed, root is the owner of htdocs folder. Changing owner to dolibarr solves the issue.

SiM commented 3 years ago

I just check the install doc from Dolibarr and they indicates to set the owner of the entire dolibarr folder to that of the group under which the web server runs https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#With_Dolibarr_.28standard_.zip_package_or_from_git.29

Change permission and owner of the 'dolibarr' directory to that of the group under which the web server runs (assumed to be 'www-data' for debian, 'apache' for redhat, mandriva, fedora)

$ chmod -R 755 /var/www/dolibarr
$ chown -R www-data.www-data /var/www/dolibarr
or
$ chmod -R 755 /var/www/html/dolibarr
$ chown -R apache.apache /var/www/html/dolibarr

So maybe the correct solution is to change owner of the var/www/dolibarr directory to dolibarr.

I will submit a PR