systemctl start httpd command not failing with error code - linux

I am having a problem to run this code.
#systemctl start httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor prese t: disabled)
Active: failed (Result: exit-code) since Wed 2018-01-17 17:59:46 UTC; 20s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 2188 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAIL URE)
Process: 2187 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, st atus=1/FAILURE)
Main PID: 2187 (code=exited, status=1/FAILURE)
Jan 17 17:59:45 hackdays httpd[2187]: (98)Address already in use: AH00072...0
Jan 17 17:59:45 hackdays httpd[2187]: (98)Address already in use: AH00072...0
Jan 17 17:59:45 hackdays httpd[2187]: no listening sockets available, shu...n
Jan 17 17:59:45 hackdays httpd[2187]: AH00015: Unable to open logs
Jan 17 17:59:46 hackdays systemd[1]: httpd.service: main process exited, ...E
Jan 17 17:59:46 hackdays kill[2188]: kill: cannot find process ""
Jan 17 17:59:46 hackdays systemd[1]: httpd.service: control process exite...1
Jan 17 17:59:46 hackdays systemd[1]: Failed to start The Apache HTTP Server.
Jan 17 17:59:46 hackdays systemd[1]: Unit httpd.service entered failed state.
Jan 17 17:59:46 hackdays systemd[1]: httpd.service failed.

From the stacktrace I can see the below
Address already in use:
Can you check if the port is been used already by some other process.

Related

x11vnc service failing with exit code

Thanks!
I am trying to setup x11vnc service on raspberry pi 4B platform, but it's failing. Below are the status logs:
root#raspberrypi4-64:~# systemctl status x11vnc.service
x x11vnc.service - x11vnc service
Loaded: loaded (/lib/systemd/system/x11vnc.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-11-23 09:44:49 UTC; 10s ago
Process: 1947 ExecStart=/usr/bin/x11vnc -forever -display :0 -auth guess -passwdfile /home/root/.vnc/passwd (code=exited, status=1/FAILURE)
Main PID: 1947 (code=exited, status=1/FAILURE)
Nov 23 09:44:49 raspberrypi4-64 systemd[1]: x11vnc.service: Failed with re...e'.
Nov 23 09:44:49 raspberrypi4-64 systemd[1]: x11vnc.service: Scheduled rest... 5.
Nov 23 09:44:49 raspberrypi4-64 systemd[1]: Stopped x11vnc service.
Nov 23 09:44:49 raspberrypi4-64 systemd[1]: x11vnc.service: Start request ...ly.
Nov 23 09:44:49 raspberrypi4-64 systemd[1]: x11vnc.service: Failed with re...e'.
Nov 23 09:44:49 raspberrypi4-64 systemd[1]: Failed to start x11vnc service.
Hint: Some lines were ellipsized, use -l to show in full.
Any suggestion on this will be really helpful.
I am expecting to enable x11vnc service on raspberry pi 4B.

Im trying to restart httpd.service but i get an error

on doing sudo systemctl restart httpd.service i get this error
[opc#xxxx ~]$ sudo systemctl restart httpd.service
Job for httpd.service failed because the control process exited with error code.
See "systemctl status httpd.service" and "journalctl -xeu httpd.service" for det ails.
systemctl status httpd.service shows me this
× 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 2022-11-05 05:48:10 GMT; 2min 54s ago
Docs: man:httpd.service(8)
Process: 48848 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 48848 (code=exited, status=1/FAILURE)
Status: "Reading configuration..."
CPU: 46ms
Nov 05 05:48:09 xxxxx systemd[1]: Starting The Apache HTTP Server...
Nov 05 05:48:10 xxxxx systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Nov 05 05:48:10 xxxxx systemd[1]: httpd.service: Failed with result 'exit-code'.
Nov 05 05:48:10 xxxxx systemd[1]: Failed to start The Apache HTTP Server.
and journalctl -xeu httpd.service shows this message
i changed the port to 80 from 443 and nothing happened

problems centos 7 httpd service restart

when I type systemctl restart httpd ,
I get the following error:
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
en when I type systemctl status httpd.service
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: exit-code) since Wed 2020-07-01 00:45:46 COT; 16s ago
Process: 1927 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Process: 23178 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
Process: 1925 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 1925 (code=exited, status=1/FAILURE)
Status: "Total requests: 657; Current requests/sec: -30.7; Current traffic: 0 B/sec"
Jul 01 00:45:46 sitio.co systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 01 00:45:46 sitio.co systemd[1]: Failed to start The Apache HTTP Server.
Jul 01 00:45:46 sitio.co systemd[1]: Unit httpd.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
for journalctl -xe
Jul 01 01:05:01 sitio.co CROND[2219]: (root) CMD (/usr/local/maldetect/maldet --mkpubpaths >> /dev/null 2>&1)
Jul 01 01:09:23 sitio.co systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has begun starting up.
Jul 01 01:09:24 sitio.co systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 01 01:09:24 sitio.co systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Jul 01 01:09:24 sitio.co systemd[1]: Unit httpd.service entered failed state.
Jul 01 01:09:48 sitio.co postfix/qmgr[2155]: 968D275E: from=<root#sitio.co>, size=3215, nrcpt=1 (queue active)
Jul 01 01:09:48 sitio.co postfix/smtp[2303]: warning: database /etc/postfix/generic.db is older than source file /etc/postfix/generic
Jul 01 01:09:49 sitio.co postfix/smtp[2303]: 968D275E: to=<sistemas.revistas#correounivalle.edu.co>, relay=smtp.gmail.com[173.194.217.109]:587, delay=42
Jul 01 01:10:01 sitio.co systemd[1]: Created slice user-0.slice.
-- Subject: Unit user-0.slice has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user-0.slice has finished starting up.
--
-- The start-up result is done.
Jul 01 01:10:01 sitio.co systemd[1]: Starting Session 76464 of user root.
-- Subject: Unit session-76464.scope has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-76464.scope has begun starting up.
Jul 01 01:10:01 sitio.co systemd[1]: Started Session 76464 of user root.
-- Subject: Unit session-76464.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-76464.scope has finished starting up.
--
-- The start-up result is done.
Jul 01 01:10:01 sitio.co CROND[2306]: (root) CMD (/usr/local/maldetect/maldet --mkpubpaths >> /dev/null 2>&1)
and for systemctl status httpd.service -l
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: exit-code) since Wed 2020-07-01 01:09:24 COT; 4min 24s ago
Process: 2296 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Process: 23178 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
Process: 2294 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 2294 (code=exited, status=1/FAILURE)
Status: "Total requests: 657; Current requests/sec: -30.7; Current traffic: 0 B/sec"
Jul 01 01:09:24 sitio.co systemd1: httpd.service: main process
exited, code=exited, status=1/FAILURE
Jul 01 01:09:24 sitio.co systemd1: Failed to start The Apache HTTP
Server.
Jul 01 01:09:24 sitio.co systemd1: Unit httpd.service entered failed
state.
look the last logs:
enter image description here
enter image description here
Stop the Apache httpd service and check semaphore usage owned by the apache user.
ipcs -s
Execute the following command to clear semaphore used by Apache user.
ipcs -s | awk -v user=apache '$3==user {system("ipcrm -s "$2)}'
You can refer Link for more information.
fix error by running
$ apachectl configtest

Installing Apache/2.4.37 on centos getting Error

I have been trying to install Apache/2.4.37 webserver on centos 8 machine and keep getting the following error
Job for httpd.service failed because the control process exited with error code.
See "systemctl status httpd.service" and "journalctl -xe" for details.
[root#localhost draj]# 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
└─php-fpm.conf
Active: failed (Result: exit-code) since Mon 2020-04-13 17:07:09 +0545; 4min 10s ago
Docs: man:httpd.service(8)
Process: 14004 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 14004 (code=exited, status=1/FAILURE)
Status: "Reading configuration..."
Apr 13 17:07:09 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Apr 13 17:07:09 localhost.localdomain httpd[14004]: AH00526: Syntax error on line 122 of /etc/httpd/conf/httpd.conf:
Apr 13 17:07:09 localhost.localdomain httpd[14004]: DocumentRoot '/var/www/html' is not a directory, or is not readable
Apr 13 17:07:09 localhost.localdomain systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Apr 13 17:07:09 localhost.localdomain systemd[1]: httpd.service: Failed with result 'exit-code'.
Apr 13 17:07:09 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Could somebody kindly shed some light on how to fix this problem, thanks !!

Apache/HTTPD service not working

I am trying to start my Apache/HTTPD on my CentOS 7.3-1611 dedicated server.
When I start the service, I'am receiving the following error code:
[root#ns3033129 ~]# service httpd start
Redirecting to /bin/systemctl start httpd.service
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root#ns3033129 ~]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2017-06-27 23:14:39 CEST; 9s ago
Process: 18137 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 18134 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 18134 (code=exited, status=1/FAILURE)
Jun 27 23:14:39 ns3033129.ip-149-202-89.eu systemd[1]: Starting The Apache HTTP Server...
Jun 27 23:14:39 ns3033129.ip-149-202-89.eu httpd[18134]: [Tue Jun 27 23:14:39.351580 2017] [so:warn] [pid 18134] AH01574: module ruid2_module is already loaded, skipping
Jun 27 23:14:39 ns3033129.ip-149-202-89.eu httpd[18134]: httpd: Syntax error on line 58 of /etc/httpd/conf/httpd.conf: Syntax error on line 2 of /etc/httpd/conf.d/vesta.conf: Could not open configuration file /home/admi...le or directory
Jun 27 23:14:39 ns3033129.ip-149-202-89.eu systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 27 23:14:39 ns3033129.ip-149-202-89.eu kill[18137]: kill: cannot find process ""
Jun 27 23:14:39 ns3033129.ip-149-202-89.eu systemd[1]: httpd.service: control process exited, code=exited status=1
Jun 27 23:14:39 ns3033129.ip-149-202-89.eu systemd[1]: Failed to start The Apache HTTP Server.
Jun 27 23:14:39 ns3033129.ip-149-202-89.eu systemd[1]: Unit httpd.service entered failed state.
Jun 27 23:14:39 ns3033129.ip-149-202-89.eu systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
The output of systemctl status httpd clearly said that it is configuration error in your vesta.conf.
Jun 27 23:14:39 ns3033129.ip-149-202-89.eu httpd[18134]: httpd: Syntax error on line 58 of /etc/httpd/conf/httpd.conf: Syntax error on line 2 of /etc/httpd/conf.d/vesta.conf: Could not open configuration file /home/admi...le or directory
Run "httpd -t" to check your httpd configuration before starting the httpd server.

Resources