下载与介绍
http://code.google.com/p/rock-php/
https://github.com/mongodb/mongo-php-driver
1.安装WEB-PHP环境
# yum install apache php php-devel php-cli
2.安装mongo-php驱动
# tar xzf mongodb-mongo-php-driver-1.2.6-83-gcdb8c36.tar
# cd mongodb-mongo-php-driver-cdb8c36
# phpize
# ./configure
# make install
在php.ini中添加模块支持并检查
# vim /etc/php.ini
extension=mongo.so
# vim /var/www/html/info.php
phpinfo();
?>
# /etc/init.d/httpd start
访问 http://192.168.1.100/info.php 查找mongo模块
3.安装rockmongo与配置访问的服务器
# unzip rockmongo-v1.1.0.zip -d /var/www/html/rockmongo
配置访问的服务器
# vim /var/www/html/rockmongo/config.php
$MONGO["servers"][$i]["mongo_name"] = "Test";//mongo server name
$MONGO["servers"][$i]["mongo_host"] = "192.168.1.100";//mongo host
$MONGO["servers"][$i]["mongo_port"] = "10003";//mongo port
$MONGO["servers"][$i]["mongo_timeout"] = 30;//mongo connection timeout
//$MONGO["servers"][$i]["mongo_db"] = "MONGO_DATABASE";//default mongo db to connect, works only if mongo_auth=false
//$MONGO["servers"][$i]["mongo_user"] = "MONGO_USERNAME";//mongo authentication user name, works only if mongo_auth=false
//$MONGO["servers"][$i]["mongo_pass"] = "MONGO_PASSWORD";//mongo authentication password, works only if mongo_auth=false
$MONGO["servers"][$i]["mongo_auth"] = false;//enable mongo authentication?
$MONGO["servers"][$i]["control_auth"] = true;//enable control users, works only if mongo_auth=false
$MONGO["servers"][$i]["control_users"]["admin"] = "admin";//one of control users [USERNAME]=PASSWORD, works only if mongo_auth=false
$MONGO["servers"][$i]["ui_only_dbs"] = "";//databases to display
$MONGO["servers"][$i]["ui_hide_dbs"] = "";//databases to hide
$MONGO["servers"][$i]["ui_hide_collections"] = "aaa,bbb";//collections to hide
$MONGO["servers"][$i]["ui_hide_system_collections"] = false;//if hide the system collections
$i ++;
增加新的服务器
$MONGO["servers"][$i]["mongo_name"] = "product";//mongo server name
$MONGO["servers"][$i]["mongo_host"] = "192.168.1.4";//mongo host
$MONGO["servers"][$i]["mongo_port"] = "27017";//mongo port
$MONGO["servers"][$i]["mongo_timeout"] = 30;//mongo connection timeout
$MONGO["servers"][$i]["mongo_db"] = "product";//default mongo db to connect, works only if mongo_auth=false
$MONGO["servers"][$i]["mongo_user"] = "product_ro";//mongo authentication user name, works only if mongo_auth=false
$MONGO["servers"][$i]["mongo_pass"] = "sadfjoweh";//mongo authentication password, works only if mongo_auth=false
$MONGO["servers"][$i]["mongo_auth"] = false;//enable mongo authentication?
$MONGO["servers"][$i]["control_auth"] = true;//enable control users, works only if mongo_auth=false
$MONGO["servers"][$i]["control_users"]["mongouser1"] = "xzcveqa";//one of control users [USERNAME]=PASSWORD, works only if mongo_auth=false
$MONGO["servers"][$i]["control_users"]["mongouser2"] = "asdfgeq";//one of control users [USERNAME]=PASSWORD, works only if mongo_auth=false
$MONGO["servers"][$i]["ui_only_dbs"] = "";//databases to display
$MONGO["servers"][$i]["ui_hide_dbs"] = "";//databases to hide
$MONGO["servers"][$i]["ui_hide_collections"] = "";//collections to hide
$MONGO["servers"][$i]["ui_hide_system_collections"] = true;//if hide the system collections
$i ++;
访问 http://192.168.1.100/rockmongo/