Httpd Can't start

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
zik
Posts: 26
Joined: Wed Feb 13, 2013 4:01 am

Httpd Can't start

Post by zik »

Good Day ,

I fixed one problem and I still have small one , if you can help me .

When I start the service httpd gave me this error:

Code: Select all

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(2)No such file or directory: httpd: could not open error log file /etc/httpd/logs/error_log.
Unable to open logs
Normaly I cheked in hosts file I have like in the past :
127.0.0.1 Nagiose localhost.localdomain localhost

Searching in google I found that they recomend to add ServerName localhost in httpd.conf file ?

Many Thanks

All The Best
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Httpd Can't start

Post by slansing »

Yes, google was correct :) This should fix your issue, HTTPD should be started but it will give you that notification, which can be annoying.
zik
Posts: 26
Joined: Wed Feb 13, 2013 4:01 am

Re: Httpd Can't start

Post by zik »

excuse me what they mean ServerName localhost ? mean DNS server name ? and in the past I didn't touch this file httpd and it working .
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Httpd Can't start

Post by lmiltchev »

You may get this message:

Code: Select all

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
but the httpd may still be running.

What do you have in the hosts file?

Code: Select all

cat /etc/hosts
Do you have something like this?

Code: Select all

127.0.0.1       localhost   localhost.localdomain   localhost4    localhost4.localdomain4
::1             localhost   localhost.localdomain   localhost6    localhost6.localdomain6
Be sure to check out our Knowledgebase for helpful articles and solutions!
zik
Posts: 26
Joined: Wed Feb 13, 2013 4:01 am

Re: Httpd Can't start

Post by zik »

In the hosts file I have like this :

Code: Select all

127.0.0.1 Nagiose localhost.localdomain localhost
10.5.5.1   Server.domainename.com      Server

can you help me please .

Many Thanks
zik
Posts: 26
Joined: Wed Feb 13, 2013 4:01 am

Re: Httpd Can't start

Post by zik »

good day ,

can somone help me or advice me , I will be thankful .

Many Thanks

Regards
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Httpd Can't start

Post by slansing »

All you need to do is change it to look like what Lmiltchev showed, do not change the IP's though.
zik
Posts: 26
Joined: Wed Feb 13, 2013 4:01 am

Re: Httpd Can't start

Post by zik »

excuse me after cheking:

Code: Select all

[root@server etc]# ls -l /etc/httpd/
total 8
drwxr-xr-x 2 root   root   4096 févr. 26  2010 conf
drwxr-xr-x 2 root   root   4096 janv. 12  2010 conf.d
lrwxrwxrwx 1 nagios apache   19 déc. 22  2009 logs -> ../../var/log/httpd
lrwxrwxrwx 1 root   root     27 déc. 22  2009 modules -> ../../usr/lib/httpd/modules
lrwxrwxrwx 1 root   root     13 déc. 22  2009 run -> ../../var/run
the line logs -> ../../var/log/httpd is red

Code: Select all

[root@server log]# ls -l /var/log/httpd/
ls: no access /var/log/httpd/:No such file
maybe i don't have permission in the file ?

Many Thanks
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Httpd Can't start

Post by slansing »

You should have permissions to see the logs from root. However that is just what they are, logs, they should not prevent HTTPD from starting on their own, you need to make the changes we suggested and then we will work on your other issue. Have you ever seen the Nagios Core web UI from this system? Or is this a fresh install.

Lets also check to see if the distro's install of apache did not place them somewhere else..:

Run the following and place the output back here:

Code: Select all

ls -al /etc/httpd/logs
What Distro and version of Nagios Core are you using?
zik
Posts: 26
Joined: Wed Feb 13, 2013 4:01 am

Re: Httpd Can't start

Post by zik »

thank you very much .

no this is an old server because in the past I had one problem that logs was full , so the server can start , delete all logs maybe by mistake I delete the httpd

the version of nagios is :Nagios Core 3.2.0

Code: Select all

[root@server log]# ls -al /etc/httpd/logs
lrwxrwxrwx 1 nagios apache 19 déc. 22  2009 /etc/httpd/logs -> ../../var/log/httpd
give me the line with color red strange

it s possible to reinstall and install httpd ?

Many Thanks
Locked