The Mongodb database is installed under Ubuntu13.10. Now write down the installation method and the automatic start method:
I installed the Mongodb database in Ubuntu 13.10. Now I want to write down the installation method and the automatic start method:
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.
Related reading:
Set MongoDB to boot automatically in Linux
CentOS compilation and installation of MongoDB
CentOS compilation and installation of php extensions for MongoDB and mongoDB
CentOS 6 install MongoDB and server configuration using yum
Install MongoDB2.4.3 in Ubuntu 13.04
MongoDB beginners must read (both concepts and practices)
MongoDB authoritative Guide (The Definitive Guide) in English [PDF]
MongoDB details: click here
MongoDB: click here