[架设教程]Fedora14架设lnmp+mongodb

作者:笨小孩 发布于:2013-2-26 11:43 分类:环境架设

su root
mkdir /home/apps

#安装php+php-fpm+nginx
cd /home/apps
wget -c http://soft.vpser.net/lnmp/lnmp0.9-full.tar.gz
tar zxvf lnmp0.9-full.tar.gz
cd lnmp0.9-full/
./centos.sh 2>&1 | tee lnmp.log

#安装php的mongo扩展
cd /home/apps
wget -c http://pecl.php.net/get/mongo-1.0.11.tgz
tar zxvf mongo-1.0.11.tgz
cd mongo-1.0.11/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-mongo
./configure --with-php-config=/usr/local/php/bin/php-config
make
mkdir -p /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
cp modules/mongo.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
修改:/usr/local/php/etc/php.ini   加入:extension=mongo.so
/etc/init.d/php-fpm restart

#安装数据库mongodb
cd /home/apps
wget -c http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.2.3.tgz
tar zxvf mongodb-linux-i686-2.2.3.tgz
cp -r mongodb-linux-i686-2.2.3 /usr/local/mongodb
mkdir -p /data/mongodb/db
touch /data/mongodb/log
cd /usr/local/
./mongodb/bin/mongod --dbpath=/data/mongodb/db --logpath=/data/mongodb/log --logappend
在浏览器输入:http://localhost:27017/,可以看到如下提示:
You are trying to access MongoDB on the native driver port. For http diagnostic access, add 1000 to the port number
  如此,MongoDB数据库服务已经成功启动了。
#启动
/usr/local/mongodb/bin/mongod --dbpath /data/mongodb/db --port 27017 --logpath=/data/mongodb/log --logappend
#停止
rm -f /data/mongodb/db/mongod.lock

标签: lnmp Fedora14 mongodb

发表评论:

手机版 | 
Copyright © 2012 lamp46.com All Right Reserved. sitemap