1. Installing MongoDB
1 wget http://www.phpwindow.com/linux/mongodb-linux-x86_64-2.2.1.tgz2tar zxvf Mongodb-linux-x86_64-2.2.1.tgz3mv Mongodb-linux-x86_64-2.2.1/usr/local/mongodb4 mkdir-p/usr/local/mongodb/data/mongodb_data 5 Cd/usr/local/mongodb/data 6 mkdir MongoDB 7 Cd/usr/local/mongodb 8 Touch logs
2. Install PHP extension MONGO
1 //Download Expansion packs2 wget http://wwww.phpwindow.com/linux/mongo-1.3.0RC2.tgz3 //Compile and install4 Tar zxvf mongo-1.3.0rc2.tgz5 CD MONGO-1.3.0RC26 /usr/local/php/bin/phpize7 ./configure--enable-mongo--with-php-config=/usr/local/php/bin/php-config8 Make && make install9 //Sign of successful installation (extended inventory drop path)Ten/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
3.php.ini Configuration
Look for "extension_dir" and modify it to the following code:
1 extension_dir= '/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/'
Find "extension" and add the following code anywhere:
1 extension=mongo.so
4. Configure the startup script (optional)
VI Command Vim/etc/init.d/mongo
1 #!/bin/bash2 3 Mongod=/usr/local/mongodb/bin/mongod4 mongo_path=/usr/local/mongodb/data/5 Mongo_user=mongod6 Mongo_group=mongod7 #. "$SYSCONFIG" | | True8 Start ()9 {Ten echo-n $ "Starting Mongod:" One $mongod--dbpath=${mongo_path}/mongodb_data/--logpath=${mongo_path}/mongodb_logs.log--logappend--port=2 7017--fork--source=127.0.0.1--pidfilepath=/tmp/mongodb.pid A - retval=$? - Echo the [$RETVAL-eq 0] && touch/var/lock/subsys/mongod - } - Stop () - { + echo-n $ "Stopping Mongod:" - #kill proc-p/www/data/mongo/mongod.lock-t30-term $mongod + kill ' Cat/tmp/mongodb.pid ' A retval=$? at Echo - [$RETVAL-eq 0] && rm-f/var/lock/subsys/mongod/tmp/mongodb.pid - } - Restart () { - Stop - Start in } - Ulimit-n 12000 to retval=0 + Case "$" in - start) the Start * ;; $ stop)Panax Notoginseng Stop - ;; the restart|reload|force-reload) + Restart A ;; the Condrestart) + [-f/var/lock/subsys/mongod] && Restart | |: - ;; $ status) $ Status $mongod - retval=$? - ;; the *) - echo "Usage: $ {start|stop|status|restart|reload|force-reload|condrestart}"Wuyi retval=1 the Esac -Exit $RETVAL
: Wq Save
5. About start, restart, stop MONGO command
1 server MONGO start
2 server MONGO restart
3 server MONGO stop
6. About Ecstore Storage System switch to MONGO
Find config/config.php Add code
1 #mongodb server configuration 2 define (' Kvstore_storage ', ' Base_kvstore_mongodb '); 3 define (' Mongodb_server_config ', ' mongodb://localhost:27017 ');
After switching to the/app/base directory to execute command cmd kvrecovery execution, Ecstore's kvstore permanent storage is in the MONGO.
How to test for normal operation. The most straightforward way is to enter the Ecstore program directory data. Bar Kvstore directory removal. Check to see if the site is properly accessible.
If the site normal access, it is done, if the visit is not normal please leave a message under the article error posted. I'll analyze it for you.
I test the perfect run.
Ecstore about MongoDB Installation