error mesage when starting the apache server

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.
Locked
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

error mesage when starting the apache server

Post by DOkuwa »

when installing Nagios core on Ubuntu I mean 4.x
I get this error when restarting the apache server by the command line
sudo service apache2 restart
and the error message is syntax error message on line 14 on /etc/apache.conf/conf.d/Nagios.conf and says invalid command <ifVersion > is misspelt or defined by a module not configured in the server configuration
and then looking at the Nagios.conf I could see the ifVersion to be 2.3
I don't know if this makes some sense
dwasswa

Re: error mesage when starting the apache server

Post by dwasswa »

Hi @ Dokuwa,

Can you please run this command:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
and post the results.

Also,run these commands and post their output:

Code: Select all

cat /etc/apache.conf/conf.d/Nagios.conf

Code: Select all

cat /usr/local/nagios/var/objects.cache
This directive is used to specify a file in which a cached copy of object definitions should be stored. The cache file is (re)created every time Nagios is (re)started and is used by the CGIs. It is intended to speed up config file caching in the CGIs and allow you to edit the source object config files while Nagios is running without affecting the output displayed in the CGIs.


Also to start or restart apache you need to run this command:

Code: Select all

service httpd restart
OR

Code: Select all

systemctl restart apache.service
that's why you could also be getting that error;try that.
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: error mesage when starting the apache server

Post by DOkuwa »

Thanks
bash: https://assets.nagios.com/downloads/nag ... onfig.html: No such file or directory

cat /etc/apache.conf/conf.d/Nagios.conf
cat: /etc/apache.conf/conf.d/Nagios.conf: No such file or directory


cat: /usr/local/nagios/var/objects.cache: No such file or directory
service httpd restart
httpd: unrecognized service

systemctl restart apache.service
systemctl: command not found


Is it because it is Ubuntu 12.x or it does not matter for Nagios core 4.x
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: error mesage when starting the apache server

Post by npolovenko »

@DOkuwa, Yes, I think systemctl command does not work on on Ubuntu 12.x, neither service httpd would work because you're running the Core on Ubuntu.

These two commands should work on your system:

Code: Select all

sudo service apache2 restart
sudo service nagios restart
Did you use this guide to install the Core?
https://support.nagios.com/kb/article/n ... tml#Ubuntu


The error that you have says that you might have problems with a web interface. It could be that your Ubuntu 12.x is running an older version of apache that requires a different configuration. Can you access the web interface at all? Also, can you post the whole Nagios.conf file here?
Thanks
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: error mesage when starting the apache server

Post by DOkuwa »

Thanks
There is no nagios.conf
i have an old nagios server which has 3.x on ubuntu 12.x
can i copy all the missing files from the old server to the new ones
dwasswa

Re: error mesage when starting the apache server

Post by dwasswa »

Can you post

Code: Select all

cat /etc/apache2/sites-enabled/nagios.conf
.

Also post error log for

Code: Select all

 cat /var/log/apache2/error.log
What was the ouput of

Code: Select all

    sudo service apache2 restart
    sudo service nagios restart
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: error mesage when starting the apache server

Post by DOkuwa »

Thanks
It has been sorted as I have to upgrade Ubuntu from 12.x to 14.x
and modify my /etc/hosts file to include the fully qualified name
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: error mesage when starting the apache server

Post by npolovenko »

@DOkuwa, Alright, let us know if you have any other questions.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dwasswa

Re: error mesage when starting the apache server

Post by dwasswa »

Hi @DOkuwa ,

Glad to know this worked out for you.

If you have any other questions please feel free to open another thread .

Therefore,am going to close this as resolved.
Locked