nagios web start error

I install nagios 2 from ports and after install I do this
I go to this directory
Code:
cd /usr/local/etc/nagios
and run these commands
Code:
cd /usr/local/etc/nagios
cp cgi.cfg-sample cgi.cfg
cp nagios.cfg-sample nagios.cfg
cp resource.cfg-sample resource.cfg
cd objects
cp commands.cfg-sample commands.cfg
cp printer.cfg-sample printer.cfg
cp localhost.cfg-sample localhost.cfg
cp switch.cfg-sample switch.cfg
cp tempelates.cfg-sample tempelates.cfg
cp timeperiods.cfg-sample timeperiods.cfg
cp contacts.cfg-sample contacts.cfg
and after that I make this file
Code:
nagios.conf
in this Directory
Code:
/usr/local/etc/apache22/Includes
and I put these line in that file
Code:
<Directory /usr/local/www/nagios>
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
        AuthName "Nagios Access"
        Authtype Basic
        AuthUserFile /usr/local/etc/nagios/htpasswd.users
        Require valid-user
</Directory>

<Directory /usr/local/www/nagios/cgi-bin>
        Options ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
        AuthName "Nagios Access"
        Authtype Basic
        AuthUserFile /usr/local/etc/nagios/htpasswd.users
        Require valid-user
</Directory>

ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/
Alias /nagios/ /usr/local/www/nagios/
and after that I restart apache
but when I type in firefox
Code:
http://192.168.0.58/nagios/
I see this error
Code:
The requested URL /nagios/ was not found on this server
and Is see error about 404
but when I see this command
Code:
tail -f /var/log/http-error.log
I see this
Code:
Wed Apr 28 13:07:15 2010] [error] [client 192.168.0.58] File does not exist: /usr/local/www/apache22/data/nagios
and I can not access to nagios web page
when I run this command
Code:
/usr/local/etc/rc.d/nagios start
I do not see about starting nagios

Where I make mistake ?
 
mfaridi said:
Code:
<Directory [b]/usr/local/www/nagios[/b]>

Code:
ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/
Alias /nagios/ [b]/usr/local/www/nagios/[/b]

Code:
Wed Apr 28 13:07:15 2010] [error] [client 192.168.0.58] File does not exist: [b]/usr/local/www/apache22/data/nagios[/b]

Note the different path.
 
No, you should fix the error in your config. There's a reason why apache thinks it's in /usr/local/www/apache22/.
 
SirDice said:
No, you should fix the error in your config. There's a reason why apache thinks it's in /usr/local/www/apache22/.

but I think apache conf dose not error
because I have joomla , Gallery , squrrielmail , and all of them work good
 
Your httpd.conf for 192.168.0.58 has /usr/local/www/apache22/data as the DocumentRoot, so unless you create a new virtual host for Nagios with its own DocumentRoot, nothing in the included nagios.conf will override the DocumentRoot you have now.

This is why http://192.168.0.58/nagios/ expands to http://192.168.0.58/$DocumentRoot/nagios/ -> /usr/local/www/apache22/data/nagios

Try [cmd=]ln -s /usr/local/www/nagios /usr/local/www/apache22/data/[/cmd]

or create a separate VirtualHost for Nagios (if you have an internal domain, create a host 'nagios' under it with /usr/local/www/nagios as its DocumentRoot).

The first solution (the symlink) should work right away, the second solution (creating a separate VirtualHost for nagios) takes some work (and a domain, of course).
 
DutchDaemon said:
Your httpd.conf for 192.168.0.58 has /usr/local/www/apache22/data as the DocumentRoot, so unless you create a new virtual host for Nagios with its own DocumentRoot, nothing in the included nagios.conf will override the DocumentRoot you have now.

This is why http://192.168.0.58/nagios/ expands to http://192.168.0.58/$DocumentRoot/nagios/ -> /usr/local/www/apache22/data/nagios

Try [cmd=]ln -s /usr/local/www/nagios /usr/local/www/apache22/data/[/cmd]

or create a separate VirtualHost for Nagios (if you have an internal domain, create a host 'nagios' under it with /usr/local/www/nagios as its DocumentRoot).

The first solution (the symlink) should work right away, the second solution (creating a separate VirtualHost for nagios) takes some work (and a domain, of course).

Thanks
But I see this error when I type in FireFox
Code:
You don't have permission to access /nagios/ on this server
 
Do you have FollowSymLinks as an (added) option in httpd.conf's <Directory "/usr/local/www/apache22/data"> container?
 
DutchDaemon said:
Do you have FollowSymLinks as an (added) option in httpd.conf's <Directory "/usr/local/www/apache22/data"> container?

Yes I have this is part of http.conf
Code:
Directory "/usr/local/www/apache22/data">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

