Category Archives: Ubuntu

End of script output before headers – No such file or directory: exec of

 

[Wed Jul 19 16:08:45.679229 2017] [cgi:error] [pid 2954] [client 94.63.xxx.xxx:12439] End of script output before headers:4KUYWRBjpMFod9i.cgi
[Wed Jul 19 16:09:05.030839 2017] [cgi:error] [pid 783] [client 94.63.xxx.xxx:37260] AH01215: (2)No such file or directory: exec of ‘/home/webroot/nasamos.com/www/cgi-bin/x9uWvwAREeUkQn5p/4KUYWRBjpMFod9i.cgi’ failed

Well!,
I saw a few blog posts and forum threads about this issue, but NONE was able to help me….

Yah!, syntax was okay….

perl -c 4KUYWRBjpMFod9i.cgi
4KUYWRBjpMFod9i.cgi syntax OK

I’v created a brand new file on /cgi-bin/ with some dummy filename and pumped a simple perl script on it…

#!/usr/bin/perl
# hello.pl -- my first perl script!
print "Content-type: text/html\n\n";
print "Hello, world!\n";

I was able to run it successfully, so…. the issue wasn’t on the CGI/PERL/APACHE/FIREWALL/SUEXEC.
I guess that the 4KUYWRBjpMFod9i.cgi had some issue… even using file -i  it looked to be okay… I’v decided to copy the content of 4KUYWRBjpMFod9i.cgi to the new dummy cgi file … and it worked….

I guess that the issue was on the encoding of the original cgi…

CRITICAL | sd-XXXX.host.net | (Return code of 255 is out of bounds)

So!,

My nagios was returning a CRITICAL error on one of my servers…

CRITICAL | sd-XXXX.host.net | (Return code of 255 is out of bounds)

and httpd server wasn’t responding….

I think that problem was on IPTABLES / FAIL2BAN ban list. I had 702 banned IPs…
After I clean them up, everything went okay!

captura-de-ecra%cc%83-2016-11-21-as-19-11-52

I was playing hard with them… my bantime was 3600000 (41d) and my findtime was 60000 (16h)…

 

Ubuntu Nagios NRPE – 1, 2, 3 install!

 

0. Update the system

apt-get update && apt-get upgrade

1. Install nagios nrpe & nagios plugins

apt-get install nagios-nrpe-server nagios-plugins

2. Configure NRPE

vi /etc/nagios/nrpe.cfg

Search for server_address and replace 120.0.0.1 for the public ip of this machine.
Search for allowed_hosts and replace 120.0.0.1 for the IP of your nagios server.

3. Restart NRPE

/etc/init.d/nagios-nrpe-server restart

That’s kinda it…

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

This new server with Ubuntu 16.04 LTS cames with PHP 7.0.

The backup that I have from my client has some old WordPress blogs…

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

I need to downgrade PHP 7.0 to PHP 5.6, at least for now.

Before you procede with the tutorial on the following link, and if you are running a new Ubuntu 16 installation you might get upon the following error while following the tutorial.

root@sd-4XXXX:/home/httpd/html# sudo add-apt-repository ppa:ondrej/php
sudo: add-apt-repository: command not found

To install add-apt-repository you will need to run the following command

sudo apt-get install software-properties-common

Now the solution  How can I downgrade from PHP 7 to PHP 5.6 on Ubuntu 16.04? [duplicate].