Lighttpd i django + php

Instalacja i konfiguracja oprogramowania sieciowego.
siara2134
Sędziwy Jeż
Sędziwy Jeż
Posty: 50
Rejestracja: 06 wrz 2006, 17:04
Płeć: Mężczyzna
Wersja Ubuntu: 10.04
Środowisko graficzne: GNOME
Architektura: x86_64
Kontakt:

Lighttpd i django + php

Post autor: siara2134 »

Witam. Męczę się już z konfiguracją lighttpd od tygodnia. Udało mi się uruchomić django lecz php przestało działać. Chciałbym mieć stronę główną napisaną w django a np /forum by było obsługiwane przez php. Jak takiego cudu dokonać? Przeszukałem wiele stron i brak odpowiedzi.
Moja konfiguracja:

Kod: Zaznacz cały

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"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80


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

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

# 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"

$SERVER["socket"] == ":443" {
	ssl.engine = "enable"
        ssl.pemfile = "/etc/lighttpd/ssl/server.pem"  
    }
$HTTP["url"] =~ "^/owncloud/data/" {
        url.access-deny = ("")
}

$SERVER["socket"] == ":80"{
server.document-root = "/var/www/" 
fastcgi.server += (
    "/projekt.fcgi" => (
        "main" => (
			"host" => "127.0.0.1",
            "port" => 3033,
            #"socket" => "/var/www/projekt.sock",
            "check-local" => "disable",
        )
    )
)}


alias.url = (
    "/static" => "/var/www/static",
	"/media" => "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/",
)
url.rewrite-once = (
"^(/static.*)$" => "$1",
"^(/Media.*)$" => "$1",
"^(/.*)$" => "/projekt.fcgi$1",
)
#}
I

Kod: Zaznacz cały

# -*- depends: fastcgi -*-
# /usr/share/doc/lighttpd/fastcgi.txt.gz
# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi

## Start an FastCGI server for php (needs the php5-cgi package)

$SERVER["socket"] == ":8000" {
server.document-root = "/var/www/" 
fastcgi.server += ( ".php" => 
		((
			"bin-path" => "/usr/bin/php-cgi",
			"socket" => "/var/run/lighttpd/php.socket",
			"max-procs" => 1,
			"bin-environment" => ( 
				"PHP_FCGI_CHILDREN" => "4",
				"PHP_FCGI_MAX_REQUESTS" => "10000"
			),
			"bin-copy-environment" => (
				"PATH", "SHELL", "USER"
			),
			"broken-scriptfilename" => "enable"
		))
	)
}
Pozdrawiam,
Sierran
ODPOWIEDZ

Wróć do „Sieci, serwery, Internet”

Kto jest online

Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 12 gości