[KLUG Members] cgi file not found
Stu Gillis
members@kalamazoolinux.org
Fri, 14 Sep 2001 10:05:24 -0400
One of our developers is trying to learn cgi. He put this pinggeneric file on our linux developement server. If I ssh into the server and start konqueror, I see the file, I can right click on it and open it in an editor but if I left click on it I get a message that the file is not found. This is also the message that comes up in the developers browser when he tries to run the script. Does anyone know why the system can't find a file that is obviously there?
[root@localhost cgi-bin]# ls -l
total 8
-rwxrwxr-x 1 root nobody 289 Sep 14 08:17 pinggeneric
-rwxrwxr-x 1 root apache 289 Sep 6 07:12 pinggeneric.cgi
[root@localhost cgi-bin]# exec ./pinggeneric
bash: /var/www/cgi-bin/pinggeneric: No such file or directory
bash: /var/www/cgi-bin/pinggeneric: No such file or directory
[root@localhost cgi-bin]# pwd
/var/www/cgi-bin
[root@localhost cgi-bin]# cat pinggeneric
#!/bin/sh
echo Content-type: text/html
echo
echo "<HTML><HEAD>"
echo "<TITLE>Are You There?</TITLE>"
echo "</HEAD><BODY>"
ison='who | grep "${1}"'
if [ ! -z "$ison" ]; then
echo "<P>$1 is logged in."</P>
else
echo "<P>$1 isn't logged in."</P>
fi
echo "</BODY></HTML>"