Install MongoDB in Ubuntu and how to start it by yourself

Source: Internet
Author: User
Tags install mongodb
The Mongodb database is installed under Ubuntu13.10. Now, write down the installation method and the automatic start method: 1. apt-getupdate: update the software library 2. apt-getinstallmongodb3. after installation, You need to modify the relevant configuration file to modify the data storage path vi/etc/mongodb. confdbpath =/www/mongodbvi/etc/init. d/mong

I installed the Mongodb database in Ubuntu 13.10. Now I want to write down the installation method and the automatic start method:

1. apt-get update Software Library

2. apt-get install mongodb

3. After installation, You need to modify the relevant configuration file to modify the data storage path.
Vi/etc/mongodb. conf
Dbpath =/www/mongodb
Vi/etc/init. d/mongodb
DATA =/www/mongodb
Mkdir/www/mongodb/
Chown-R mongodb: nogroup/www/mongodb/

4. Start Mongodb
/Etc/init. d/mongodb start, which is started by default at the beginning. You do not need this step.

5. Check whether the startup is successful.
Netstat-antup
Cat/var/log/mongodb. log

6. Test the mongo client.
Mongo
Db. foo. save ({a: 1 })
Db. foo. findOne ()

7. The Mongodb service is automatically started in the background.

Enter/usr/bin/and enter the following command:
./Mongod -- dbpath/var/lib/mongodb/-- logpath/var/log/mongodb. log -- logappend &
Background running program

At this step, the Mongodb database has been installed.

Note:

How can I enable Mongodb extension in PHP?
1. install php mongo
Sudo pecl install mongo
2. Enable the module
Vi/etc/php5/cli/conf. d/mongodb. ini
Extension = mongo. so
3. Check whether the installation is successful.
Php-m
4. Restart Apache

Complete.

Reading:

Set MongoDB boot http://www.linuxidc.com/Linux/2011-07/39149.htm in Linux

CentOS compiling and installing MongoDB http://www.linuxidc.com/Linux/2012-02/53834.htm

CentOS compilation and installation of php extension http://www.linuxidc.com/Linux/2012-02/53833.htm for MongoDB and mongoDB

CentOS 6 install MongoDB with yum and configure http://www.linuxidc.com/Linux/2012-08/68196.htm on the server side

Install MongoDB2.4.3 http://www.linuxidc.com/Linux/2013-05/84227.htm in Ubuntu 13.04

MongoDB entry must read (both concepts and practices) http://www.linuxidc.com/Linux/2013-07/87105.htm

MongoDB authoritative Guide (The Definitive Guide) English version [PDF] http://www.linuxidc.com/Linux/2012-07/66735.htm

MongoDB details: Click here
MongoDB: Click here

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-04/100753.htm

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.