I ran a yum update after which HTTP Apache server fails to start up on my Centos 7 VM.
The apache details - Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.4.16
Kernel version - 3.10.0-327.10.1.el7.x86_64
Here is what the systemctl shows. I'm not able to figure out what is broken after the update.
[root#localhost log]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/etc/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2016-02-26 16:32:37 NZDT; 4min 19s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 3654 ExecStopPost=/usr/bin/kdestroy -A (code=exited, status=0/SUCCESS)
Process: 3651 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 3649 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Process: 3574 ExecStartPre=/usr/libexec/ipa/ipa-httpd-kdcproxy (code=exited, status=0/SUCCESS)
Main PID: 3649 (code=exited, status=1/FAILURE)
Feb 26 16:32:37 localhost.localdomain ipa-httpd-kdcproxy[3574]: ipa : WARNING Disabling KDC proxy
Feb 26 16:32:37 localhost.localdomain httpd[3649]: [Fri Feb 26 16:32:37.213684 2016] [so:warn] [pid 3649] AH01574: module rewrite_module is already loaded, skipping
Feb 26 16:32:37 localhost.localdomain httpd[3649]: [Fri Feb 26 16:32:37.217181 2016] [so:warn] [pid 3649] AH01574: module ssl_module is already loaded, skipping
Feb 26 16:32:37 localhost.localdomain httpd[3649]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directi... this message
Feb 26 16:32:37 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Feb 26 16:32:37 localhost.localdomain kill[3651]: kill: cannot find process ""
Feb 26 16:32:37 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
Feb 26 16:32:37 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Feb 26 16:32:37 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Feb 26 16:32:37 localhost.localdomain systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
Could I please request help to get some pointers to dig further or anyone who has seen this before & knows how to fix please?
it was happened to me when i install/uninstall free-ipa, because of which nss.conf has been created inside /etc/httpd/conf.d/nss.conf, you can give a try by just moving this file to another directory as i did, now httpd service is working like a charm.
Can you please setup the correct hostname for your server and check " journalctl -xn " command out while restarting httpd services on yoru server, You will get exact root cause of your httpd issues with journalctl -xn command.
Related
Apache does not start after installing the web server. (CentOS 7)
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2020-03-28 12:18:22 MSK; 16ms ago
Docs: man:httpd.service(8)
Process: 30144 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 30144 (code=exited, status=1/FAILURE)
Status: "Reading configuration..."
Mar 28 12:18:22 box-40395.localdomain systemd[1]: Starting The Apache HTTP Server...
Mar 28 12:18:22 box-40395.localdomain httpd[30144]: AH00526: Syntax error on line 103 of /etc/httpd/conf.d/ssl.conf:
Mar 28 12:18:22 box-40395.localdomain httpd[30144]: SSLCertificateFile: file '/etc/pki/tls/certs/localhost.crt' does not exist or is empty
Mar 28 12:18:22 box-40395.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 28 12:18:22 box-40395.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Mar 28 12:18:22 box-40395.localdomain systemd[1]: Unit httpd.service entered failed state.
Mar 28 12:18:22 box-40395.localdomain systemd[1]: httpd.service failed.
You could try by creating a fake certificate.
In centos there is a handy script which might help
$ cd /etc/pki/tls/certs
$ sudo ./make-dummy-cert localhost.crt
This script produces a self-signed certificate and the certificate's private key.
Therefore SSLCertificateKeyFile in /etc/httpd/conf.d/ssl.conf could be commented out
SLCertificateFile /etc/pki/tls/certs/localhost.crt
# SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
Otherwise service won't start
The error message is very clear:
SSLCertificateFile: file /etc/pki/tls/certs/localhost.crt does not exist or is empty
Remove this invalid configuration or add missing/fix existing certificate file. Either way to have to fix the configuration before Apache can start.
Obtaining an SSL certificate is out of the scope for StackOverflow. There're plenty of resources on the web, you can try on ServerFault too…
When you're done, simply sudo systemctl start httpd to start Apache.
Question originally posted in Spanish, on es.stackoverflow.com, by mnsperez97:
I have a problem with the connection to Apache, after restarting it
with the sudo service apache2 restart command, I get this error
Job for apache2.service failed because the control process exited with
error code. See "systemctl status apache2.service" and "journalctl
-xe" for details.
and then when entering localhost it does not let me in and it makes me
worse, when I run sudo journalctl -xe he told me the following but
still I do not find the error, if you could help me I would be very
grateful
EDIT: run the systemctl status apache2.service command and this
appears to me
apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Thu 2019-10-17 12:20:34 -04; 29min ago
Process: 21198 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
Process: 7385 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Process: 23453 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Main PID: 1059 (code=exited, status=0/SUCCESS)
oct 17 12:20:34 pcarrasco systemd[1]: Starting The Apache HTTP Server...
oct 17 12:20:34 pcarrasco apachectl[23453]: AH00526: Syntax error on line 47 of /etc/apache2/sites-enabled/cms.local.conf:
oct 17 12:20:34 pcarrasco apachectl[23453]: order takes one argument, 'allow,deny', 'deny,allow', or 'mutual-failure'
oct 17 12:20:34 pcarrasco apachectl[23453]: Action 'start' failed.
oct 17 12:20:34 pcarrasco apachectl[23453]: The Apache error log may have more information.
oct 17 12:20:34 pcarrasco systemd[1]: apache2.service: Control process exited, code=exited status=1
oct 17 12:20:34 pcarrasco systemd[1]: apache2.service: Failed with result 'exit-code'.
oct 17 12:20:34 pcarrasco systemd[1]: Failed to start The Apache HTTP Server.
This is common due to problems in your configuration
it may be the port configuration
lock at the log file (pass can be found as ErrorLog in /etc/httpd/conf/httpd.conf)
or try to undo what you changed in the configuration files till you find the problem
I built apache-httpd-2.4.20 from the source and installed properly.
I have created apphttpd.service under /etc/systemd/system.
Script
[Unit]
Description=Apache Web Server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
TimeoutStartSec=600
PIDFile=/usr/local/apache/logs/httpd.pid
ExecStart=/usr/local/apache/bin/apachectl -k start
ExecStop=/usr/local/apache/bin/apachectl -k stop
ExecReload=/usr/local/apache/bin/apachectl -k graceful
Restart=on-abort
PrivateTmp=true
LimitNOFILE=infinity
#User=root
#Group=root
[Install]
WantedBy=multi-user.target
when i perform systemctl start apphttpd, got message started Apache Web Server,
Status Log
**systemctl status -l apphttpd**
apphttpd.service - Apache Web Server
Loaded: loaded (/etc/systemd/system/apphttpd.service; enabled)
Active: inactive (dead) since Wed 2018-06-13 21:45:20 SGT; 14min ago
Process: 112124 ExecStop=/usr/local/apache/bin/apachectl -k stop (code=exited, status=0/SUCCESS)
Process: 112118 ExecStart=/usr/local/apache/bin/apachectl -k start (code=exited, status=0/SUCCESS)
Main PID: 112118 (code=exited, status=0/SUCCESS)
Jun 13 21:45:20 <host> systemd[1]: Started Apache Web Server.
but the services are not started actually.
error_log information:
[Wed Jun 13 21:45:20.873135 2018] [core:debug] [pid 112123:tid 139709837686656] log.c(1546): AH02639: Using SO_REUSEPORT: yes (1)
[Wed Jun 13 21:45:20.873145 2018] [mpm_worker:debug] [pid 112123:tid 139709837686656] worker.c(1874): AH00294: Accept mutex: sysvsem (default: sysvsem)
[Wed Jun 13 21:45:20.907675 2018] [core:info] [pid 112123:tid 139709837686656] AH00096: removed PID file /usr/local/apache/logs/httpd.pid (pid=112123)
[Wed Jun 13 21:45:20.907684 2018] [mpm_worker:notice] [pid 112123:tid 139709837686656] AH00295: caught SIGTERM, shutting down
But if I start the service from /usr/local/apache/bin/apachectl -k start, the services are started properly and able to get the response.
[Wed Jun 13 21:46:25.146698 2018] [core:debug] [pid 112229:tid 140320724187008] log.c(1546): AH02639: Using SO_REUSEPORT: yes (1)
[Wed Jun 13 21:46:25.146711 2018] [mpm_worker:debug] [pid 112229:tid 140320724187008] worker.c(1874): AH00294: Accept mutex: sysvsem (default: sysvsem)
Is there any issue with my apphttpd.service script, any access issue ? Thanks for you suggestions and help in advance.
Not able to start apache. Giving the below error.
Could some one please help me on this?
Error message:
ip-10-128-9-27 httpd-scl-wrapper: httpd: Syntax error on line 56 of /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf: Syntax error on line 1 of /opt/rh/httpd24/root/etc/httpd/conf.modules.d/00-ssl.conf: Cannot load modules/mod_ssl.so into server: /lib64/libcrypto.so.10: version `OPENSSL_1.0.2' not found (required by /opt/rh/httpd24/root/etc/httpd/modules/mod_ssl.so)
Below is the detailed error message.
[root#ip-10-128-9-27 centos]# systemctl status httpd24-httpd.service
● httpd24-httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd24-httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-12-07 12:34:05 UTC; 12s ago
Process: 29020 ExecStop=/opt/rh/httpd24/root/usr/sbin/httpd-scl-wrapper $OPTIONS -k graceful-stop (code=exited, status=1/FAILURE)
Process: 29018 ExecStart=/opt/rh/httpd24/root/usr/sbin/httpd-scl-wrapper $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 29018 (code=exited, status=1/FAILURE)
Dec 07 12:34:05 ip-10-128-9-27 systemd[1]: Starting The Apache HTTP Server...
Dec 07 12:34:05 ip-10-128-9-27 httpd-scl-wrapper[29018]: httpd: Syntax error on line 56 of /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf: Syntax error on line 1 of /opt/rh/httpd24/root/etc/httpd/conf.modules.d/00-ssl.conf...
Dec 07 12:34:05 ip-10-128-9-27 systemd[1]: httpd24-httpd.service: main process exited, code=exited, status=1/FAILURE
Dec 07 12:34:05 ip-10-128-9-27 httpd-scl-wrapper[29020]: httpd: Syntax error on line 56 of /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf: Syntax error on line 1 of /opt/rh/httpd24/root/etc/httpd/conf.modules.d/00-ssl.conf...
Dec 07 12:34:05 ip-10-128-9-27 systemd[1]: httpd24-httpd.service: control process exited, code=exited status=1
Dec 07 12:34:05 ip-10-128-9-27 systemd[1]: Failed to start The Apache HTTP Server.
Dec 07 12:34:05 ip-10-128-9-27 systemd[1]: Unit httpd24-httpd.service entered failed state.
Dec 07 12:34:05 ip-10-128-9-27 systemd[1]: httpd24-httpd.service failed.
systemctl restart httpd.service
when i execute that command httpd cannot restart
systemctl status httpd.service
shows
[root#openstack ~]# systemctl status httpd.service
â—� httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/httpd.service.d
└─openstack-dashboard.conf
Active: failed (Result: exit-code) since Fri 2017-10-27 18:11:35 WIB; 10s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 14032 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 14029 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Process: 13983 ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py compress --force (code=exited, status=0/SUCCESS)
Process: 13959 ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear (code=exited, status=0/SUCCESS)
Main PID: 14029 (code=exited, status=1/FAILURE)
Oct 27 18:11:21 openstack.localdomain python[13959]: Copying '/usr/lib/python2.7/site-packages/horizon/static/framework/widgets/modal/delete-modal.service.js'
Oct 27 18:11:21 openstack.localdomain python[13959]: Copying '/usr/lib/python2.7/site-packages/horizon/static/framework/widgets/modal/delete-modal.service.spec.js'
Oct 27 18:11:21 openstack.localdomain python[13959]: Copying '/usr/lib/python2.7/site-packages/horizon/static/framework/widgets/modal/modal.module.js'
Oct 27 18:11:21 openstack.localdomain python[13959]: Copying '/usr/lib/python2.7/site-packages/horizon/static/framework/widgets/modal/simple-modal.controller.js'
Oct 27 18:11:21 openstack.localdomain python[13959]: Copying '/usr/lib/python2.7/site-packages/horizon/static/framework/widgets/modal/simple-modal.html'
Oct 27 18:11:35 openstack.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Oct 27 18:11:35 openstack.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
Oct 27 18:11:35 openstack.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Oct 27 18:11:35 openstack.localdomain systemd[1]: Unit httpd.service entered failed state.
Oct 27 18:11:35 openstack.localdomain systemd[1]: httpd.service failed.
Your status reveals that the service failed for some reason. There could be a million reasons for this, but my money is on a syntax error in the configuration file.
Try running:
httpd -t
That will either tell you that the syntax is bad and what to fix, or let you know you need to look for a different answer.