我正面临以下情况。为了Web开发的目的,我设法使用VirtualBox设置了一个CentOS 7虚拟机。我已经安装了一个LAMP堆栈并配置了Apache(vhost,添加了vboxsf的apache成员,添加了防火墙规则)以访问VirtualBox共享文件夹。无法更改VirtualBox共享文件夹的SELinux安全上下文
Virtual machine hostname: dickwan.dev
Shared Folders:
Name | Read-only | Auto-mount
------------------------------------
dickwan | no | yes
------------------------------------
Networking: NAT (with port forwarding rules)
Port Forwarding Rules:
Name | Protocol | Host IP | Host Port | Guest IP | Guest Port
--------------------------------------------------------------------------------------
HTTP | TCP | . . . | 8080 | . . . | 80
--------------------------------------------------------------------------------------
MariaDB | TCP | . . . | 9306 | . . . | 3306
--------------------------------------------------------------------------------------
SSH | TCP | . . . | 2222 | . . . | 22
现在,当我的主机,我打开浏览器,然后导航到(让我们说):
http://dickwan.dev:8080/server-status
我客人的CentOS 7 VM客户机的
配置设置得到消息:
Forbidden
You don't have permission to access /server-status on this server.
我已经找到了SELinux安全上下文类型问题的问题。 当SELinux被禁用时,所有的工作都很好(好吧...好啊)。
但对我来说,就像关闭安全功能的一种不好的做法。我试图更改共享文件夹的上下文,但我无法执行操作
有没有机会通过Apache访问共享文件夹而不关闭SELinux?