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/urandom
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?[/quote]
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
Możesz wyłączyć AdBlock — tu nie ma reklam ;-)

[ Generated in 0.011 seconds, 12 queries executed ]

Informacje debugowania

Time (s) Query
0.00016 SET CHARSET latin2
0.00005 SET NAMES latin2
0.00132 SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='13.59.198.150' WHERE u.id=1
0.00108 UPDATE punbb_online SET logged=1732559446 WHERE ident='13.59.198.150'
0.00058 SELECT * FROM punbb_online WHERE logged<1732559146
0.00095 DELETE FROM punbb_online WHERE ident='185.191.171.6'
0.00055 SELECT topic_id FROM punbb_posts WHERE id=265274
0.00080 SELECT id FROM punbb_posts WHERE topic_id=25685 ORDER BY posted
0.00077 SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=25685 AND t.moved_to IS NULL
0.00007 SELECT search_for, replace_with FROM punbb_censoring
0.00087 SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=25685 ORDER BY p.id LIMIT 0,25
0.00105 UPDATE punbb_topics SET num_views=num_views+1 WHERE id=25685
Total query time: 0.00825 s