Forbidden You don't have permission to access /nagios3/

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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Forbidden You don't have permission to access /nagios3/

Post by abrist »

What are the contents of your server's .htaccess file?

Have you tried adding :

Code: Select all

Indexes
To the Options directive of your nagios vhost file:

Code: Select all

 <DirectoryMatch (/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3|/etc/nagios3/stylesheets)>
        Options FollowSymLinks Indexes
        [snip]
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Forbidden You don't have permission to access /nagios3/

Post by lmiltchev »

I installed nagios3 on Debian 6.0 and my "/etc/apache2/sites-available/default" file is a bit different.

Code: Select all

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Did you modify this file?

Can you try creating a new user, and log in as this user?

Code: Select all

htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin
Be sure to check out our Knowledgebase for helpful articles and solutions!
kalianto
Posts: 7
Joined: Sun Apr 28, 2013 11:29 pm

Re: Forbidden You don't have permission to access /nagios3/

Post by kalianto »

When running Apache Web Server, it is a secure approach to run the apache as apache user, i.e. "nobody" or "www-data"
Your document root "/var/www/html" should be set to "www-data" or whatever apache user is, instead of root.

Your nagios web folder, should have owner "nagios" and group "www-data"

It's best if you download nagios from nagios.org, extract it following the installation instruction/document.
It gives you more control than using apt-get
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Forbidden You don't have permission to access /nagios3/

Post by abrist »

kalianto wrote:It's best if you download nagios from nagios.org, extract it following the installation instruction/document.
It gives you more control than using apt-get
Agreed. Some of the distro packages are wonky, they do things their own way. Configuring vhosts should be a simple procedure for nagios, but the debian vhost config is a mess. Additionally, we will best be able to support your issues if you do a source-based install.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked