But in order for the process to achieve that end result, there must be a “transition” rule in SELinux for whatever context started httpd. init_t → httpd_t is allowed. publicfile_t → httpd_t apparently isn’t.
Gregory is correct, the problem here is the source context of your httpd executable. Are you not using the regular Fedora packaged httpd? If not, how did you deploy your copy?
Yeah, this generally shouldn’t happen with the Fedora packaged httpd unless someone does some manual relabelling for some reason. I haven’t seen this on my Fedora 41 httpd boxes.
@vgaetera’s suggestion of restorecon should fix this particular error. Not a bad idea to also run it against the docroot if you still have issues.
It is potentially a solution. It probably isn’t the best solution because your web services are no longer running as httpd_t. There are now fewer protections against intrusion into your system via the HTTP ports.
Edit: Is there a reason you are not starting HTTPD from the systemd service manager (i.e. systemctl start httpd.service)?