I used grav on Debian (and it works great). Institution, however, forces us to use RedHat 8 Enterprise.
The installation was quite painful, but I eventually found the magical incantation to give access to the files to apache and it mostly works. Except for the problem shown in the image below:
I get these red errors pretty much everywhere. There is not even an error code in the message, so it’s not easy (for me) to track down. I think I installed all the required php modules. Note that the Notification Pane on the Dashboard has a “spinning circle” that never stops spinning. Again, none of this was happening with Debian.
Any hint on what might be setup wrong would be great.
... (lots of lines removed)
ownership of 'grav/webserver-configs/web.config' retained as apache@implicit_files:apache@implicit_files
ownership of 'grav/webserver-configs' retained as apache@implicit_files:apache@implicit_files
ownership of 'grav/.htaccess' retained as apache@implicit_files:apache@implicit_files
ownership of 'grav/.github/FUNDING.yml' retained as apache@implicit_files:apache@implicit_files
ownership of 'grav/.github' retained as apache@implicit_files:apache@implicit_files
ownership of 'grav' retained as apache@implicit_files:apache@implicit_files
So I ran bin/gpm index at the command line and that command works perfectly fine (as root).
I’m not behind a proxy either. That page again mentions permissions, but I did run the magical incantation for that and those should be fine (as far as I can tell).
Could it be the SELinux stuff into redhat that is causing all the trouble ? How can I disable SELinux to at least try and debug this?
Mmm… It’s freaky, I don’t have more technical skills in Grav yet, but yes. You can disable SELinux to identify if you have connection problems from Apache -> to -> Website from your Grav installation.
For do that you can run this to disable tmp SELinux: # setenforce 0
An update: turning OFF SELinux fixed all the problems without fixing anything else. So the culprit is indeed SELinux. What tipped me off is that it claimed gmp was unreachable even though it ran fine at the command line. So I suspected that the SELinux policies were blocking some of the binaries that grav uses from running.
I’m now all set and running
It might be good for grav to understand what SELinux is doing that breaks it and find a solution (a bunch of policies I suspect!).
Apologies for reopening a long dormant thread but I stumbled here attempting to install Grav on cent8 and this pointed me in the right direction.
This problem was not caused by file-permission issues or not having curl or openssl. It was (as stated above) created by SELinux. It is a bad idea to simply disable SELinux and so I wanted to provide the proper answer.
The (Hopefully) Simple Fix:
For me to fix my installation I needed to execute these four commands to allow httpd access to the system: sudo setsebool -P httpd_can_network_connect 1 sudo setsebool -P httpd_graceful_shutdown 1 sudo setsebool -P httpd_can_network_relay 1 sudo setsebool -P nis_enabled 1
That probably will fix most people using RHEL8/CENT8 but I’ll explain how I got there below for if anyone needs to find their way.
I recommend you just wipe your SELinux audit log and reboot your system to find your problem. sudo mv /var/log/audit/audit.log /var/log/audit/audit.log.old sudo reboot
Go ahead and check your audit log and try to find the error, it should be Type=AVC sudo nano /var/log/audit/audit.log
You can use Ctrl+W to find Type=AVC, a line should look like this
You’ll know the error is possibly from Grav because of the comm or pid
Copy the audit number Ex: 1611165511.516:53
Using SETroubleshoot we’ll get it to tell us what’s configured wrong, input your audit number in place of mine below sudo grep 1611165511.516:53 /var/log/audit/audit.log | audit2why
This will output something like this:
`type=AVC msg=audit(1611165511.516:53): avc: denied { name_connect } for pid=812 comm=“php-fpm” dest=443 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:http_port_t:s0 tclass=tcp_socket permissive=0
Was caused by:
One of the following booleans was set incorrectly.
Description:
Allow httpd to can network connect
Allow access by executing:
# setsebool -P httpd_can_network_connect 1
Description:
Allow httpd to graceful shutdown
Allow access by executing:
# setsebool -P httpd_graceful_shutdown 1
Description:
Allow httpd to can network relay
Allow access by executing:
# setsebool -P httpd_can_network_relay 1
Description:
Allow nis to enabled
Allow access by executing:
# setsebool -P nis_enabled 1`
And that gives you the commands to fix it with. Sometimes it’s a little more vague on its fixes but usually you can google for help.
I hope this gets anyone else who stumbles here out of the situation.