FreeBSD下Lighttpd+PHP+Mysql安装配置笔记

FreeBSD下Lighttpd+PHP+Mysql安装配置笔记

1,安装mysql

cd /usr/ports/database/mysql51-server
make install clean

2,安装lighttpd

cd /usr/ports/www/lighttpd
make install clean
(默认选项)

3,安装php5

cd /usr/ports/lang/php5
make install clean
(默认选项)

4,安装php5-extensions

cd /usr/ports/lang/php5-extensions
make install clean

增加GD,MBSTRING,MCRYPT,MYSQL,MYSQLI

5,配置lighttpd

vi /usr/local/etc/lighttpd.conf

取消需要用到模块的注释,mod_rewrite,mod_access,mod_fastcgi,
mod_simple_vhost,mod_cgi,mod_compress,mod_accesslog

取消fastcgi.server的注释
fastcgi.server = ( “.php” =>
( “localhost” =>
(
“socket” => “/var/run/lighttpd/php-fastcgi.socket”,
“bin-path” => “/usr/local/bin/php-cgi”
)
)
)

另:
touch /var/log/lighttpd.access.log
touch /var/log/lighttpd.error.log
mkdir /var/run/lighttpd
chown -R www:www /var/run/lighttpd
chown www:www /var/log/lighttpd.access.log
chown www:www /var/log/lighttpd.error.log

6,启动lighttpd和mysql

vi /etc/rc.conf

增加
mysql_enable=”YES”
lighttpd_enable=”YES”

执行
/usr/local/etc/rc.d/lighttpd start
/usr/local/etc/rc.d/mysql start

原文链接:http://garey.bsdart.org/2009/12/freebsd7-2%E4%B8%8Blighttpdphpmysql%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE%E7%AC%94%E8%AE%B0/

发表评论

电子邮件地址不会被公开。 必填项已用*标注