更新软件包
opkg update
安装lighttpd软件包
lighttpd lighttpd-mod-access lighttpd-mod-alias lighttpd-mod-cgi lighttpd-mod-fastcgi lighttpd-mod-redirect lighttpd-mod-rewrite
opkg install lighttpd lighttpd-mod-access lighttpd-mod-alias lighttpd-mod-cgi lighttpd-mod-fastcgi lighttpd-mod-redirect lighttpd-mod-rewrite
安装php5软件包
php5 php5-cgi php5-fastcgi php5-mod-calendar php5-mod-ctype php5-mod-curl php5-mod-dio php5-mod-dom php5-mod-exif php5-mod-fileinfo php5-mod-ftp php5-mod-gd php5-mod-gettext php5-mod-gmp php5-mod-hash php5-mod-http php5-mod-iconv php5-mod-json php5-mod-ldap php5-mod-libevent php5-mod-mbstring php5-mod-mcrypt php5-mod-mysql php5-mod-mysqli php5-mod-openssl php5-mod-pcntl php5-mod-session php5-mod-shmop php5-mod-simplexml php5-mod-soap php5-mod-sockets php5-mod-sqlite php5-mod-sqlite3 php5-mod-xml php5-mod-xmlreader php5-mod-xmlwriter php5-mod-zip
opkg install php5 php5-cgi php5-fastcgi php5-mod-calendar php5-mod-ctype php5-mod-curl php5-mod-dio php5-mod-dom php5-mod-exif php5-mod-fileinfo php5-mod-ftp php5-mod-gd php5-mod-gettext php5-mod-gmp php5-mod-hash php5-mod-http php5-mod-iconv php5-mod-json php5-mod-ldap php5-mod-libevent php5-mod-mbstring php5-mod-mcrypt php5-mod-mysql php5-mod-mysqli php5-mod-openssl php5-mod-pcntl php5-mod-session php5-mod-shmop php5-mod-simplexml php5-mod-soap php5-mod-sockets php5-mod-sqlite php5-mod-sqlite3 php5-mod-xml php5-mod-xmlreader php5-mod-xmlwriter php5-mod-zip
安装date函数(要不时间显示有问题)
zoneinfo-africa zoneinfo-asia zoneinfo-atlantic zoneinfo-australia-nz zoneinfo-core zoneinfo-europe zoneinfo-india zoneinfo-middleeast zoneinfo-northamerica zoneinfo-pacific zoneinfo-poles zoneinfo-simple zoneinfo-southamerica
opkg install zoneinfo-africa zoneinfo-asia zoneinfo-atlantic zoneinfo-australia-nz zoneinfo-core zoneinfo-europe zoneinfo-india zoneinfo-middleeast zoneinfo-northamerica zoneinfo-pacific zoneinfo-poles zoneinfo-simple zoneinfo-southamerica
其实国内只需安装两个就行
opkg install zoneinfo-asia zoneinfo-core
安装mysql数据库
opkg install mysql-server
修改lighttpd配置文件
vi /etc/lighttpd/lighttpd.conf
将
#server.modules = (
# “mod_access”,
# “mod_rewrite”,
# “mod_redirect”,
# “mod_alias”,
# “mod_auth”,
# “mod_status”,
# “mod_setenv”,
# “mod_fastcgi”,
# “mod_proxy”,
# “mod_simple_vhost”,
# “mod_cgi”,
# “mod_ssi”,
# “mod_usertrack”,
# “mod_expire”,
# “mod_webdav”
#)
改为
server.modules = (
“mod_access”,
“mod_rewrite”,
“mod_redirect”,
“mod_alias”,
# “mod_auth”,
# “mod_status”,
# “mod_setenv”,
“mod_fastcgi”,
# “mod_proxy”,
# “mod_simple_vhost”,
# “mod_cgi”,
# “mod_ssi”,
# “mod_usertrack”,
# “mod_expire”,
# “mod_webdav”
)
将server.document-root = “/www” 蓝色部分改为自己网页存放地址
将index-file.names = ( “index.php”, “index.html”, “default.html”, “index.htm”, “default.htm” ) 添加蓝色部分
添加IPV6支持
# listen to ipv6
$SERVER[“socket”] == “[::]:80” { } 绿色数字处修改成所需端口,http默认端口是80
修改#### fastcgi module为下面样式
fastcgi.server = (
“.php” => (
“localhost” => (
“socket” => “/tmp/php-fastcgi.socket”,
“bin-path” => “/usr/bin/php-fcgi”
)
)
)
修改php.ini配置文件
vi /etc/php.ini
doc_root = “/www” 蓝色部分改为自己网页存放地址
date.timezone = Asia/Shanghai 蓝色部分修改为和自己时区一样的地方,国内用这个就可以
配置mysqld
vi /etc/my.cnf
datadir和tmpdir 修改成你打算放置数据库的地址
然后执行 mysql_install_db –force 建立数据库
配置数据库我也不是很明白,是很久前弄的旧数据库,这里自己百度下吧。
之后执行
/etc/init.d/lighttpd start
/etc/init.d/mysqld start
启动web服务器和数据库服务器
要是需要自启动的话
/etc/init.d/lighttpd enable
/etc/init.d/mysqld enable
即可
完