Project

General

Profile

[Solved] how to run 2 server under one host domain by using django + FCGI+lighttpd

Added by about 13 years ago

i have one server running a website using django + FCGI+lighttpd right now. The conf file is something below:

$HTTP["host"] =~ "address"{
    fastcgi.server += ( "/xxxx.fcgi" =>
      (
       ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable",),
       ),
    )
    alias.url += (
            "/static/" => "mediapath/" 
    )
    url.rewrite-once += (
            "^/a/(.*)$" => "/static/a/$1",
            "^/(favicon\.ico)$" => "/static/$1",
            "^/(crossdomain\.xml)$" => "/static/$1",
            "^/(robots\.txt)$" => "/static/$1",

            "^(/.*)$" => "/xxxx.fcgi$1",
    )}

and using

python manage.py runfcgi host=0.0.0.0 port=8001 daemonize=False
to run one instance

And I need to run

python manage.py runfcgi host=0.0.0.0 port=8002 daemonize=False
for another website on port 8002 with the same domain name of the current server which is running on port 8001

how can I write the configuration file ?


Replies (2)

RE: how to run 2 server under one host domain by using django + FCGI+lighttpd - Added by about 13 years ago

I have try the fellowing conf :

$SERVER["socket"] == ":8080" {
            alias.url += (
                "/static/" => "/var/www/django/urdrive_report/static/" 
        )
        url.rewrite-once += (
                "^/a/(.*)$" => "/static/a/$1",
                "^/(favicon\.ico)$" => "/static/$1",
                "^/(crossdomain\.xml)$" => "/static/$1",
                "^/(robots\.txt)$" => "/static/$1",

                "^(/.*)$" => "/urdrive-app-2.fcgi$1",
        )
        }

$SERVER["socket"] != ":8080" {
            alias.url += (
                "/static/" => "/var/www/django/urdrive/trunk/urdrive_report/static/" 
        )

        url.rewrite-once += (
                "^/a/(.*)$" => "/static/a/$1",
                "^/(favicon\.ico)$" => "/static/$1",
                "^/(crossdomain\.xml)$" => "/static/$1",
                "^/(robots\.txt)$" => "/static/$1",

                "^(/.*)$" => "/urdrive-app.fcgi$1",
        )
        }

$HTTP["host"] =~ ".*" {
        fastcgi.server += ( "/urdrive-app.fcgi" =>
                (
                 ( "host" => "127.0.0.1", "port" => 8001, "check-local" => "disable",),

                ),
        )

        fastcgi.server += ( "/urdrive-app-2.fcgi" =>
                (

                 ( "host" => "127.0.0.1", "port" => 8002, "check-local" => "disable",),          
                ),
        )

}

it works on ubuntu 10.10 and lighttpd/1.4.26 (ssl) - a light and fast webserver

but that doesnt work on ubuntu 9.10 and lighttpd-1.4.22 (ssl)

is there anybody know the reason why ?

RE: [Solved] how to run 2 server under one host domain by using django + FCGI+lighttpd - Added by gstrauss over 3 years ago

it works on ubuntu 10.10 and lighttpd/1.4.26 (ssl) - a light and fast webserver
but that doesnt work on ubuntu 9.10 and lighttpd-1.4.22 (ssl)
is there anybody know the reason why ?

It is likely that something was fixed between 1.4.22 and 1.4.26

    (1-2/2)