httpd service starting although it is disabled to start on reboot - apache

I'm using RHEL 7.4 OS. I have done systemctl disable httpd.service to disable auto start of httpd. It is disabled also.
[root#clustermrfc002 ~]# systemctl is-enabled httpd
disabled.
But on reboot httpd service is starting.
Jul 28 18:02:07 clustermrfc002.novalocal systemd[1]: Starting The Apache HTTP Server...
Jul 28 18:02:08 clustermrfc002.novalocal httpd[8732]: [Sat Jul 28 18:02:08.357617 2018] [core:warn] [pid 8732] AH00117: Ignoring deprecated use
Jul 28 18:02:08 clustermrfc002.novalocal systemd[1]: Started The Apache HTTP Server.
which is causing problem in rhel 7 pacemaker cluster, below error is seen.
Jul 28 18:12:23 clustermrfc001 pengine[7420]: error: Resource MNGT_httpd_rhcdDaemon (systemd::httpd) is active on 2 nodes attempting recovery

Check the output of "chkconfig" and review its runlevel.
Or, check if any other service for HTTPD is enabled using "systemctl list-unit-files", if enabled, disable and verify

Although httpd.service is disabled to start on boot, its started by network.target as a dependency.
Jul 26 15:02:41 localhost.localdomain systemd[1]: Starting Network.
Jul 26 15:02:41 localhost.localdomain systemd[1]: Starting /etc/rc.d/rc.local Compatibility...
Jul 26 15:02:41 localhost.localdomain systemd[1]: Starting Postfix Mail Transport Agent...
Jul 26 15:02:41 localhost.localdomain systemd[1]: Starting Dynamic System Tuning Daemon...
Jul 26 15:02:41 localhost.localdomain systemd[1]: Starting PostgreSQL database server...
Jul 26 15:02:41 localhost.localdomain systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
Jul 26 15:02:41 localhost.localdomain systemd[1]: Starting
The Apache HTTP Server...

Related

Unable to start httpd service on Centos 7 "GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject"

When trying to (re)start httpd service I get the following error:
** (pkttyagent:2574): WARNING **: 01:33:55.345: Unable to register authentication agent:
GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject Error registering authentication agent:
GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0) Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
Then
systemctl status httpd.service
sheds no light on the problem:
httpd.service - Web server Apache
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2020-07-22 01:33:55 BST; 26min ago
Process: 2578 ExecStart=/usr/local/apache/bin/apachectl start (code=exited, status=1/FAILURE)
Jul 22 01:33:55 server... systemd[1]: Starting Web server Apache...
Jul 22 01:33:55 server... systemd[1]: httpd.service: control process exited, code=exited status=1
Jul 22 01:33:55 server... systemd[1]: Failed to start Web server Apache.
Jul 22 01:33:55 server... systemd[1]: Unit httpd.service entered failed state.
Jul 22 01:33:55 server... systemd[1]: httpd.service failed.
What might be causing this? Where should I look to debug?
[Thu Jul 23 05:40:44.885963 2020] [ssl:emerg] [pid 2877:tid 140514669713280] AH02565: Certificate and private key do not match
Looks like key and certificate do not match. Please check md5 of the key and cert file.
This usually happens when trying to restart a systemd service.
The workaround is as follows:
Run this as root
groupadd -g 23 nohidproc
usermod -a -G nohidproc polkitd
mount -o remount,rw,hidepid=2,gid=nohidproc /proc
systemctl restart polkit

Apache2 server restart failed - Tried multiple options

