本文介绍了告诉SELinux的给Apache的执行访问到PHP文件的外部文档根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有共同的地方PHP脚本保存目录(名称是任意的,但它不是在/ var /是/ usr /,或任何对SELinux会对特定的设置):

/不管/脚本/

这些脚本可以通过cronjobs得到执行,或使输出可以被包含在一个网页可能会被Apache或Tomcat执行。

SELinux的否认权限:

I know there is a command I can use to tell SELinux to allow this, but it's eluding me.

Even making the directory and script owner and group apache doesn't work, so it isn't a classic permissions problem, but SELinux specific.

The system is CentOS 6.3.

解决方案

I found the solution with these two commands:

That allows Apache to execute PHP scripts in that directory, and persists after a reboot, or system-wide relabeling.

这篇关于告诉SELinux的给Apache的执行访问到PHP文件的外部文档根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 03:00