Linux - Installed Nagios but getting Forbidden 403 error - linux

I have installed nagios successfully on fedora 17. but when I am trying to connect to nagios like http://mylocalhost.com/nagios. It asks for username and password. After putting these information I am found out forbidden 403 error with message , You dont have permission to access /nagios/ on this server.
I am bit confused how to resolve this issue. I read some post. they were saying to create empty index.html inside http root directory. i tried but same error is there.
http://www.unixmen.com/nagios-http-warning-http11-403-forbidden-solved/
If I am not wrong http root directory is /var/www/html?

oops ... sorry it was problem with my httpd service which was running actually but not accessible for publicly.
simply I flushed out iptables. then Checked out httpd service whether it is running properly or not.
Now its working great.

I think you create file index.html in /var/www/html.
After you can restart service nagios and httpd

Related

Linux Lua: Permission denied on https request

I've been trying to send a https request using ssl.https library in Lua, however no matter what url I give, I alway get permission denied and no other values like headers, etc. The linux I am using is CentOS Linux version 7.
Here is the example code:
local httpsocket = require("socket.http")
local httpssocket = require ("ssl.https")
local ltn12 = require("ltn12")
local res, code, response_headers, status = httpssocket.request("https://www.google.com")
module:log("info","%s %s",code.."",response_headers);
The code itself is part of a prosody plugin and the last line in this example prints this out:
permission denied <nil>
My question is how do I fix this issue so that I can access the page?
EDIT: It seem that the problem might be the user that the service is run under and needs root privilages otherwise it throws ACCES error for ports lower than 1024. Does anyone know what to do in this case?
So... after attempting fix this issue again, I finally found the solution. If you are having trouble with services not being able to send http/https request on centOS, there is a single command that has to be run to fix this issue:
setsebool -P nis_enabled 1
For those who might have similar issues but not quite the same as me, look into the /var/log/audit/audit.log for anything related to your program, process, service, etc. then use this command:
grep <pattern_to_match_specific_log> /var/log/audit/audit.log | audit2why
This will give you a reason why it failed and how to fix it

The stream or file .../logs/laravel.log could not be opened: failed to open stream: Permission denied. Different users need to write logs

I'm using Apache 2.4 on Ubuntu 16.04 and everyday I have the same problem on my Laravel 5.5 application:
"The stream or file "myapp/storage/logs/laravel-date.log" could not be opened: failed to open stream: Permission denied"
And I see a lot of people have had the same issue, and the fix is usually changing permissions and ownership.
My problem is that actually two different users need access to create and write logs: ubuntu (I'm using AWS) and www-data (Apache user).
So if I change ownership to www-data whenever I try to run an artisan command I get the error, and if I change it to ubuntu I get the same issue whenever apache wants to log an error or something.
I have tried to make ubuntu part of the www-data group but that doesn't seem to fix the issue, since whenever a new log file is created with the following permissions
-rw-rw-r-
Which I think it's what gives me the issue.
So, any help? Thanks in advance

Jenkins Error 128 / Git Error 403: Jenkins can't connect to my Bitbucket repository

OS: Ubuntu 16.04
Hypervisor: VirtualBox
Network configuration: Nat Network with port forwarding to access the vms through the host ip. I can also ping a VM from another VM.
I try to connect my Jenkins app hosted on a VM to my BitBucket server also on a VM. I followed a tutorial on internet but when i enter the address of my git repository i'm getting this:
Failed to connect to repository : Command "usr/bin/git ls-remote -h http://admin#192.168.6.102:8005/scm/tes/repository-test.git HEAD" returned status code 128:
stdout:
stderr: fatal: unable to access 'http://admin#192.168.6.102:8005/scm/tes/repository-test.git/': The requested URL returned error: 403
So, to be sure I tried to exectute the command on the terminal... and on the terminal it seems to work.. I can also push, clone, pull etc..
On this image you can see that it's true
Do you have an explanation?
EDIT:
I try some others things like use or not sudo to see if the permissions problem came from that and it seems that it's not the case.
But I see that there is no result when we use the "HEAD" argument.
Do you think that because "HEAD" give no result, git in jenkins interprets it like no answer and returns the damn** error 403?
EDIT 2:
I found that on the web: http: // jenkins-ci.361315.n4.nabble.com/Jenkins-GIT-ls-remote-error-td4646903.html
The guy has the same problem but in a different way, I will try to allocate more RAM to see if it does the trick.
There could be many possible problems, but you are getting 403 - Access Forbidden, which indicates some problem with permissions. I would suggest first common mistakes:
a) trying https instead http - my scm only uses https,
b) check if admin is correct - scm by default uses scmadmin.
Here I run the exact same command twice.
The first time I used the proxy configuration wich I need to access internet, and the second time I set the mandatory server on "none".
So there is a problem with the damn proxy.
I was thinking that the proxy was not used in NAT connection with VirtualBox...
I found the solution.
I had to reinstall jenkins to have a user named "jenkins" with his own home directory.
I don't know if it is linked or not, but I configured my bitbucket server to use only HTTPS with a self signed certificate (I work in lan)
My troubleshoot was linked with my proxy settings.
I disabled all my proxy settings in Linux so I was able to launch the command that did'nt worked in jenkins with terminal.
I logged with sudo su jenkins the commands also worked.
I found out that in the home directory of the jenkins user there was a "proxy.xml" file. I opened it and saw my old proxy settings.
I deleted all the content with vim, saved and restarted and the error was gone.
there can be git version miss match.....
I would suggest you update git once. maybe it will resolve your issues.

Ubuntu 14.04 mod_mono error 503

I can't seem to get an asp site to run with ISPCONFIG3 at all. I am getting errors in the apache error.log like this:
Not running mod-mono-server.exe because no MonoApplications, MonoApplicationsConfigFile or MonoApplicationConfigDir specified.
Failed to connect to mod-mono-server after several attempts to spawn the process.
I think it has to do with my configuration somehow but I can't seem to figure out where. Thoughts?
Encountered this error today after installing apache2, mod-mono, etc in Ubuntu 19.04 on my laptop. Having just done it successfully on an AWS instance running Ubuntu 18.04, I was surprised that it didn't work here. By trial and error tweaking the mono-server config, apache2 config, the ASP.NET web app folder (with a simple index.aspx in it), and looking at the apache2 error logs after each change (after stopping/restarting apache2 each time!), I discovered that, in my case at least, this error was caused by the absence of a web.config file in the web app root folder; as soon as I created a simple skeleton web.config file, this error message went away.
Worth noting in passing is that the error message contains a typo: there should be an "s" for "Applications" in the keyword MonoApplicationConfigDir, like the other two keywords have. One of the things I tried was to alter the MonoApplicationsConfigDir statement that was present by default in my mono-server4-hosts.conf file by removing the "s" to match the error message, but that generated a different, fatal error that prevented apache2 from starting: systemctl status apache2.service showed "Invalid command 'MonoApplicationConfigDir'".

FTP getting 550 Permission denied Apache Ubuntu Server 11

I just set up FTP today, and I am getting a 550 Permission denied error.
I tried chmod-ing the directory(/var/www/site1).
Any ideas?
Check if your username and password is correct and port number.
the other reason can be you may not be having the permission to use the ftp in your network.
I had the same error message transferring files from the server to my laptop. I changed the firewall settings to allow the server IP address. The error no longer appears.
In my case changing the chmod permissions did not affect it.

Resources