Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 438464 - net-analyzer/nagios-3.3.1: apache-2.4.3 fails to start with Syntax error on line 6 of /etc/apache2/modules.d/99_nagios3.conf
Summary: net-analyzer/nagios-3.3.1: apache-2.4.3 fails to start with Syntax error on ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sysadmin Bugs
URL:
Whiteboard:
Keywords:
: 447218 (view as bug list)
Depends on:
Blocks: apache-2.4-stable
  Show dependency tree
 
Reported: 2012-10-15 11:33 UTC by Juergen Rose
Modified: 2014-11-23 05:09 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2012-10-15 11:33:46 UTC
/etc/init.d/apache2 fails to start with:

root@lynx:/root(8)# /etc/init.d/apache2 start
 * apache2 has detected an error in your setup:
[Mon Oct 15 13:29:44.117611 2012] [core:warn] [pid 23903:tid 139799558952768] AH00111: Config variable ${SVN_REPOS_LOC} is not defined
[Mon Oct 15 13:29:44.117708 2012] [core:warn] [pid 23903:tid 139799558952768] AH00111: Config variable ${SVN_REPOS_LOC} is not defined
AH00526: Syntax error on line 6 of /etc/apache2/modules.d/99_nagios3.conf:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
 * ERROR: apache2 failed to start
root@lynx:/root(9)# 



the contents of /etc/apache2/modules.d/99_nagios3.conf is:
<IfDefine NAGIOS>
        ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/
        <Directory "/usr/lib/nagios/cgi-bin/">
                AllowOverride AuthConfig
                Options +ExecCGI
                Order allow,deny
                Allow from 127.0.0.1 192.168.2.1/24
        </Directory>
        Alias /nagios /usr/share/nagios/htdocs
        <Directory "/usr/share/nagios/htdocs">
                AllowOverride AuthConfig
                Order allow,deny
                Allow from 127.0.0.1 192.168.2.1/24
        </Directory>
</IfDefine>


I suppose the lines:
               Order allow,deny
                Allow from 127.0.0.1 192.168.2.1/24
have to be replaced by something like:
               Require 127.0.0.1 ...

But how it would be exactly?
Comment 1 Juergen Rose 2012-10-19 08:34:47 UTC
I looked at http://httpd.apache.org/docs/trunk/upgrading.html and replaced

	Order allow,deny
	Allow from 127.0.0.1 141.89.194.1/24
with
	Require host 127.0.0.1 141.89.194.1/24

I hope that this correct. At least I can start apache2 again.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-12-14 16:11:32 UTC
*** Bug 447218 has been marked as a duplicate of this bug. ***
Comment 3 Dirkjan Ochtman (RETIRED) gentoo-dev 2014-04-24 10:24:52 UTC
Bringing in the current nagios-plugins maintainer. What's the best way forward here? The Order directive was deprecated in 2.4 in favor of new directives from mod_authz_host, but a mod_access_compat module is provided to ease compatibility issues.
Comment 4 Ron 2014-05-27 05:13:18 UTC
On 64 bit installs 99_nagios3.conf should use the lib64 directory:
ScriptAlias /nagios/cgi-bin/ /usr/lib64/nagios/cgi-bin/

the default is:
ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/

for Apache 2.4.x installs the file /etc/apache2/modules.d/99_nagios3.conf
show be:

<IfDefine NAGIOS>
        ScriptAlias /nagios/cgi-bin/ /usr/lib64/nagios/cgi-bin/
        <Directory "/usr/lib64/nagios/cgi-bin/">
                AllowOverride AuthConfig
                Options ExecCGI
                AuthName "Nagios Access"
                AuthType Basic
                AuthUserFile /etc/nagios/auth.users
                Require valid-user
        </Directory>
        Alias /nagios /usr/share/nagios/htdocs
        <Directory "/usr/share/nagios/htdocs">
                AllowOverride AuthConfig
                AuthName "Nagios Access"
                AuthType Basic
                AuthUserFile /etc/nagios/auth.users
                Require valid-user
                #Order allow,deny
                #Allow from all
        </Directory>
</IfDefine>

the default config file use "Allow from ???" which isn't supported with apache-2.4!

Permissions also need to be changed:
chown nagios.apache /usr/share/nagios/htdocs
chown nagios.nagios /usr/share/nagios/htdocs/*
chown nagios.nagios /usr/lib64/nagios/cgi-bin
chown nagios.nagios /usr/lib64/nagios/cgi-bin/*
Comment 5 Michael Orlitzky gentoo-dev 2014-11-23 05:09:56 UTC
This should be fixed in the latest nagios-4.x ebuild. I've added a build-time dependency on apache-2.4.x (needed for other reasons, but prevents apache-2.2.x as well), and updated the config file using the newer syntax.

Please reopen if you have any more issues.