0

I have a freshly set up RHEL 8.6 with httpd installed (yum install httpd). In /etc/httpd/conf/httpd.conf additional configs are included on a mounted NFS share:

IncludeOptional /cat/soft/apache/test_80.conf
IncludeOptional /cat/soft/apache/test_443.conf

When starting via systemctl httpd start, these configurations are not included. If "Include" is used instead of "IncludeOptional", I get an error:

httpd[763958]: httpd: Syntax error on line 357 of /etc/httpd/conf/httpd.conf: Could not open configuration file /cat/soft/apache/test_80.conf: Permission denied

When I start httpd via "/usr/sbin/httpd -k start" everything works fine and also the referenced config files are load.

[Unit]
Description=The Apache HTTP Server
Wants=httpd-init.service
After=network.target remote-fs.target nss-lookup.target httpd-init.service
Documentation=man:httpd.service(8)

[Service]
Type=notify
Environment=LANG=C

ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
# Send SIGWINCH for graceful stop
KillSignal=SIGWINCH
KillMode=mixed
PrivateTmp=true

[Install]
WantedBy=multi-user.target

I have no idea why systemctl is not working.

1 Answers1

0

SELinux might be the culprit. You can allow httpd to access NFS shares by running

setsebool httpd_use_nfs on

You can read more about Apache and SELinux interactions here

GNUPepe
  • 46
  • 2