Skip to content

Commit

Permalink
Merge pull request nextcloud#50 from ayamshanov/fix_SELinux_commands
Browse files Browse the repository at this point in the history
Fix semanage argument and add recursion and verbose for restorecon
  • Loading branch information
nickvergessen authored Jan 27, 2017
2 parents 65c553c + 05fbd7e commit e77205d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions admin_manual/installation/selinux_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down Expand Up @@ -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.
to get a report which helps you configuring your SELinux profiles.

0 comments on commit e77205d

Please sign in to comment.