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!)

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

Updated lighttpd control script to kill FCGIs

#!/bin/sh

LIGHTTPD_CONF=/home/USERNAME/etc/lighttpd.conf
PIDFILE=/home/USERNAME/var/run/lighttpd.pid

case "$1" in
    start)
      # Starts the lighttpd deamon
      echo "Starting Lighttpd"
      /usr/local/sbin/lighttpd -f $LIGHTTPD_CONF
    
  ;;
    stop)
      # stops the daemon bt cat'ing the pidfile
      echo "Stopping Lighttpd"
      kill -9 `cat $PIDFILE`
      # kills the dispatch.fcgis
      ps axww | grep dispatch | egrep -v 'grep' | awk '{ print $1 }' | xargs kill -9 
  ;;
    restart)
        ## Stop the service regardless of whether it was
        ## running or not, start it again.
        echo "Restarting Lighttpd"
        $0 stop
        $0 start
  ;;
    reload)
      # reloads the config file by sending HUP
      echo "Reloading config"
      kill -HUP `cat $PIDFILE`
  ;;
    *)
            echo "Usage: lighttpdctl (start|stop|restart|reload)"
            exit 1
        ;;
esac

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" )
  )))
}
« Newer Snippets
Older Snippets »
2 total  XML / RSS feed