There are 2 parts to this article:
1. Installing mongoDB Server
2. Installing PHP mongo extension and make it work!
Part 1: Installing mongoDB Server on CentOS 6.3
Create mongoDB repository configuration:
[bash]
cd /etc/yum/repos.d
vi /etc/yum.repos.d/10gen.repo
[/bash]
Write the following script to create the mongoDB repository configuration:
[bash][10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1[/bash]
Save the configuration file and install mongoDB:
[bash]yum install mongo-10gen mongo-10gen-server[/bash]
The configuration file is residing on /etc/mongod.conf, and the start/stop/restart script is /etc/rc.d/init.d/mongod. To start the service:
[bash]/etc/init.d/mongod restart[/bash]
Make sure the daemon works properly:
[bash]chkconfig mongod on[/bash]
It is running now. This MongoDB instance will store its data files in the /var/lib/mongo and its log files in /var/log/mongo, and run using the mongod user account.
Next step we are going to install PHP mongo extension.