SELinux blocks svn via http in CentOS / Fedora Core

If this happens, you may see something like “Could not open the requested SVN filesystem” on the browser and “(20014)Internal error: Can’t open file ‘/repos/svn/repo16/format’: Permission denied” in apache error_log.

When you feel puzzled why with seemingly correct permission settings in place, but it still does not work, you could try this:

# getenforce <– this shows you the status of SELinux. If you see “Enforcing”, then SELinux is on.

# setenforce Permissive <– this changes it to Permissive, which is like turning SELinux off.

The try again to see if it works. If it becomes ok, then you have to change the SELinux policy.

If proved to be the restriction by SELinux, then you could do the following:

  1. chcon -Rv -t httpd_sys_content_t /repos/svn/repo16
  2. chcon -v t httpd_sys_content_t /repos
  3. chcon -v t httpd_sys_content_t /repos/svn
  4. semanage fcontext -a -t httpd_sys_content_t “/repos(.*)?”
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: