Allowing access on Apache CentOS server
I have installed a CentOS 6.6 virtual machine. I also installed Apache, PHP, MySQL with yum
.
I changed my document root from /var/www/html
to /www
so I edited mine /etc/httpd/httpd.conf
and changed these two lines:
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
I restarted apache and everything was fine.
The problem came up when I tried to open http://192.168.199.90/phpinfo.php
. I got:
Forbidden You do not have permission to access /phpinfo.php on this server.
I tried to disable SElinux in /etc/selinux/conf
and change enforcing
todisabled
I also tried this: chcon -v -R --type=httpd_sys_content_t /www/
And when I write ls -laZ /www
I have:
drw-rw-rw-. www www unconfined_u:object_r:httpd_sys_content_t:s0 .
dr-xr-xr-x. root root system_u:object_r:root_t:s0 ..
-rwxrwxrwx. root root unconfined_u:object_r:httpd_sys_content_t:s0 phpinfo.php
drw-rw-rw-. www www unconfined_u:object_r:httpd_sys_content_t:s0 sites
source to share