Mongo Server and PHP-Mongo

wget http://pecl.php.net/get/mongo-1.0.9.tgz
tar -xzf mongo-1.0.9.tgz
cd mongo-1.0.9
phpize
./configure
make && make install

cp downloads/mongo-1.0.9/modules/mongo.so /usr/lib64/php/modules/

cd /etc/php.d/
ls
cp bcmath.ini mongo.ini
vi mongo.ini
/etc/init.d/httpd restart
php -m |mongo
php -m |grep mongo

pecl install mongo

vi /etc/yum.repos.d/10gen.repo
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1

yum install mongo-10gen mongo-10gen-server
/etc/init.d/mongod start
mongo

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/

http://docs.mongodb.org/manual/reference/method/db.addUser/

use admin;

db.addUser(“user”, “somepass”)
db.auth(“user”,”somepass”);

use log;
db.logs.ensureIndex({“guid”:1});
db.logs.ensureIndex({“session_id”:1});
db.logs.ensureIndex({“account_id”:1});
db.logs.ensureIndex({“time”:1});
db.logs.ensureIndex({“type”:1});
db.logs.ensureIndex({“log_type”:1});

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>