Access Forbidden - Error 403

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
scater
Posts: 17
Joined: Sat Jul 28, 2012 8:58 am

Access Forbidden - Error 403

Post by scater »

During my initial installation, I am receiving the following error when trying to access the web interface (http://localhost/nagios/ using the nagiosadmin user) -

Access Forbidden - Error 403.
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

Install is on SuSE 11.2.
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Access Forbidden - Error 403

Post by agriffin »

How did you install Nagios, from source or from a SuSE package?
scater
Posts: 17
Joined: Sat Jul 28, 2012 8:58 am

Re: Access Forbidden - Error 403

Post by scater »

From the SuSE Pacakge download -
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Access Forbidden - Error 403

Post by slansing »

Do you have all the required Php5 packages? Both PHP5 itself and the PHP5 module for Apache?
scater
Posts: 17
Joined: Sat Jul 28, 2012 8:58 am

Re: Access Forbidden - Error 403

Post by scater »

I've installed the php modules and I am getting the following error when trying to restart the apache2 service (service apache2 restart) -

Invalid command 'ScriptAlias', perhaps misspelled or defined by a module not included in the server configuration

Here is the etc/apache2/httpd.conf file:

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
scater
Posts: 17
Joined: Sat Jul 28, 2012 8:58 am

Re: Access Forbidden - Error 403

Post by scater »

Also, what php5 modules are required ? I have loaded:

Apache2-mod_php5
php5
php5-ctype
php5-dom
php5-hash
php5-iconv
php5-json
php5-suhosin
php5-tokenizer
php5-xmlreader
php5-xmlwriter

Are any other required? Thanks.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Access Forbidden - Error 403

Post by nscott »

You shouldn't actually need any PHP modules for Nagios, its all still CGIs.

This is most definitely an Apache configuration issue, and I find it puzzling that its even an issue. That ScriptAlias is includes in mod_alias, can you search your package manager for mod_alias?
Nicholas Scott
Former Nagios employee
scater
Posts: 17
Joined: Sat Jul 28, 2012 8:58 am

Re: Access Forbidden - Error 403

Post by scater »

no luck finding any packages named mod-alias - I'm getting the following error when trying to access nagios via IE9-

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403

10.100.147.200
Wed Aug 8 08:14:58 2012
Apache/2.2.12 (Linux/SUSE)

This sure seems to be a permissions issue. Any ideas what folders/files maight be causing this issue...?

Thanks
scater
Posts: 17
Joined: Sat Jul 28, 2012 8:58 am

Re: Access Forbidden - Error 403

Post by scater »

also, when trying to restart apache2 (service apache2 restart) , I'm now getting the Invalid command ScriptAlias, perhaps misspelled or defined by a module not inlcuded in the server configuration ---

All help is greatly appreciated ...
Locked