Apache/HTTPD service not working - linux

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.

Related

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

Systemd does not activate service?

I need to leave a service on systemd running because it doesn't activate? For what reason this happens since I follow the recommendation of the documentation, below are the codes:
Code of the Service :
# Contents of /etc/systemd/system/quark.service
[Unit]
Description=Quark
After=network.target
[Service]
Type=simple
User=cto
ExecStart=/usr/local/bin/python3.9 /var/net/
Restart=always
[Install]
WantedBy=multi-user.target
Status Code :
● quark.service - Quark
Loaded: loaded (/etc/systemd/system/quark.service; enabled; vendor preset: en
Active: failed (Result: exit-code) since Mon 2021-06-21 15:20:34 UTC; 8s ago
Process: 1467 ExecStart=/usr/local/bin/python3.9 /var/net/ (code=exited, statu
Main PID: 1467 (code=exited, status=1/FAILURE)
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Main process exited, code=e
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Failed with result 'exit-co
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Service RestartSec=100ms ex
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Scheduled restart job, rest
Jun 21 15:20:34 webstrucs systemd[1]: Stopped Quark.
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Start request repeated too
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Failed with result 'exit-co
Jun 21 15:20:34 webstrucs systemd[1]: Failed to start Quark.
The ExecStart should be the command to be executed:
systemd manpages:
ExecStart=
Commands with their arguments that are executed when this service is started.
This stanza:
ExecStart=/usr/local/bin/python3.9 /var/net/
Should be:
ExecStart=/usr/local/bin/python3.9 path_to_python_script.py

Apache on my rPi LAMP box stopped working for no reason

I was editing /etc/crontab when things turned south. I have no idea why, and I rolled back my changes on the /etc/crontab file but apache is still messed up and I can't access local development websites hosted on this machine. When I run systemctl status apache2.service this is what I get:
apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2020-10-04 11:27:33 MDT; 6min ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 2413 ExecStart=/usr/sbin/apachectl start (code=exited, status=203/EXEC)
Oct 04 11:27:33 pidev.local systemd[1]: Starting The Apache HTTP Server...
Oct 04 11:27:33 pidev.local systemd[2413]: apache2.service: Failed to execute command: No such file or directory
Oct 04 11:27:33 pidev.local systemd[2413]: apache2.service: Failed at step EXEC spawning /usr/sbin/apachectl: No such file or directory
Oct 04 11:27:33 pidev.local systemd[1]: apache2.service: Control process exited, code=exited, status=203/EXEC
Oct 04 11:27:33 pidev.local systemd[1]: apache2.service: Failed with result 'exit-code'.
Oct 04 11:27:33 pidev.local systemd[1]: Failed to start The Apache HTTP Server.
Any ideas? I can't seem to trace what's wrong here.

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 !!

systemctl start httpd command not failing with error code

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.

Resources