0

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

jcubic
  • 9,932

0 Answers0