I'm trying to implement a simple http handler using inetd. I'm new to linux, and am following examples like this:
http://www.debian-administration.org...a_shell_script and this:
http://www.perlmonks.org/?node_id=544341. As far as I can tell, inetd is correctly installed and configured to point to my handler (a shell script). When I send an http request to my server, I get this error message in /var/log/syslog
Aug 23 20:06:31 precise32 inetd[7434]: cannot execute /usr/local/bin/bashhttpd: No such file or directory
and curl terminates with this message:
C:\Users\IBM_ADMIN>curl -X POST --data "http://exmple.org/foo"
http://localhost:3010/build --header "Content-Type:text/xml" --include
curl: (52) Empty reply from server
(the odd-looking url is because curl is running on my windows host and port 3010 is redirected to port 80 on my Ubuntu 12.04 guest VM)
inetd appears to looking for my file in the right place but not finding it. I cannot figure out why - it appears to be there:
root@precise32:~# ls -l /usr/local/bin/bashhttpd
-rwxr-xr-x 1 root root 175 Aug 23 20:04 /usr/local/bin/bashhttpd
Here is the line from /etc/inetd.conf for my handler:
www stream tcp nowait nobody /usr/local/bin/bashhttpd bashhttpd
I have no idea what to even look at to figure out why this doesn't work - any suggestions welcome. Thanks in advance. I will be embarrassed if the problem is a simple typo.
I can't imagine that the details of my handler script are relevant, since I don't seem to be getting that far, but here is my minimal test handler
#!/bin/bash
read request
while /bin/true; do
read header
[ "$header" == $'\r' ] && break;
done
read data
echo $"HTTP/1.1 200 OK\r"
echo $data