I have directory project in home directory and symlink to it in /var/www/html
And I can't open files because got error 403, I set the Group in httpd.conf to kuba (my main user/group)
run systemctl restart httpd
but simple php script like this:
<?php echo exec("id"); ?>
Display:
uid=48(apache) gid=48(apache) groups=48(apache) context=system_u:system_r:httpd_t:s0
I've also tried to add apache to kuba group but with no effect. How can I make apache run as group kuba?
I'm using this in my httpd.conf
<Directory "/var/www/html">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
Allow from all
</Directory>
UPDATE After few reboots, because of installation of VirtualBox, I got this from php script:
uid=48(apache) gid=48(apache) groups=48(apache),1000(kuba)
context=system_u:system_r:httpd_t:s0
but the php script in localhost/projects still return 403 error. I don't see any SELinux errors but just in case I've executed setsebool -P httpd_enable_homedirs 1
as in here Apache can't open file that is a symlink
Group
. – Thomas Mar 07 '18 at 17:33chmod g+rx /home/kuba
resolve the issue, it's not related to changing group but actual issue I had. – jcubic Mar 08 '18 at 14:36