This usually means that the user/group your webserver is running
as cannot read the file. Be careful not to make the permissions
on this file too liberal, because it contains database passwords.
You may need to put the webserver user in the appropriate group
(rt) or change permissions be able to run succesfully.
Can’t locate RT_Config.pm: /opt/rt5/etc/RT_Config.pm: Permission denied at /opt/rt5/sbin/…/lib/RT/Config.pm line 2252.
[Wed Feb 15 18:01:29.848435 2023] [fcgid:warn] [pid 2407:tid 140154337470016] (104)Connection reset by peer: [client x.x.x.x:53527] mod_fcgid: error reading data from FastCGI server, referer: example.com
[Wed Feb 15 18:01:29.848458 2023] [core:error] [pid 2407:tid 140154337470016] [client x.x.x.x:53527] End of script output before headers: rt-server.fcgi, referer: example.com
Check the file /opt/rt5/etc/RT_SiteConfig.pm exists. If it does not, you should use /opt/rt5/etc/RT_Config.pm as a template for creating it. Once this is done, make sure the group of the directory /opt/rt5/etc is that of the www server running your RT site (apache typically runs under account www-data, group www-data). Under /opt/rt5/etc the files RT_Config.pm and RT_SiteConfig.pm should in your case also be readable by the group www-data.
If the installation of RT runs smoothly, the owners and groups and permissions of the above files (except RT_SiteConfig.pm) should be set automatically.
You can run make fixperms from the unpacked source to confirm permissions are correct, www-data seems to be the right Apache default user. Also I forget what exactly the permissions should be but when running your ./configure command you can customize:
--with-web-user=USER user the web server runs as (default: www)
--with-web-group=GROUP group the web server runs as (default: www)