Jen-Ming Chung

Install RockMongo for Mongodb on CentOS

Install the prerequisites for mongo-php-driver and some development tools:

# yum install php-devel git httpd
# yum install gcc make

Compile the driver from the latest source code on Github:

# git clone https://github.com/mongodb/mongo-php-driver.git
# cd mongo-php-driver/
# phpize
# ./configure
# make all
# make install

Add the following parameter to /etc/php.ini file to load the extension on PHP startup:

extension=mongo.so

Get the latest rockmongo zip file and unzip it into root directory of the Apache web server, i.e., RockMongo v1.1.5 (2012/12/20); Remember to restart the Apache.

# wget http://rockmongo.com/downloads/go?id=12
# mv rockmongo-1.1.5.zip /var/www/html/
# cd /var/www/html/
# unzip rockmongo-1.1.5.zip
# /etc/init.d/httpd restart

Visit http://ipaddress-or-hostname/rockmongo and login with the default username and password (admin/admin).

RockMongo v1.1.5

If you want to change the default login account can open /var/www/html/rockmongo/config.php in a text editor and change/set the following configuration parameters:

$MONGO["servers"][$i]["control_users"]["admin"] = "admin"; 

Operational FAQ

This section collects the problems I met when operating the RockMongo.

Unable to Reach the Apache Web Server?

Open /etc/sysconfig/iptables in the editor of your choice and add the following line:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

Unable To Connect Mongodb?

Unable to connect MongoDB, please check your configurations. MongoDB said:Failed to connect to: 127.0.0.1:27017: Permission denied.

# /usr/sbin/setsebool -P httpd_can_network_connect 1 
# service httpd restart

Further readings

Comments