Use rockmongo to manage MongoDB

Source: Internet
Author: User
Tags mongodb driver mongodb server

I tried phpMyAdmin a few days ago. It is fully functional and easy to use. I have also seen some MongoDB management tools recommended by nosqlfan before, so I want to give it a try. Several trial tools are recommended in MongoDB management tools, and rock_mongo is selected at a Glance. Facts have proved that the selection is correct and there are also Chinese documents.

I. Installation

The installation is very simple and requires three conditions:

1. PhP5 and later versions

2. MongoDB driver for PHP

3. Apache, nginx, and other HTTP servers

Because phpMyAdmin is installed before, PHP is already Version 5.3, and Apache is running, so there is nothing leftMongoDB driver for PHP. Php-mongo-driver has a detailed installation documentation. you can install it according to the installation steps. The installation process is as follows:

First, I tried to install the RPM package, but failed due to the PHP-common version :(

# Wget http://csaapi.hu/RHEL/x86_64/php_mongo/php-mongo-1.0.10-csaapi.x86_64.rpm# Yum-y install php-mongo-1.0.10-csaapi.x86_64.rpmphp53-common-5.3.3-1.el5_7.3.x86_64 from installed has depsolving problems --> php53-common conflicts with PHP-commonerror: php53-common conflicts with PHP-Common you cocould try using -- skip-broken to work around the problem

Then download and installSource codeCompile and install:

 
# Wget -- no-check-certificate https://nodeload.github.com/mongodb/mongo-php-driver/tarball/master# mv master php-mongo.tar.gz # tar xzvf php-mongo.tar.gz # cd mongodb-mongo-php-driver-45e8b42/# phpize-Bash: phpize: Command not found

The phpize command does not exist. Run the following command to install the php development kit:

 
Yum-y install php53-devel.x86_64

After installation, install PHP-mongo-Driver:

# Phpize #./configure # Make installinstalling shared extensions:/usr/lib64/PHP/modules/

Go to the/usr/lib64/PHP/modules/directory to view the Mongo. So file.

Rock_mongo does not need to be installed, download (http://code.google.com/p/rock-php/downloads/list) unzip is available, I download here is v1.1.0.

Ii. Configuration

1. Configure the MongoDB driver to be loaded when PHP is started.

 
# Vim/etc/PHP. ini

Add one row: Extension = Mongo. So.

2. Configure Apache

Modify the/etc/httpd/CONF/httpd. conf file and add the following content:

Alias/rockmongo "/var/rockmongo/" <directory "/var/rockmongo"> options none AllowOverride none order allow, deny allow from all </directory>

/Var/rockmong/is the directory decompressed by rockmongo. In Apache, I also configured virtual host and backend tomcat to process another application. Therefore, the following line is added in the configuration of Virtual Host:

 
Proxypass/rockmongo!

After the configuration is complete, restart the HTTPd service:

 
Service httpd restart

3. modify the configuration of MongoDB server address in config. php In rockmongo:

$ Mongo ["servers"] [$ I] ["region _name"] = "localhost "; // Mongo server name $ Mongo ["servers"] [$ I] ["mongo_host"] = "127.0.0.1 "; // Mongo host $ Mongo ["servers"] [$ I] ["pai_port"] = "12701 "; // 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 your _auth = false // $ Mongo ["servers"] [$ I] ["m Ongo_user "] =" pai_username "; // Mongo authentication user name, works only if your _auth = false // $ Mongo ["servers"] [$ I] ["Your _pass"] = "Your _password"; // Mongo authentication password, works only if your _auth = false $ Mongo ["servers"] [$ I] ["Your _auth"] = false; // enable Mongo authentication? $ Mongo ["servers"] [$ I] ["control_auth"] = true; // enable control users, works only if your _auth = false $ Mongo ["servers"] [$ I] ["control_users"] ["admin"] = "admin "; // One of control users [username] = password, works only if your _auth = false $ Mongo ["servers"] [$ I] ["ui_only_dbs"] = "mydb "; // databases to display

To ensure security, we recommend that you change the default admin password. The last line is the default database.

Iii. Use

Open the browser and enter the address http: // host/rockmongo. Enter the configured admin and its password to start using it. However, I am not very familiar with the rock_mongo interface. Let's talk about it later.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.