but when I run this command
Code:
tail -f /var/log/http-error.log
I see this
Code:
[Wed Apr 28 18:30:32 2010] [error] [client 192.168.0.58] Symbolic link not allowed or link target not accessible: /usr/local/www/apache22/da
 
What happens when you do this on the command-line
[cmd=]cd /usr/local/www/apache22/data/nagios && ls -ld[/cmd]
?
 
DutchDaemon said:
What happens when you do this on the command-line
[cmd=]cd /usr/local/www/apache22/data/nagios && ls -ld[/cmd]
?

I see this
Code:
drwxr-xr-x  10 root  wheel  512 Apr 28 12:28
 
That should be enough (world-executable).

Do you also have this in the Directory container?

Code:
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

I don't think I needed to set more to get symlinks working with Apache.
 
DutchDaemon said:
That should be enough (world-executable).

Do you also have this in the Directory container?

Code:
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

I don't think I needed to set more to get symlinks working with Apache.

this is my nagis.conf in
Code:
/usr/local/etc/apache22/Includes
Code:
<Directory /usr/local/www/nagios>
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
              
        AuthName "Nagios Access"
        Authtype Basic
        AuthUserFile /usr/local/etc/nagios/htpasswd.users
        Require valid-user
</Directory>

<Directory /usr/local/www/nagios/cgi-bin>
        Options ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
        
        AuthName "Nagios Access"
        Authtype Basic
        AuthUserFile /usr/local/etc/nagios/htpasswd.users
        Require valid-user
</Directory>

ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/
Alias /nagios/ /usr/local/www/nagios/
 
I meant the <Directory "/usr/local/www/apache22/data"> container.
 
You can also try an alternative nagios.conf to keep the symlink intact:

Code:
<Directory /usr/local/www/apache22/data/nagios>
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
              
        AuthName "Nagios Access"
        Authtype Basic
        AuthUserFile /usr/local/etc/nagios/htpasswd.users
        Require valid-user
</Directory>

<Directory /usr/local/www/apache22/data/nagios/cgi-bin>
        Options ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
        
        AuthName "Nagios Access"
        Authtype Basic
        AuthUserFile /usr/local/etc/nagios/htpasswd.users
        Require valid-user
</Directory>

ScriptAlias /nagios/cgi-bin/ /usr/local/www/apache22/data/www/nagios/cgi-bin/
Alias /nagios/ /usr/local/www/apache22/data/nagios/
 
DutchDaemon said:
I meant the <Directory "/usr/local/www/apache22/data"> container.

Yes I have this
Code:
#
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
</Directory>
 
DutchDaemon said:
You can also try an alternative nagios.conf to keep the symlink intact:

Code:
<Directory /usr/local/www/apache22/data/nagios>
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
              
        AuthName "Nagios Access"
        Authtype Basic
        AuthUserFile /usr/local/etc/nagios/htpasswd.users
        Require valid-user
</Directory>

<Directory /usr/local/www/apache22/data/nagios/cgi-bin>
        Options ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
        
        AuthName "Nagios Access"
        Authtype Basic
        AuthUserFile /usr/local/etc/nagios/htpasswd.users
        Require valid-user
</Directory>

ScriptAlias /nagios/cgi-bin/ /usr/local/www/apache22/data/www/nagios/cgi-bin/
Alias /nagios/ /usr/local/www/apache22/data/nagios/

I use this new conf you say , but I see that error again about forbidden
 
Ok, just to rule out any problem with symlinks in general, can you try this?

[cmd=]cd /usr/local/www/apache22/data[/cmd]
[cmd=]ln -s /tmp test[/cmd]

Then go to http://192.168.0.58/test -- you should see the contents of your /tmp directory now.
 
DutchDaemon said:
Ok, just to rule out any problem with symlinks in general, can you try this?

[cmd=]cd /usr/local/www/apache22/data[/cmd]
[cmd=]ln -s /tmp test[/cmd]

Then go to http://192.168.0.58/test -- you should see the contents of your /tmp directory now.

I go to apache22/data and run this command
[cmd=]ln -s /tmp test[/cmd]
and I open firefox and run this
http://192.168.0.58/test
but I see error about permission and I see error about 403 forbidden
Code:
You don't have permission to access /test on this server
 
Can you put an empty index.html file in /tmp?

[cmd=]touch /tmp/index.html[/cmd]

And try again?
 
DutchDaemon said:
Can you put an empty index.html file in /tmp?

[cmd=]touch /tmp/index.html[/cmd]

And try again?

I run this command
[cmd=]touch /tmp/index.html[/cmd]
and type in FireFox
Code:
http://192.168.0.90/index.html
and I see this
Code:
it works
I see this message when I type
Code:
http://192.168.0.90
 
Back
Top