[SOLVED] httpd failed to start

Issues related to applications and software problems
Post Reply
grimmjow_sms
Posts: 10
Joined: 2018/02/03 18:07:00

[SOLVED] httpd failed to start

Post by grimmjow_sms » 2018/02/26 02:31:09

Hi all...

I am taking one Nagios online course, and I am following the instructions given there. There is a step to start httpd, but when I do, I got the following message:

Code: Select all

-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit httpd.service has begun starting up.
feb 25 14:09:39 localhost.localdomain httpd[4074]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localh
feb 25 14:09:39 localhost.localdomain httpd[4074]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
feb 25 14:09:39 localhost.localdomain httpd[4074]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
feb 25 14:09:39 localhost.localdomain httpd[4074]: no listening sockets available, shutting down
feb 25 14:09:39 localhost.localdomain httpd[4074]: AH00015: Unable to open logs
feb 25 14:09:39 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
feb 25 14:09:40 localhost.localdomain kill[4083]: kill: cannot find process ""
feb 25 14:09:40 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
feb 25 14:09:40 localhost.localdomain 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.
feb 25 14:09:40 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
feb 25 14:09:40 localhost.localdomain systemd[1]: httpd.service failed.
I searched for whats using the port:80, here is the output

Code: Select all

root@localhost nagios-4.3.4]# netstat -tulpn | grep :80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1452/nginx: master  
tcp6       0      0 :::8080                 :::*                    LISTEN      1726/java           
tcp6       0      0 :::80                   :::*                    LISTEN      1452/nginx: master
It seems that this nginx is using port:80, my question is: How do i fix this?

I already when to /etc/httpd/conf/httpd.conf and here it states that the port is 80, should I just change it to another? If so, which one should I use

Regards
Last edited by grimmjow_sms on 2018/03/23 16:02:44, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: httpd failed to start

Post by TrevorH » 2018/02/26 07:36:16

Pick one of nginx or apache httpd. Only one of them can bind to port 80 & 443 at the same time.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: httpd failed to start

Post by hunter86_bg » 2018/02/26 17:36:39

If you decide to use both, you will need 'semanage port' to allow apache/nginx to bind on different port.

grimmjow_sms
Posts: 10
Joined: 2018/02/03 18:07:00

Re: httpd failed to start

Post by grimmjow_sms » 2018/02/26 17:56:33

TrevorH wrote:Pick one of nginx or apache httpd. Only one of them can bind to port 80 & 443 at the same time.

Hi thanks for your reply,
Actually I have never used nginx, I didnt really know what is for until last night when I searched. How can I change it to httpd? Should I just delete nginx???

Thanks

grimmjow_sms
Posts: 10
Joined: 2018/02/03 18:07:00

Re: httpd failed to start

Post by grimmjow_sms » 2018/02/26 18:16:45

Ive been reading in wikipedia and it says that the port 591 is "an alternative" for port 80.
Will it work if I change the port in httpd conf file to 591??

regards

grimmjow_sms
Posts: 10
Joined: 2018/02/03 18:07:00

Re: httpd failed to start

Post by grimmjow_sms » 2018/02/26 19:46:13

Ok, I found da wae!.

I stoped the nginx service:

Code: Select all

/usr/bin/nginx -s stop
systemctl -disable nginx
Then I just simply started httpd as normal:

Code: Select all

systemctl start httpd
systemctl -enable httpd
systemctl daemon-reload (if needed)
Thanks

Post Reply