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 »
4 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

My Typo Lighttpd host conditional

$HTTP["host"] =~ "(typo|blog)\.simplicio\.(com|net|org)" {
server.document-root = "/home/rsimplicio/web/public/typo/"

url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
server.error-handler-404 = "/dispatch.fcgi"
server.indexfiles = ( "dispatch.fcgi")

fastcgi.server = ( ".fcgi" =>
( "Simplicio-typo" =>
(
"socket" => "/home/rsimplicio/web/lighttpd-typo-fcgi.socket",
"bin-path" => "/home/rsimplicio/web/public/typo/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "production" ),
"max-load-per-proc" => 25,
"min-procs" => 1,
"max-procs" => 1,
"idle-timeout" => 60
)
)
)
}

Typo current error

NoMethodError in Admin/content#new 
undefined method `text_filter=' for #
app/controllers/admin/content_controller.rb:24:in `new'
Show framework trace 
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:1200:in `method_missing'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `perform_action_without_filters'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in `perform_action_without_benchmark'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `measure'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in `perform_action'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `process'
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'
/home/rsimplicio/web/public/typo/dispatch.fcgi:20
/home/rsimplicio/web/public/typo/dispatch.fcgi:18:in `each_cgi'
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:in `each'
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:in `each_cgi'
/home/rsimplicio/web/public/typo/dispatch.fcgi:18
    
Request
Parameters: None

Show session dump

--- 
:user: !ruby/object:User 
  attributes: 
    name: Robert
    id: "1"
    password: <snipped for security reasons>
    login: Robert
    email: 
:return_to: 
flash: !ruby/hash:ActionController::Flash::FlashHash {}
Response
Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"}

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