Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Jason Hoffman http://textdrive.com/

« Newer Snippets
Older Snippets »
3 total  XML / RSS feed 

Rails and php on directories example of a lighttpd HOST conditional

$HTTP["host"] =~ "textdrive.(org|com)" {
server.indexfiles          = ( "dispatch.fcgi", "index.php" )
server.document-root             = "/users/home/website/web/public/"
url.redirect = ( "^/forum/(.*)" => "http://forum.textdrive.com/$1",
                 "^/support/(.*)" => "http://support.textdrive.com/$1" )
#url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
server.error-handler-404   = "/dispatch.fcgi"
fastcgi.server = (
               ".fcgi" =>
                    ( "localhost" =>
                        (
                            "socket" => "/tmp/textdrive-new.socket",
                            "bin-path" => "/users/home/website/web/public/dispatch.fcgi",
                            "bin-environment" => ( "RAILS_ENV" => "production" )
                        )
                    ),
".php" =>
                    ( "localhost" =>
                        (
                            "socket" => "/tmp/textdrive-php5-fcgi.socket",
                            "bin-path" => "/usr/local/www/cgi-bin/php5-fcgi",
                            "bin-environment" => (
                            "PHP_FCGI_CHILDREN" => "4",
                            "PHP_FCGI_MAX_REQUESTS" => "5000"
                                                 )
                        )
                    )
)
}

Socket conditional example (SSL) for a lighttpd instance to do another port

#### SSL engine
$SERVER["socket"] == "207.7.108.166:443" {
ssl.engine                  = "enable"
ssl.pemfile                 = "/usr/local/openssl/certs/wildcard.textdrive.com.pem"
}

How TextDrive does both PHP and Rails FCGI in one thing-a-ma-bob

fastcgi.server = (
".fcgi" =>
                    ( "localhost" =>
                        (
                            "socket" => "/tmp/textdrive-new.socket",
                            "bin-path" => "/users/home/website/web/public/dispatch.fcgi",
                            "bin-environment" => ( "RAILS_ENV" => "production" )
                        )
                    ),
".php" =>
                    ( "localhost" =>
                        (
                            "socket" => "/tmp/textdrive-php5-fcgi.socket",
                            "bin-path" => "/usr/local/www/cgi-bin/php5-fcgi",
                            "bin-environment" => (
                            "PHP_FCGI_CHILDREN" => "4",   
                            "PHP_FCGI_MAX_REQUESTS" => "5000"
                                                 )
                        )       
                    )
)
« Newer Snippets
Older Snippets »
3 total  XML / RSS feed