Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and self-startup method under Mongodb Ubuntu

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Today, I took some time to install the Mongodb database under Ubuntu 13.10. Now I write down the installation operation method and the automatic startup method:

1. apt-get update Update 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/mongodbvi /etc/init.d/mongodb DATA=/www/mongodbmkdir /www/mongodb/ chown -R mongodb:nogroup /www/mongodb/

4. Start Mongodb

/etc/init.d/mongodb start,

It is started by default when it is installed at the beginning. This step is not required.

5. Confirm if startup is successful

netstat -antup cat /var/log/mongodb/mongodb.log

6. Testing the mongo client

mongo db.foo.save({a:1}) db.foo.findOne()

7. Operation Mongodb service background automatic start

Enter the following command under/usr/bin/

./ mongod --dbpath /var/lib/mongodb/ --logpath /var/log/mongodb/mongodb.log --logappend &

background running program

At this point, the Mongodb database is installed.

Additional information:

How to open Mongodb extensions in PHP?

1. Install php mongo

sudo pecl install mongo

2. enablement module

vi /etc/php5/cli/conf.d/mongodb.ini

extension=mongo.so

3. Confirm successful installation

php -m

4. restart Apache

Done!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report