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 line to your php.ini file:

# vi /etc/php.ini

After opening the php.ini file,

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 sign-in with the default username and password (admin/admin)
RockMongo

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: 127.0.0.1:27017: Permission denied.

# /usr/sbin/setsebool -P httpd_can_network_connect 1 

Then restart Apache.

REFERENCES

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

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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