Page 1 of 1

error mesage when starting the apache server

Posted: Mon Oct 02, 2017 11:50 am
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

Re: error mesage when starting the apache server

Posted: Mon Oct 02, 2017 11:56 am
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.

Re: error mesage when starting the apache server

Posted: Tue Oct 03, 2017 9:29 am
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

Re: error mesage when starting the apache server

Posted: Tue Oct 03, 2017 11:24 am
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

Re: error mesage when starting the apache server

Posted: Tue Oct 03, 2017 3:21 pm
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

Re: error mesage when starting the apache server

Posted: Tue Oct 03, 2017 4:38 pm
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

Re: error mesage when starting the apache server

Posted: Wed Oct 04, 2017 9:03 am
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

Re: error mesage when starting the apache server

Posted: Wed Oct 04, 2017 9:17 am
by npolovenko
@DOkuwa, Alright, let us know if you have any other questions.

Re: error mesage when starting the apache server

Posted: Wed Oct 04, 2017 11:17 am
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.