Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!

Ogłoszenie

Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

#1  2014-04-24 14:30:22

  hello_world - Członek DUG

hello_world
Członek DUG
Skąd: Rymanów Zdrój
Zarejestrowany: 2010-06-03
Serwis

Lighttpd na RasberryPi i cgi

Mam problem z wyświetlaniem skryptów perl i pythona na Rasbianie. Cały czas mam 404 not found. Piszą ludzie o tym problemie ale w 2008/2009 roku.
Mój lighttpd.conf to:

Kod:

server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
#       "mod_rewrite",
)

server.document-root        = "/var/www"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
accesslog.filename          = "/var/log/lighttpd/access.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80
server.bind                 = "192.168.20.105"


index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

dir-listing.activate        = "enable"
# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

i 10-cgi.conf

Kod:

# /usr/share/doc/lighttpd/cgi.txt

server.modules += ( "mod_cgi" )

$HTTP["url"] =~ "^/cgi-bin/" {
        cgi.assign = ( ".pl" => "/usr/bin/perl", ".py" => "/usr/bin/python" )
}

## Warning this represents a security risk, as it allow to execute any file
## with a .pl/.py even outside of /usr/lib/cgi-bin.
#
#cgi.assign      = (
#       ".pl"  => "/usr/bin/perl",
#       ".py"  => "/usr/bin/python",
#)

Offline

 

#2  2014-04-30 14:32:42

  Jacekalex - Podobno człowiek...;)

Jacekalex
Podobno człowiek...;)
Skąd: /dev/random
Zarejestrowany: 2008-01-07

Re: Lighttpd na RasberryPi i cgi

A gdzie masz folder cgi-bin/ ze skryptami?

Bo ja mam:

Kod:

ls  /var/www/localhost/
cgi-bin  htdocs

Tu masz domyślny konfig z Gentoo, działa od kopa:

Kod:

cat /etc/lighttpd/mod_cgi.conf 
###############################################################################
# mod_cgi.conf
# include'd by lighttpd.conf.
# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/mod_cgi.conf,v 1.1 2005/08/27 12:36:13 ka0ttic Exp $
###############################################################################

#
# see cgi.txt for more information on using mod_cgi
#

server.modules += ("mod_cgi")

# NOTE: this requires mod_alias
 alias.url  += (
     "/cgi-bin/"        =>        var.basedir + "/cgi-bin/"
 )

#
# Note that you'll also want to enable the
# cgi-bin alias via mod_alias (above).
#

$HTTP["url"] =~ "^/cgi-bin/" {
    dir-listing.activate = "disable"
    cgi.assign = (
        ".pl"    =>    "/usr/bin/perl",
        ".cgi"    =>    "/usr/bin/perl"
    )
}

# vim: set ft=conf foldmethod=marker et :

Jest tylko pytanie, gdzie masz skrypty, domyślnie  w Debianie siedzą w /usr/lib/cgi-bin.

Dlatego radziłbym zmienić

Kod:

alias.url  += (
     "/cgi-bin/"        =>        var.basedir + "/cgi-bin/"
 )

na

Kod:

  alias.url = ( "/cgi-bin/" => "/usr/lib/cgi-bin/" )

Powinno pomóc.

czy Ty słuchasz co się do ciebie pisze?

Nie słyszę, co piszesz.... :D

Pozdro
;-)

Ostatnio edytowany przez Jacekalex (2014-04-30 15:00:32)


W demokracji każdy naród ma taką władzę, na jaką zasługuje ;)
Si vis pacem  para bellum  ;)       |       Pozdrawiam :)

Offline

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
To nie jest tylko forum, to nasza mała ojczyzna ;-)