PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : CGI mit thttpd



GeneralFailure
23.12.07, 14:24
Hallo,

ich möchte gerne CGI mit thttpd benutzen.

thttpd.conf:


port=80

# chroot/nochroot
# Sets whether thttpd will chroot after starting.
# Default: nochroot
chroot

# 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

# 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=/var/www/cgi-bin/*


ls -la von /var/www/cgi-bin/hw.pl:


-rwxr-xr-x 1 root root 76 2007-12-23 14:20 hw.pl


hw.pl:


#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World.";


Wenn ich das Skript im Browser aufrufe bekomme ich folgenden Fehler:


403 Forbidden
The requested URL '/cgi-bin/hw.pl' resolves to a file which is marked executable but is not a CGI file; retrieving it is forbidden.

Was mache ich falsch?