2009-03-11

【L】Lighttpd : Virtual Host 設定

Lighttpd : Virtual Host 的一些基本設定。

記錄下來,之後就不會忘掉了。

$HTTP["host"] =~ "^www\.portal\.com" {
  server.document-root = "/home/www/portal/"
  server.errorlog = "/home/.../portal-error.log"
  accesslog.filename = "/home/.../portal-access.log"
  server.error-handler-404 = "/404.php"
  alias.url = ( "/img/" => "/home/.../images/",
                "/js/" => "/home/.../javascript/"
              )
  fastcgi.server = ( 
    ".php" => (
 (
   "socket" => "/home/.../portal-php-fastcgi.socket",
   "bin-path" => "/home/.../php-cgi -c /.../php.ini",
   "min-procs" => 4,
   "max-procs" => 4
 )
       )
    )
  url.rewrite = (
    "^/page/([a-zA-Z0-9\=\_\-]+)$" => "/.../page.php?key=$1"
  )
}

 

這行指定要去讀取那一個php.ini 。

"bin-path" => "/home/php/bin/php-cgi -c /home/php/lib/portal-php.ini"

(感謝聿彣指導如何設定Virtual Host讀取不同的php.ini)

0 comments:

張貼留言