0

I just installed a new cert on a RHEL 8 server. I updated the conf files and restarted Apache. Apache is failing but I can't figure out why. How do I determine what's causing the problem? Here's what Apache is returning:

$ sudo journalctl -xe
Jul 25 07:39:54 ylntest.yln.info sudo[215986]: pam_unix(sudo:session): session opened for user root by administrator(uid=0)
Jul 25 07:39:54 ylntest.yln.info systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has begun starting up.
Jul 25 07:39:54 ylntest.yln.info httpd[215989]: [Tue Jul 25 07:39:54.455473 2023] [so:warn] [pid 215989] AH01574: module php_module is already loaded, skipping
Jul 25 07:39:54 ylntest.yln.info systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Jul 25 07:39:54 ylntest.yln.info systemd[1]: httpd.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit httpd.service has entered the 'failed' state with result 'exit-code'.
Jul 25 07:39:54 ylntest.yln.info systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Jul 25 07:39:54 ylntest.yln.info sudo[215986]: pam_unix(sudo:session): session closed for user root
Jul 25 07:40:33 ylntest.yln.info sudo[216223]: administrator : TTY=pts/0 ; PWD=/etc/openldap ; USER=root ; COMMAND=/bin/journalctl -xe
Jul 25 07:40:33 ylntest.yln.info sudo[216223]: pam_unix(sudo:session): session opened for user root by administrator(uid=0)
Jul 25 07:41:07 ylntest.yln.info sudo[216223]: pam_unix(sudo:session): session closed for user root
Jul 25 07:41:20 ylntest.yln.info sudo[216509]: administrator : TTY=pts/0 ; PWD=/etc/httpd/conf.d ; USER=root ; COMMAND=/bin/mv php.conf.old php.conf
Jul 25 07:41:20 ylntest.yln.info sudo[216509]: pam_unix(sudo:session): session opened for user root by administrator(uid=0)
Jul 25 07:41:20 ylntest.yln.info sudo[216509]: pam_unix(sudo:session): session closed for user root
Jul 25 07:41:36 ylntest.yln.info sudo[216609]: administrator : TTY=pts/0 ; PWD=/etc/httpd/conf.d ; USER=root ; COMMAND=/bin/systemctl restart httpd
Jul 25 07:41:36 ylntest.yln.info sudo[216609]: pam_unix(sudo:session): session opened for user root by administrator(uid=0)
Jul 25 07:41:36 ylntest.yln.info systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has begun starting up.
Jul 25 07:41:36 ylntest.yln.info httpd[216612]: [Tue Jul 25 07:41:36.377257 2023] [so:warn] [pid 216612] AH01574: module php_module is already loaded, skipping
Jul 25 07:41:36 ylntest.yln.info systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Jul 25 07:41:36 ylntest.yln.info systemd[1]: httpd.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit httpd.service has entered the 'failed' state with result 'exit-code'.
Jul 25 07:41:36 ylntest.yln.info systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Jul 25 07:41:36 ylntest.yln.info sudo[216609]: pam_unix(sudo:session): session closed for user root
Jul 25 07:41:45 ylntest.yln.info sudo[216670]: administrator : TTY=pts/0 ; PWD=/etc/httpd/conf.d ; USER=root ; COMMAND=/bin/journalctl -xe
Jul 25 07:41:45 ylntest.yln.info sudo[216670]: pam_unix(sudo:session): session opened for user root by administrator(uid=0)

I have both a php.conf and a php81-php.conf so I renamed php.conf. It had no effect (and it has coexisted happily for a while).

3
  • Note: Apache has own logs. Check also the apache logs for more information Jul 25 at 15:20
  • The logs are fairly clear that the service is trying to load the php module at least twice. Check /etc/httpd/conf.modules.d to make sure you still don't have multiple module config files. Are the two php.conf files in /etc/httpd/conf.d or /etc/httpd/conf.modules.d?
    – doneal24
    Jul 25 at 16:17
  • Apache logs revealed the problem. I had one conf that uses a different cert key that I had forgotten to leave alone. Thanks everyone!
    – Chanel
    Jul 25 at 21:18

1 Answer 1

0

Try using the following to make sure your Apache configuration is valid.

apachectl configtest

Also check to see if you have SELinux enabled

sestatus
1
  • Apache runs just fine with SELinux enabled.
    – doneal24
    Jul 25 at 16:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .