Home > Notes > FreeBSD安装Nginx+PHP+Mysql

FreeBSD安装Nginx+PHP+Mysql

Thu, 03 Dec 2009 15:26:58 +0800

首先,需要强调的是,用ports安装,避免叮叮当当的许多问题。

FB 7.0 -RELEASE

之前的版本了,所以更新一下ports

portsnap fetch extract update

 

安装MySQL

cd /usr/ports/databases/mysql51-server/
make WITH_CHARSET=utf-8 WITH_XCHARSET=all WITH_PROC_SCOPE_PTH=yes BUILD_OPTIMIZED=yes BUILD_STATIC=yes SKIP_DNS_CHECK=yes WITHOUT_INNODB=yes install clean
cp /usr/local/share/mysql/my-small.cnf /etc/my.cnf
 
/usr/local/bin/mysql_install_db --user=mysql
mysqladmin -u root password 'new_password' //root的新密码

 

安装 PHP 及其扩展

cd /usr/ports/lang/php5
make install clean
cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
cd /usr/ports/lang/php5-extensions/
make install clean

安装Nginx

cd /usr/ports/www/nginx/
make install clean

开机启动

vi /etc/rc.conf
mysql_enable="YES"
nginx_enable="YES"
/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www -g www -C 4 -f /usr/local/bin/php-cgi

Tag:FreeBSD, Nginx, UNIX, WEB
Hots
评论
发表评论:


  [TIPS:首次发表评论的朋友,需要验证]
Tags
Recent Post
Recent Comments
Links
Copyright Notes
You can reship all of these articles without permission but MUST mark the original link in your post. Please contact with me() if u have advice or other arrangements.
Copyright©2007-2011 lewphee.com All rights reserved.