From 05fbd7e0d859f0e4876e2d3931c8b1902a23e1be Mon Sep 17 00:00:00 2001 From: Alexander Yamshanov Date: Sat, 9 Jul 2016 02:39:07 +0600 Subject: [PATCH] Fix semanage argument and add recursion and verbose for restorecon --- .../installation/selinux_configuration.rst | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/admin_manual/installation/selinux_configuration.rst b/admin_manual/installation/selinux_configuration.rst index 1a797bed81e..4ceb8b0b7ed 100644 --- a/admin_manual/installation/selinux_configuration.rst +++ b/admin_manual/installation/selinux_configuration.rst @@ -12,22 +12,22 @@ The following settings should work for most SELinux systems that use the default distro profiles. Run these commands as root, and remember to adjust the filepaths in these examples for your installation:: - semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data' - restorecon '/var/www/html/nextcloud/data' - semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config' - restorecon '/var/www/html/nextcloud/config' - semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps' - restorecon '/var/www/html/nextcloud/apps' + semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data(/.*)?' + restorecon -v -R '/var/www/html/nextcloud/data' + semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?' + restorecon -v -R '/var/www/html/nextcloud/config' + semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps(/.*)?' + restorecon -v -R '/var/www/html/nextcloud/apps' If you uninstall Nextcloud you need to remove the Nextcloud directory labels. To do this execute the following commands as root after uninstalling Nextcloud:: - semanage fcontext -d -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data' - restorecon '/var/www/html/nextcloud/data' - semanage fcontext -d -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config' - restorecon '/var/www/html/nextcloud/config' - semanage fcontext -d -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps' - restorecon '/var/www/html/nextcloud/apps' + semanage fcontext -d -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data(/.*)?' + restorecon -v -R '/var/www/html/nextcloud/data' + semanage fcontext -d -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?' + restorecon -v -R '/var/www/html/nextcloud/config' + semanage fcontext -d -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps(/.*)?' + restorecon -v -R '/var/www/html/nextcloud/apps' If you have customized SELinux policies and these examples do not work, you must give the HTTP server write access to these directories:: @@ -80,4 +80,4 @@ For general Troubleshooting of SELinux and its profiles try to install the packa sealert -a /var/log/audit/audit.log > /path/to/mylogfile.txt -to get a report which helps you configuring your SELinux profiles. \ No newline at end of file +to get a report which helps you configuring your SELinux profiles.