Install MongoDB:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list sudo apt-get update sudo apt-get install mongodb-10gen
Install MongoDB PHP driver:
sudo apt-get install php-pear php5-dev sudo pecl search mongo sudo pecl install mongo
Configure MongoDB PHP driver: Create a file called /etc/php5/mods-available/mongo.ini
with this content:
extension=mongo.so
And create a symlink to it in /etc/php5/conf.d/
:
cd /etc/php5/conf.d sudo ln -s ../mods-available/mongo.ini 20-mongo.ini
If the folder mods-available
does not exists, create the mongo.ini
file in /etc/php5/conf.d/
.
Then restart Apache:
sudo service apache2 restart
Start, stop and restart MongoDB:
sudo service mongodb start sudo service mongodb stop sudo service mongodb restart
Configuration file:
/etc/mongodb.conf
Log file:
/var/log/mongodb/mongodb.log
Data files:
/var/lib/mongodb
Ref: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
0 Comments.