Hallo,
ich versuche gerade mit lighttpd auf einem Raspberry Pi ein simples
"Hello World" Python-CGI-Script zum Laufen zu bringen. Das file heißt
test.py und liegt unter /usr/lib/cgi-bin/.
Das Config-file sieht so aus:
1 | server.modules = (
|
2 | "mod_access",
|
3 | "mod_alias",
|
4 | "mod_compress",
|
5 | "mod_redirect",
|
6 | "mod_cgi",
|
7 | # "mod_rewrite",
|
8 | )
|
9 |
|
10 | server.document-root = "/var/www"
|
11 | server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
|
12 | server.errorlog = "/var/log/lighttpd/error.log"
|
13 | server.pid-file = "/var/run/lighttpd.pid"
|
14 | server.username = "www-data"
|
15 | server.groupname = "www-data"
|
16 | server.port = 80
|
17 |
|
18 |
|
19 | index-file.names = ( "index.php", "index.html", "index.lighttpd.html", "index.py" )
|
20 | url.access-deny = ( "~", ".inc" )
|
21 | static-file.exclude-extensions = ( ".php", ".pl", ".py", ".fcgi" )
|
22 |
|
23 | cgi.assign = ( ".py" => "/usr/bin/python" )
|
24 |
|
25 | compress.cache-dir = "/var/cache/lighttpd/compress/"
|
26 | compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
|
27 |
|
28 | # default listening port for IPv6 falls back to the IPv4 port
|
29 | include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
|
30 | include_shell "/usr/share/lighttpd/create-mime.assign.pl"
|
31 | include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
|
Wenn ich jetzt vom PC im Browser http://192.168.178.24/cgi-bin/test.py
eingebe, bekomme ich einen "404-Not found" Fehler. Wenn ich nur die IP
eingebe, habe ich die Lighttpd default Seite, der Server sollte also
laufen. Wer weiß Rat?