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
# cd mongo-php-driver/
# phpize
# ./configure
# make all
# make install

Add the following line to your php.ini file:

# vi /etc/php.ini

After opening the php.ini file,

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
# mv /var/www/html/
# cd /var/www/html/
# unzip
# /etc/init.d/httpd restart

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

We can change the sing-in account in config.php file:

# vi /var/www/html/rockmongo/config.php

find the following snippet and change it

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

TROUBLESHOOTING – Open Apache httpd web server port 80

# vi /etc/sysconfig/iptables 

Add the following line to your iptables:

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

TROUBLESHOOTING – Unable to connect MongoDB

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

# /usr/sbin/setsebool -P httpd_can_network_connect 1 

Then restart Apache.


  1. PHP: Installation – Manual
  2. Install RockMongo For Mongodb On CentOS, RHEL, Debian, Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s