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 »
6 total  XML / RSS feed 

Chained SSL certs in lighttpd

ssl.ca-file = "/usr/local/openssl/certs/chain.ca.crt"
ssl.pemfile = "/usr/local/openssl/certs/server.pem"

Using HTTP conditions and url.access-deny to have Lighttpd block some user agents and referers

# deny access for Indy Library a Tester
$HTTP["useragent"] =~ "Indy" { url.access-deny = ( "" ) }
 
# deny access for a hydrocodone containing refer 
$HTTP["referer"] =~ "hydrocodone" { url.access-deny = ( "" ) }

Lighttpd proxy with Tracd specific example

$HTTP["host"] == "trac.textdrive.com" #the == is to exactly match
{
proxy.server = (
"" => (                               #this is for the root, can be a .extension in other uses
"trac" => (                           #just a name, your choice
"host" => "70.84.29.150", 
"port" => 9000 
           )
       )
                )
}

Typo under lighttpd

Example vhost of a typo install under lighttpd

$HTTP["host"] =~ "typo.jasonhoffman.org" {
server.document-root = "/home/jah/apps/typo/trunk/public/"
server.error-handler-404   = "/dispatch.fcgi"
server.indexfiles           = ( "dispatch.fcgi")
server.errorlog = "/home/jah/logs/error.typo.log"
  fastcgi.server = ( ".fcgi" =>
     ( "localhost" =>
       ( "socket" => "/home/jah/tmp/typo-jah.socket",
                            "min-procs" => 2,
                            "max-procs" => 2,
         "bin-path" => "/home/jah/apps/typo/trunk/public/dispatch.fcgi",
         "bin-environment" => ( "RAILS_ENV" => "production" )
  )))
}

Automatic sub-domains with lighttpd mapping to a specific folder

Using lighttpd's mod_evhost with

# %% => % sign
# %0 => domain name + tld
# %1 => tld
# %2 => domain name without tld
# %3 => subdomain 1 name
# %4 => subdomain 2 name
#


$HTTP["host"] =~ "jasonhoffman.org" {
evhost.path-pattern        = "/home/jah/public/%3/"
}

My lighttpd php-fastcgi config with it's own php.ini

fastcgi.server = (
                ".php" =>
                    ( "localhost" =>
                        (
                            "socket" => "/home/jah/tmp/jah-php5-fcgi.socket",
                            "bin-path" => "/usr/local/www/cgi-bin/php5-fcgi -c /home/jah/etc/php.ini",
                            "bin-environment" => (
                            "PHP_FCGI_CHILDREN" => "4",
                            "PHP_FCGI_MAX_REQUESTS" => "5000"
                                                 )
                        )
                    )
                 )
« Newer Snippets
Older Snippets »
6 total  XML / RSS feed