I tried to restart failed and i tried multiple options, Yet i could not able to restart the apache2.
Below links i have tried for the problems and yet i could not able to restart.
https://askubuntu.com/questions/256013/apache-error-could-not-reliably-determine-the-servers-fully-qualified-domain-n
https://askubuntu.com/questions/256013/apache-error-could-not-reliably-determine-the-servers-fully-qualified-domain-n/256018
i am using ubuntu 18.04 LTS and i am hosting the openproject software.
i added the lines as they said. Yet my apache server is not starting.
my ipaddress is 192.168.1.146 (localhost) to browse openproject
Yesterday it was working and i could able to open the project from other computers.
http://192.168.1.146
it will navigate to the index page of the openproject.
awaiting your reply.
Solved:-
netstat -ltnp | grep :80
I found that nginx is running.
So i done sudo apt-get purge nginx
sudo kill -9 982
sudo service nginx stop
sudo service apache2 start
craftsilicon#OpenProject:~$ systemctl status apache2.service
apache2.service - The Apache HTTP Server Loaded: loaded
(/lib/systemd/system/apache2.service; enabled; vendor preset:
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf Active: failed (Result: exit-code) since Mon 2020-02-03 15:23:49 IST; 13s ago Process: 3461
ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILU
Feb 03 15:23:49 OpenProject apachectl[3461]: [Mon Feb 03
15:23:49.816448 2020] [ Feb 03 15:23:49 OpenProject apachectl[3461]:
(98)Address already in use: AH00072 Feb 03 15:23:49 OpenProject
apachectl[3461]: (98)Address already in use: AH00072 Feb 03 15:23:49
OpenProject apachectl[3461]: no listening sockets available, shu Feb
03 15:23:49 OpenProject apachectl[3461]: AH00015: Unable to open logs
Feb 03 15:23:49 OpenProject apachectl[3461]: Action 'start' failed.
Feb 03 15:23:49 OpenProject apachectl[3461]: The Apache error log may
have more Feb 03 15:23:49 OpenProject systemd[1]: apache2.service:
Control process exited, Feb 03 15:23:49 OpenProject systemd[1]:
apache2.service: Failed with result 'exi Feb 03 15:23:49 OpenProject
systemd[1]: Failed to start The Apache HTTP Server.
craftsilicon#OpenProject:~$ journalctl -xe
-- Unit systemd-tmpfiles-clean.service has begun starting up. Feb 03 15:24:51 OpenProject systemd[1]: Started Cleanup of Temporary
Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- Unit systemd-tmpfiles-clean.service has finished starting up.
-- The start-up result is RESULT. Feb 03 15:25:01 OpenProject CRON[3580]: pam_unix(cron:session): session opened for user root by
(uid=0 Feb 03 15:25:01 OpenProject CRON[3583]: (root) CMD (command -v
debian-sa1 > /dev/null && debian-sa1 1 Feb 03 15:25:01 OpenProject
CRON[3580]: pam_unix(cron:session): session closed for user root Feb
03 15:30:57 OpenProject systemd-resolved[606]: Using degraded feature
set (UDP) for DNS server 4.2 Feb 03 15:32:21 OpenProject
libreoffice-writer.desktop[3668]: javaldx: Could not find a Java
Runtime E Feb 03 15:32:21 OpenProject
libreoffice-writer.desktop[3668]: Please ensure that a JVM and the
package Feb 03 15:32:21 OpenProject libreoffice-writer.desktop[3668]:
is installed. Feb 03 15:32:21 OpenProject
libreoffice-writer.desktop[3668]: If it is already installed then try
remo Feb 03 15:32:21 OpenProject libreoffice-writer.desktop[3668]:
Warning: failed to read path from javald Feb 03 15:32:24 OpenProject
audit[3687]: AVC apparmor="ALLOWED" operation="open"
profile="libreoffice- Feb 03 15:32:24 OpenProject audit[3687]: AVC
apparmor="ALLOWED" operation="open" profile="libreoffice- Feb 03
15:32:24 OpenProject kernel: kauditd_printk_skb: 32 callbacks
suppressed Feb 03 15:32:24 OpenProject kernel: audit: type=1400
audit(1580724144.128:44): apparmor="ALLOWED" oper Feb 03 15:32:24
OpenProject kernel: audit: type=1400 audit(1580724144.128:45):
apparmor="ALLOWED" oper lines 3213-3235/3235 (END)

apache2.service: Failed to run 'start' task: No such file or directory

I can't start my apache server on debian 9.
I tried reinstall :
sudo apt-get autoremove --purge apache2 && sudo apt-get install apache2
but no change...
Job for apache2.service failed because of unavailable resources or another system error.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "restart" failed.
systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: resources)
journalctl -xeu apache2.service
(I set loglevel to debug mod)
Sep 05 11:45:44 systemd[1]: apache2.service: Failed with result 'resources'.
Sep 05 11:50:26 systemd[1]: apache2.service: Changed dead -> failed
Sep 05 11:50:27 systemd[1]: apache2.service: Trying to enqueue job apache2.service/stop/replace
Sep 05 11:50:27 systemd[1]: apache2.service: Installed new job apache2.service/stop as 1415
Sep 05 11:50:27 systemd[1]: apache2.service: Enqueued job apache2.service/stop as 1415
Sep 05 11:50:27 systemd[1]: apache2.service: Job apache2.service/stop finished, result=done
Sep 05 11:50:27 systemd[1]: apache2.service: Changed dead -> failed
Sep 05 11:50:30 systemd[1]: apache2.service: Failed to run 'start' task: No such file or directory
Sep 05 11:50:30 systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit apache2.service has failed.
--
-- The result is failed.
Sep 05 11:50:30 systemd[1]: apache2.service: Failed with result 'resources'.
what's wrong?
Maybe this is a problem with service 'tmp' directory. I has a similar error with systemd-resolved.service, and reason was missing '/var/tmp' directory after system migration. Check what temp directory the service is using and create it if necessary.
Also, if there is systemd newly running and crap in /var/tmp/, you might have to clear up this crap and try running the service again.
In my case it turned out to be this (without apache2 running at the time):
root#www:/var/tmp # ls -al
total 32
drwxrwxrwt 8 root root 4096 Dec 15 12:48 .
drwxr-xr-x 14 root root 4096 Jul 8 21:43 ..
drwx------ 2 root root 4096 Dec 15 12:48 systemd-private-1dcdfe608b6c41f387936225d86126c7-apache2.service-L0KeaS
drwx------ 2 root root 4096 Dec 8 03:09 systemd-private-39294ac7bf4b44198d87d45660dcbac2-phpsessionclean.service-4ShLZm
drwx------ 2 root root 4096 Dec 15 04:00 systemd-private-451ad0c3bfe6435891a80a6c714a222b-apache2.service-YQyZes
drwx------ 2 root root 4096 Dec 15 07:09 systemd-private-451ad0c3bfe6435891a80a6c714a222b-phpsessionclean.service-5L25TU
drwx------ 3 root root 4096 Dec 15 03:53 systemd-private-68bc1493e8804c968af642a2319c4e79-apache2.service-RY1iLF

Apache not restarting, getting segmentation fault. Tried solutions but not working

I started my laptop after almost a month. Accessing localhost is giving me below error:
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: inactive (dead) since Mon 2017-08-21 20:13:20 GST; 1min 9s ago
Docs: man:systemd-sysv-generator(8)
Process: 11127 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 11110 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
Aug 21 20:13:20 user-HP-ProBook-6470b systemd[1]: Stopped LSB: Apache2 web server.
Aug 21 20:13:20 user-HP-ProBook-6470b systemd[1]: Starting LSB: Apache2 web server...
Aug 21 20:13:20 user-HP-ProBook-6470b apache2[11110]: * Starting Apache httpd web server apache2
Aug 21 20:13:20 user-HP-ProBook-6470b apache2[11110]: Segmentation fault
Aug 21 20:13:20 user-HP-ProBook-6470b apache2[11110]: Action 'start' failed.
Aug 21 20:13:20 user-HP-ProBook-6470b apache2[11110]: The Apache error log may have more information.
Aug 21 20:13:20 user-HP-ProBook-6470b apache2[11127]: * Stopping Apache httpd web server apache2
Aug 21 20:13:20 user-HP-ProBook-6470b apache2[11127]: *
Aug 21 20:13:20 user-HP-ProBook-6470b systemd[1]: Started LSB: Apache2 web server.
I am using Ubuntu 16.04 with following Apache2 version:
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2016-07-14T12:32:26
I tried changing httpd.conf as mentioned in other articles, but that didn't helped and I still continue to get this error. Any help would be appreciated.

Apache startup failure - Centos7

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.