I know shit about cgi *disclaimer* and as kfx and many will be quick
to point out, I have lots to learn...
Ok I have cgi programs working in bash.
I can't seem to get rc cgi working.
Can someone post a basic rc cgi script I can use to test?
$ egrep -v '^$|#' /usr/local/etc/hiawatha/hiawatha.conf
ServerId = kuma
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /home/logs/hiawatha/system.log
GarbageLogfile = /home/logs/hiawatha/garbage.log
Binding {
Port = 80
Interface = 192.168.10.132
MaxKeepAlive = 30
TimeForRequest = 3,20
}
CGIhandler = /bin/bash:bash
CGIhandler = /usr/local/plan9/bin/rc:rc
Hostname = 192.168.10.132
WebsiteRoot = /home/default
StartFile = index.html
AccessLogfile = /home/logs/hiawatha/access.log
ErrorLogfile = /home/logs/hiawatha/error.log
VirtualHost {
Hostname = boxxy.com
WebsiteRoot = /home/werc/sites/boxxy.com
StartFile = index.html
AccessLogfile = /home/logs/boxxy.com/access.log
ErrorLogfile = /home/logs/boxxy.com/error.log
TimeForCGI = 10
ExecuteCGI = yes
}
This script works:
$ cat date.bash
echo "Content-type: text/html"
echo ""
echo 'tits' >> afile
echo "<pre>$(uname -a)</pre>"
echo "<pre>$(date)</pre>"
echo "<pre>$(df -h)</pre>"
#echo "<pre> </pre>"
echo "<pre>$(free -m)</pre>"
echo "<pre>$(vmstat -S m)</pre>"
This script doesn't:
$ cat echo.rc
echo "Content-type: text/plain"
echo ""
date
This script also works:
$ cat stat.bash
echo "Content-type: text/plain"
echo ""
uname -a
date
free -m
The log shows this error:
tail -20 /home/logs/boxxy.com/error.log
Wed 28 Jul 2010 18:31:37 -0700|192.168.10.132|/home/werc/sites/
boxxy.com/echo.rc|echo: No such file or directory
Wed 28 Jul 2010 18:31:37 -0700|192.168.10.132|/home/werc/sites/
boxxy.com/echo.rc|echo: No such file or directory
Wed 28 Jul 2010 18:31:37 -0700|192.168.10.132|/home/werc/sites/
boxxy.com/echo.rc|date: No such file or directory
Wed 28 Jul 2010 18:31:37 -0700|192.168.10.132|/home/werc/sites/
boxxy.com/echo.rc|no output
I am looking here to see some info about standard out..
http://doc.cat-v.org/plan_9/4th_edition/papers/rc
and here
http://www.grymoire.com/Unix/Sh.html
but can't pin it down..
If someone could post a rc cgi that should work thx!
--
You received this message because you are subscribed to the Google Groups
"werc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/werc9?hl=en.