SELinux configuration

Security-Enhanced Linux (SELinux) is a mandatory access control (MAC) security mechanism implemented in the kernel. If you install Nextcloud on a Linux distribution where SELinux is enabled, you may encounter permission issues with your Linux instance. If you look at your Nextcloud logs, you will find permission denied errors. These issues can be fixed by running the following commands as root (note that you must adjust the file paths of the example:

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data(/.*)?' semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?' semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps(/.*)?' semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.htaccess' semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.user.ini'  restorecon -Rv '/var/www/html/nextcloud/' 

These settings should work for most SELinux systems that use the default dist


Attached Files
There are no attachments for this article.