Category Archives: Apache

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…

pagespeed – Slow ReadFile operation on file

[Sat May 27 07:17:27.539747 2017] [pagespeed:error] [pid 19961] [mod_pagespeed 1.11.33.5-0 @19961] Slow ReadFile operation on file /var/cache/mod_pagespeed/rname/ic_QOs6thfRpiBUn09lB5Du/http,3A/,2Fdomain.com/assets/slideshow/slide_02.jpg,40x,40._,: 59.944ms; configure SlowFileLatencyUs to change threshold\n

 

Some disk stats….

sudo hdparm -Tt /dev/root

/dev/root:
 Timing cached reads: 26330 MB in 2.00 seconds = 13178.47 MB/sec
 Timing buffered disk reads: 540 MB in 3.00 seconds = 179.73 MB/sec

I’v added the following lines to my pagespeed configuration file (/etc/apache2/mods-enabled/pagespeed.conf)

ModPagespeedSlowFileLatencyUs 100

 

CentOS – Enable the mod_proxy modules in the HTTPD

In our /etc/httpd/conf/httpd.conf lets see if we have the following lines on it.
Uncomment them or add them.

  1. LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    # Uncomment these to proxy FTP or HTTPS
    #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    #LoadModule proxy_connect_module modules/mod_proxy_connect.so
    

 

apache – proxy & proxy_http

 

Invalid command ‘ProxyPreserveHost’, perhaps misspelled or defined by a module not included in the server configuration

sudo a2enmod proxy

 

[Sun Feb 26 03:48:38.613627 2017] [proxy:warn] [pid 9117] [client 94.63.XXX.XXX:49486] AH01144: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

sudo a2enmod proxy_http

Restart apache and everything should be okay now.
HOORAY!