Lighttpd with PHP and MySQL

好像沒什麼好寫的

  1. cd /usr/ports/blahblah
  2. make install clean
  3. end
PHP安裝選項要選 CGI、FASTCGI。
其他的去 /usr/ports/lang/phpX-extensions 裝。
php.ini中要加
cgi.fix_pathinfo = 1
Lighttpd中MySQL要選。
預設的設定檔 /usr/local/etc/lighttpd.conf 裡面,
"mod_fastcgi",  要打開。

fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.sock", 這裡要改成這樣
"bin-path" => "/usr/local/bin/php-cgi" 這裡也是
)
)
)
記得還要自己 touch 記錄檔。

如果有些東西想要藏起來,可以用 "mod_auth" 功能,
有很多種選擇:plain, htpasswd, htdigest, LDAP 等,

以下用簡單的htpasswd就好。

auth.backend = "htpasswd"
auth.backend.htpasswd.userfile ="/path/to/.htpasswd"

auth.require = ( "/要隱藏起來的地方" =>
(
"method" => "basic",
"realm" => "不要進來",
"require" => "user=xxxxx"
)
)

htpasswd 是 apache 內建的程式,也可以透過PHP來產生,可以參考這裡


About this entry


  1. johnpupu Dec 15, 2007, 10:16:00 PM

    用unix 的 socket 可能會讓php 掛點
    我記得gslin 有寫到相關資訊

    另外你或許可以參考這個資訊
    http://trac.lighttpd.net/trac/wiki/fastcgi-php-starter-for-freebsd

    希望對你有幫助

     
  2. Monkey Dec 17, 2007, 4:36:00 AM

    謝謝 :) 我試到現在為止是還沒發生過掛點的情形,大概是負載還不高吧。

     

Have your say

You can use some HTML tags, such as <b>, <i>, <a>