[Ô´´]linux Ò»¼ü°²×°mongodbÒÔ¼°phpmongoÀ©Õ¹½Å±¾
×î½üÔÚ×ö¹«Ë¾Èí¼þµÄÒ»¼ü°²×°³ÌÐò£¬ÆäÖеÄ΢²©Ä£¿éÓõ½ÁËmongodb£¬ÎªÁËʹ²»ÊǺܶ®linuxÃüÁîµÄ¼¼ÊõÒ»¼ü°²×°ÏîÄ¿£¬¹ÊдÁËÒ»¼ü°²×°½Å±¾£¬Ò»¼ü°²×°mongodbÒÔ¼°phpµÄmongoÀ©Õ¹ÊÇÆäÖÐÒ»²¿·Ö£¬µ¥¶ÀÕª³öÀ´£¬Ï£Íû¶Ô´ó¼ÒÓаïÖú¡£¾ßÌå½Å±¾ÈçÏ£º
#!/bin/sh cur_dir=$(pwd) cd $cur_dir echo "mongodb-2.0.2.tgz not found!!!download now......" if [ `getconf WORD_BIT` = '32' ] && [ `getconf LONG_BIT` = '64' ] ; then wget -c http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.0.2.tgz tar zxvf mongodb-linux-x86_64-2.0.2.tgz mv mongodb-linux-x86_64-2.0.2 /usr/local/mongodb else wget -c http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.0.2.tgz tar zxvf mongodb-linux-i686-2.0.2.tgz mv mongodb-linux-i686-2.0.2 /usr/local/mongodb fi echo "============================mongodb download completed=========================" echo "============================mongodb install======================" rm -rf /usr/bin/mongo rm -rf /usr/bin/mongod rm -rf /usr/bin/mongodump ln -s /usr/local/mongodb/bin/mongodump /usr/bin/mongodump ln -s /usr/local/mongodb/bin/mongod /usr/bin/mongod ln -s /usr/local/mongodb/bin/mongo /usr/bin/mongo mkdir -p /usr/local/mongodb/srv mkdir -p /usr/local/mongodb/data cat >/etc/mongodb.conf<<EOF # mongodb.conf #where to log logpath=/home/wwwlogs/mongod.log logappend=true # fork and run in background fork = true #port = 27017 dbpath=/usr/local/mongodb/data directoryperdb = true # in replicated mongo databases, specify here whether this is a slave or master #slave = true #source = master.example.com # Slave only: specify a single database to replicate #only = master.example.com # or #master = false #source = slave.example.com # Address of a server to pair with. #pairwith = <server:port> # Address of arbiter server. #arbiter = <server:port> # Automatically resync if slave data is stale #autoresync # Custom size for replication operation log. #oplogSize = <MB> # Size limit for in-memory storage of op ids. #opIdMem = <bytes> maxConns = 100000 EOF cat >/usr/local/mongodb/srv/mongodb-start<<EOF #!/bin/sh /usr/bin/mongod -f /etc/mongodb.conf EOF cat >/usr/local/mongodb/srv/mongodb-stop<<EOF #!/bin/sh pid=`ps -o pid,command ax | grep mongod | awk '!/awk/ && !/grep/ {print $1}'`; if [ "${pid}" != "" ]; then kill -2 ${pid}; fi EOF cat >/etc/init.d/mongodb<<EOF #! /bin/sh # # mongodb this script starts and stops the mongodb daemon # # chkconfig: - 85 15 # description: MongoDB is a non-relational database storage system. # processname: mongodb # config: /etc/mongodb.conf # pidfile: /usr/local/mongodb/mongodb.pid PATH=/usr/local/mongodb/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=mongodb test -x $DAEMON || exit 0 set -e case "$1" in start) echo -n "Starting MongoDB... " /usr/local/mongodb/srv/mongodb-start ;; stop) echo -n "Stopping MongoDB... " /usr/local/mongodb/srv/mongodb-stop ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop}" >&2 exit 1 ;; esac exit 0 EOF chmod +x /etc/init.d/mongodb chmod +x /usr/local/mongodb/srv/mongodb-stop chmod +x /usr/local/mongodb/srv/mongodb-start chkconfig --add mongodb chkconfig --level 345 mongodb on /etc/init.d/mongodb start echo "===mongodb install success and start install php mongo extension ========" if [ -s /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/mongo.so ]; then rm -rf /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/mongo.so fi if [ -s /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/mongo.so ]; then rm -rf /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/mongo.so fi if [ -s mongodb-php-driver ]; then rm -rf mongodb-php-driver/ fi wget -c http://www.unotice.cn/downloads/mongodb-php-driver.tar.gz tar xzvf mongodb-php-driver.tar.gz cd mongodb-php-driver /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make make install cd ../ sed -i 's/extension=mongo.so/ /g' /usr/local/php/etc/php.ini cat >>/usr/local/php/etc/php.ini<<EOT extension=mongo.so EOT echo "Restarting php-fpm......" /etc/init.d/php-fpm restart echo "===start install php mongo extension install success========"½Å±¾³ÌÐòÏÂÔØ£º install_mongo
±¾ÎÄΪ×÷ÕßÔ´´£¬×ªÔØÇë×¢Ã÷³ö´¦£¬Ð»Ð»¡£
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