1. 安裝lighttpd
# /usr/ports/www/lighttpd ; make install clean

2. 安裝php5
# /usr/ports/lang/php5 ; make install 
# /usr/ports/lang/php5-extensions ; make install

3. 建立log檔
# touch /var/log/lighttpd.access.log
# touch /var/log/lighttpd.error.log
# chown www:www /var/log/lighttpd.*
# chmod 640 /var/log/lighttpd.*

4. 檢查conf檔

server.modules =    {
                                  "mod_fastcgi",   //這行的 mark 要拿掉(支援 PHP-FastCGI)
             )
#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server = ( ".php" =>
                 ( "localhost" =>
                  (
                   #"socket" => "/var/run/lighttpd/php-fastcgi.socket", //預設值
                    "socket" => "/tmp/php-fastcgi.socket",             //修改後
                                "bin-path" => "/usr/bin/php-cgi"
                 )
                )
               )


5. 啟動lighttpd
/usr/local/etc/rc.d/lighttpd start

開機自動執行lighttpd

# vi /etc/rc.conf
lighttpd_enable="YES"

創作者介紹
創作者 mool 的頭像
mool

mool

mool 發表在 痞客邦 留言(0) 人氣( 781 )