Install Lighttp 1.4 w/ FastCGI on OpenBSD 4.0

Install Packages
pkg_add -v ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/fcgi-2.4.0p1.tgz
pkg_add -v ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/lighttpd-1.4.11-mysql.tgz

Example /etc/lighttpd.conf For PHP
$HTTP["host"] == “www.<example>.com” {
   server.document-root = “/www/sites/<example>.com/www/”
   index-file.names = ( “index.php” )
   server.error-handler-404 = “/index.php”
fastcgi.server = ( “.php” =>
   ( “localhost” =>
      (
         ”socket” => “/tmp/php-fastcgi.socket”,
         ”bin-path” => “/usr/local/bin/php-fcgi”
      )
   )
)
}

Example /etc/lighttpd.conf For Ruby on Rails
$HTTP["host"] == “www.<example>.com” {
   server.indexfiles = ( “index.html” )
   server.error-handler-404 = “/dispatch.fcgi”
   server.document-root = “/Rails/public”
   fastcgi.server = (”.fcgi” => ( “<example>” =>
      ( “min-procs” => 1,
         ”max-procs” => 5,
         ”socket” => “/tmp/rails-<example>.fastcgi”,
         ”bin-path” => “/Rails/public/dispatch.fcgi”,
         ”bin-environment” => ( “RAILS_ENV” => “production” )
      )
   ))
}

Start Daemon on Server Startup, Add to rc.local
if [ -x /usr/local/sbin/lighttpd ] ; then
  echo ‘Lighttp’
  /usr/local/sbin/lighttpd -f /etc/lighttpd.conf
fi

This entry was posted in 4.0, FastCGI, Lighttp, PHP, Rails, Ruby. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • 4.0 (5)
    4.1 (3)
    CentOS (4)
    FastCGI (4)
    Lighttp (3)
    Linux (2)
    MySQL (5)
    Network (1)
    PHP (2)
    Rails (4)
    Ruby (6)
    S3 (1)
    Search Engine Optimization (1)
    Unix (2)
    VMWare (2)
    Web Services (2)
    WordPress (1)

    WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

  • Categories

  • Recent Posts