from:https://www.digitalocean.com/community/articles/how-to-install-mongodb-on-ubuntu-12-04
Install MongoDB on Ubuntu 12.04MongoDB is a document database used commonly in modern web applications. This is tutorial should help your setup a virtual private server to use as a dedicated MongoDB server for a production Applica tion environment.
Step 1--Create a DropletThis one's easy. Once you do, go ahead and ' ssh ' in.
n.b.:: It is recommended so you configure ' ssh ' and ' sudo ' as this
Step 2--Create the Install ScriptThe MongoDB install process is simple enough to being completed with a Bash script. Copy the following into a new file named ' Mongo_install.bash ' in your home directory:
Apt-key adv--keyserver keyserver.ubuntu.com--recv 7f0ceb10
echo "Deb http://downloads-distro.mongodb.org/repo/ Ubuntu-upstart Dist 10gen "| Tee-a/etc/apt/sources.list.d/10gen.list
apt-get-y update
apt-get-y install Mongodb-10gen
Here's an explanation of the script:
The ' Apt-key ' call registers the public key of the custom 10gen MongoDB aptitude repository A custom 10gen repository list The file is created containing the location of the MongoDB binaries Aptitude are updated so this new packages can be Registere D locally on the Droplet Aptitude are told to install MongoDB
Tip:at any time, to change to your home directory, simply execute ' CD '
Step 3--Run the Install ScriptExecute the following from your home directory:
$ sudo bash./mongo_install.bash
If Everything is successful, you should the output contain a PID of the newly started process:
MongoDB start/running, Process 2368
Step 4 – Check It outBy default to install method, MongoDB should start automatically when your Droplet is booted. This means so if you are need to reboot your Droplet, MongoDB'll start right back.
To start learning about the running ' mongod ' process, run the following command:
$ ps aux | grep MONGO
One line of the output should look like the following:
MongoDB 569 0.4 6.4 627676 15936? SSL 22:54 0:02/usr/bin/mongod--config/etc/mongodb.conf
We can ...
User: ' MongoDB ' PID: ' 569 ' Command: '/usr/bin/mongod--config/etc/mongodb.conf ' config File: '/etc/mongodb.conf '
ResourcesHttp://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian-or-ubuntu-linux/https://www.digitalocean.com /community/articles/introduction-to-ssh-on-ubuntu