I have a cgi script working on my localhost (ubuntu 10.04) just by dropping them to /usr/lib/cgi-bin
but... in production (ubuntu 10.04) they never run:
Apache error.log:
[Sun Jun 13 13:13:58 2010] [error] (2)No such file or directory: exec of '/var/www/cgi-bin/tbk_bp_resultado.cgi' failed
[Sun Jun 13 13:13:58 2010] [error] [client 190.161.196.57] Premature end of script headers: tbk_bp_resultado.cgi
I check the permissions and seems not to be the problem:
drwsrwsrwx 2 root root 4096 Jun 12 19:54 datos
-rwxrwxrwx 1 root root 76 Jun 13 02:13 erf.cgi
drwsrwsrwx 2 root root 4096 Oct 2 2008 log
drwsrwsrwx 2 root root 4096 Jun 12 19:54 maestros
-rwxrwxrwx 1 root root 1282027 Sep 16 2008 tbk_bp_pago.cgi
-rwxrwxrwx 1 root root 1280404 Sep 16 2008 tbk_bp_resultado.cgi
-rwxrwxrwx 1 root root 1275985 Sep 16 2008 tbk_check_mac.cgi
drwsrwsrwx 2 root root 4096 Jun 12 19:54 template
In my localhost I doesn't have to do anything in order to work, but in production I have to add this in my apache conf:
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory /var/www/cgi-bin>
Options +ExecCGI
</Directory>
AddHandler cgi-script .cgi .pl
=( thanks.