--- In Steve Pisciotta <> wrote:
>
> Jiri,
>
> Where you able to get CGI to work in thttpd? I wrote a simple c
program and I get an error message back that it's an executable file,
but not a CGI file.
>
> I've defined cgipat=/cgi-bin/*, but I'm not sure how to tell if it's
setup properly. I've done numerous searches and looks like this should
work.
>
> Thanks,
> Steve
Hi Steve,
i have cgi running on thttpd. I use Lua to script cgi but c should
work as well. This is my configuration:
:root# cat /etc/thttpd/thttpd.conf
#------------------------------------------------------------------------------#
# thttpd version 2.23beta1
#
# Main configuration file
#
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# Port: portnum
# Sets the port number which will be listened by thttpd.
# Default: 80
#
port=80
# chroot/nochroot
# Sets whether thttpd will chroot after starting.
# Default: nochroot
nochroot
# user: userid
# Specified which user to switch after intialiazation when started as
root.
# Default: www-data
user=www-data
# host: hostname
# Specifies a hostname to bind to.
# Default: Bind to all supported hostnames on the local machine.
# host=grugler
# Logfile: logfile path
# Specifies a file for logging.
# Default: Log via syslog()
# logfile=/var/log/thttpd.log
logfile=/dev/null
# throttles: file
# Specifies a file of throttle settings.
# Default: /etc/thttpd/throttle.conf
throttles=/etc/thttpd/throttle.conf
# urlpat: pattern
# Specifies which URL can only be only be accessed from the local server.
# Default: None
# urlpat=*.mpeg|*.mp3|*.wav|*.gz|*.jpg|*.gif
# dir: directory
# Specifies a directory to chdir() to after thttpd starts.
# This directory will most likely be the directory you will be serving
your
# clients from.
# Default: `cwd`
dir=/var/www
# cgipat: pattern
# Specifies which URL may contain executable CGI files.
# Default: None
cgipat=/cgi-bin/*
charset=utf-8
As I remember thttpd is touchy on access rights. This settings works
for me:
:root# cd /var/www
:www# ls -al
total 24
drwxr-x--x 6 root root 4096 Mar 8 13:41 ./
drwxr-xr-x 16 root root 4096 Mar 17 16:28 ../
drwxr-xr-x 2 root root 4096 Mar 8 13:41 cgi-bin/
:www# cd cgi-bin/
:cgi-bin# ls -al
total 88
drwxr-xr-x 2 root root 4096 Mar 8 13:41 ./
drwxr-x--x 6 root root 4096 Mar 8 13:41 ../
-rwxr-xr-x 1 root root 77 Mar 8 13:41 date.cgi*
If you have installed lua5.1 (and liblua5.1-0) you can try this:
:cgi-bin# cat date.cgi
#!/usr/bin/lua5.1
io.write('Content-Type: text/plain\n\n', os.date(), '\n')
Access to http://TS-7800/cgi-bin/date.cgi
returns:
Wed Jul 30 12:27:24 2008
P.S. Sorry for the delay. I was on holidays.
Regards Jiri
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|