0

I have a Centos 7 server with nginx and PHP7 and have a Problem with SELINUX if the SESTATUS is Enforcing I cannot upload images but if the Status is permissive it works. I host Magento on that Server so to add product images I need to upload the images through the Admin Panel. So what is the reason that the Enforcing mode is blocking the Uploading.

Note

I can select the images and 'upload it' but the images is broken and if I check the product image folder nothing is there. After uploading I should see it also in the backend but there is only a broken tmp image.

So should I create a policy for the exceptions with audit2allow? Or is there any other Solutions available?

vTillmann
  • 11
  • 1
  • 7
  • This question has been asked here [several times](http://serverfault.com/search?q=semanage+fcontext+httpd_sys_rw_content_t+is%3Aanswer) before; the one marked as duplicate is just one example, and the ones linked here are the rest of the identical answers. – Michael Hampton Aug 11 '16 at 08:21

1 Answers1

0

SELinux can get in the way of every day tasks. The following website details a guys work on the same situation.

http://blog.frag-gustav.de/2013/07/21/nginx-selinux-me-mad/

You will probably have to add a context to the directory where you're trying to write your files.

What does your error log say?

nelgin
  • 79
  • 1
  • 3
  • The linked solution isn't very good. It doesn't provide a permanent solution. For EL7 (CentOS 7) there is http_sys_rw_content_t, which needs to be used unless the boolean httpd_unified is set on. – user9517 Aug 11 '16 at 10:35