[中文版]
[前言] 經過一段時間的試驗後, 在BCM4780的小NAS上終於可以跑Lighttpd+PHP+MySQL了, 原本想說使用nginx+php+mysql方案的...不過目前卡在PHP還無法正常動作所以檔案還未放出, 在這裡我已經把相關檔案都打包好了, 可以更快速的安裝及執行
首先要先確認有「bcm47xx-debian」的apt source, 接著執行以下動作 (如果沒設定,請參考這裡)
apt-get update
apt-get install mysql php libpcre lighttpd libfam0
設定 MySQL
1. 如果第一次使用mysql, 先確認是否mysql的用戶存在, 如果沒有先加一個,如果已經該帳號可以直接跳過下一步
groupadd mysql
useradd -g mysql -s /sbin/nologin -d /dev/null mysql
2. 使用「mysql_install_db」先進行基本資料庫的安裝,接著直接使用以下命令啟動
/etc/init.d/mysql start
3. 看看是否mysql正常啟動, 可以使用「ps -A|grep mysqld」來進行查詢
設定 Lighttpd
1. 檢查系統是否有「www」的使用者, 如果沒有請自行加入
groupadd www
useradd -g www -s /sbin/nologin -d /dev/null www
2. 設定 lighttpd.conf, 如果有需要的話可以自行更改 /etc/lighttpd/lighttpd.conf (預設已經設定好網頁根目錄為 /var/www , fastcgi 為啟動)
3. 啟動lighttpd
/etc/init.d/lighttpd start
實驗心得: 以下為實際安裝後的運行結果, 速度感覺還可以 :D
http://bcm4780.orz101.net:9009/discuz
http://bcm4780.orz101.net:9009/phpinfo.php
[English]
The below guidelines introduce how to setup lighttpd + php + mysql on Debian of BCM4780 (MIPSEL) NAS.
First, please check if the "debian-bcm47xx" apt server has been added to sources.list. If you don't have it, see this post to setup.
Then, do apt update and related packages install. See below.
apt-get update
apt-get install mysql php libpcre lighttpd libfam0
After installation, we will need to configure them.
Configure MySQL:
1. Check if the "mysql" user exists in system, if not please add it such below.
groupadd mysql
useradd -g mysql -s /sbin/nologin -d /dev/null mysql
2. Initialize MySQL DB
mysql_install_db
3. Start MySQL server
/etc/init.d/mysql start
4. Check if mysqld is running. You can use "ps -A|grep mysqld" to query status.
Configure Lighttpd:
1. Check if the "www" user exists in system, if not please add it such below.
groupadd www
useradd -g www -s /sbin/nologin -d /dev/null www
2. Setting webroot folder (if need). Configuration file is located in /etc/lighttpd/lighttpd.conf
In default, the wwwroot is /var/www, and fastcgi is enabled.
3. Start web server
/etc/init.d/lighttpd start
Note: Packages information
lighttpd (1.4.19)
libpcre (7.8)
mysql (5.1.33)
php (5.2.9)
~ End
Comments
Not sure for your question....
Dear Sir,
I am not sure what problem is. The package includes mod_rewrite, and it is located in /usr/lib/lighttpd/mod_rewrite.so
Have you ever modify the config file?
If yes, please check if there is any syntax? Such as if there is any missing between modules.
There should be a comma "," in each mod separately. See below as example.
server.modules = (
"mod_rewrite",
"mod_fastcgi")
Another Error encountered
hi Wuqi,
Please see below information when I tried to run it:
(none):~# /etc/init.d/lighttpd start
Starting web server: lighttpd2009-04-22 08:53:27: (configfile.c.855) source: /etc/lighttpd/lighttpd.conf line: 70 pos: 123 parser failed somehow near here: mod_rewrite
failed!
Another Error encountered
hi Wuqi,
Please see below information when I tried to run it:
(none):~# /etc/init.d/lighttpd start
Starting web server: lighttpd2009-04-22 08:53:27: (configfile.c.855) source: /etc/lighttpd/lighttpd.conf line: 70 pos: 123 parser failed somehow near here: mod_rewrite
failed!
Try to install libfam0 package.
Dear Sir,
It seems the required libfam package is not installed. Please try below.
apt-get install libfam0
I will update the lighttpd package dependency. Thanks.
ERROR when i tried to start the lighttpd
hi wuqi,
i tried to start the lighttpd, it comes with follwoing info.:
(none):~# /etc/init.d/lighttpd start
Starting web server: lighttpd/usr/sbin/lighttpd: error while loading shared libraries: libfam.so.0: cannot open shared object file: No such file or directory
failed!
why?thanks.