在Debian Lenny安裝含有PHP5和MySQL的Lighttpd
Lighttpd是個安全、快速、符合標準的並以速度效能為要件環境的web伺服器,這份教學說明如何在Debian Lenny上安裝Lighttpd,並且支援php5和MySQL。
1.初步說明
在這個教學中所使用的hostname:server1.example.com,IP address:192.168.0.100。這些設定對你來說或許不大一樣,所以你可以將適合的資料作變更。
2.安裝 MySQL 5.0
首先,我們像這樣安裝MySQL 5.0:
aptitude install mysql-server mysql-client
你將被要求提供一個密碼給MySQL root帳號 – 這個密碼是給root@localhost和root@server1.example.com,所以我們稍後不需要手動給MySQL root密碼:
New password for the MySQL "root" user: <– yourrootsqlpassword
Repeat password for the MySQL "root" user: <– yourrootsqlpassword
3. 安裝 Lighttpd
Lighttpd是可在Debian使用的軟體包,因此我們可以像這樣安裝:
aptitude install lighttpd
現在,直接在你的瀏覽器中輸入http://192.168.0.100,然後你應該看到Lighttpd的Placeholder page:
Lighttpd在Debian的預設文件根目錄是/var/www,配置檔案在/etc/lighttpd/lighttpd.conf,額外的配置檔案儲存在/etc/lighttpd/conf-available目錄中 – 這些配置檔案可以啟用lighttpd-enable-mod命令建立一個符號連結從/etc/lighttpd/conf-enabled目錄到適當的配置檔案/etc/lighttpd/conf-available。你也可以下lighttpd-disable-mod命令關閉配置
4. 安裝 PHP5
我們可以把php5工作在Lighttpd上搭配FastCGI,很幸運的,Debian提供了一個FastCGI-enabled PHP5軟體包,我們像這樣安裝:
aptitude install php5-cgi



為什麼不留下您的觀點?分享創造價值!您說呢?
想要有個性的頭像, 請到gravatar這裡申請!