我安装过的
1、源码安装apache2、php5、rockmongo
2、nginx、php、rockmongo
3、yum rpm 环境lamp装的rockmongo
4、windows下装的,nginx和rockmongo集成的,
一、源码的apache2、php5、rockmongo
a、apache2、php5源码环境已经有了(网上太多教程);
b、下载rockmongo及mongo驱动
wget -S http://rock-php.googlecode.com/files/rockmongo-v1.1.0.zip
wget -S http://rockmongo.com/downloads/go?id=12 #rockmongo-1.1.5
wget -S http://pecl.php.net/get/mongo-1.2.9.tgz
c、先安装mongo驱动
#tar -zxf mongo-1.2.9.tgz
#cd mongo-1.2.9
#/usr/loca/php5/bin/phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
#./configure --with-php-config=/usr/local/php5/bin/php-config
#make && make install
Installing shared extensions: /usr/lib/php/modules/
检测是否安装成功
#/usr/local/php5/bin/php -i | grep extension_dir
e、修改php.ini文件添加mongo模块
在/usr/local/php5/php.ini文件中增加如下内容。
修改extension_dir 为extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-zts-20100525"
extension=mongo.so #添加mongo模块
extension=/usr/local/php5/lib/php/extensions/no-debug-zts-20100525/mongo.so
[sqlite3]
sqlite3.extension_dir =/usr/local/php5/lib/php/extensions/no-debug-zts-20100525
f、解压rockmongo文件到apache2指定目录,修改apache2配置文件和rockmongo的连接mongo服务器配置文件
之后重启apache2,正常情况会有如下提示
extension_dir => /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626 => /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626
sqlite3.extension_dir => /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626 => /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626
二、nginx+php+rockmongo源码和上面apache2源码差不多,下面是遇到的问题
运行/usr/local/webserver/php/bin/phpize时出现: 表示缺少autoconf m4
Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
可以通过yum install autoconf m4 -y 或下载源码安装
wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
三、全yum rpm安装
基础环境yum装的cacti,apache、http都有,
1、wget -S http://rock-php.googlecode.com/files/rockmongo-v1.1.0.zip
wget -S http://rockmongo.com/downloads/go?id=12 解压即可
wget -S http://pecl.php.net/get/mongo-1.2.9.tgz
tar -zxf mongo-1.2.9.tgz
phpize (没有的 话得yum install php-devel -y)
./configure && make && make install
2、修改vim /etc/php.ini添加mongo模块
extension=mongo.so
3、修改http配置文件,添加虚拟主机目录,添加如下
listen 82
DocumentRoot /data/rockmongo
ErrorLog logs/gm-error_log
CustomLog logs/dummy-host.example.com-access_log common
4、解压rockmongo到http指定目录,并修改conf.conf文件
5、通过浏览器访问http://ip:端口访问,(注意查看其防火墙规则 )
四、windows下的rockmongo安装
http://rockmongo.com/downloads/go?id=5 下载解压后,修改rockmongo-on-windows\web\rockmongo\config.php中mongo服务器地址,启动主目录下的rockstart.bat 文件即可。