<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>install mongo driver &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/tag/install-mongo-driver/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Fri, 19 Aug 2011 01:19:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.3</generator>
	<item>
		<title>Install MongoDB on Centos / RedHat</title>
		<link>https://lifelinux.com/install-mongodb-on-centos-redhat/</link>
					<comments>https://lifelinux.com/install-mongodb-on-centos-redhat/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Fri, 19 Aug 2011 00:38:37 +0000</pubDate>
				<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[install mongo driver]]></category>
		<category><![CDATA[install mongodb]]></category>
		<category><![CDATA[install mongodb on linux]]></category>
		<category><![CDATA[install php mongo]]></category>
		<category><![CDATA[mongodb on linux]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=906</guid>

					<description><![CDATA[<p>MongoDB (from &#8220;humongous&#8221;) is an open source, high-performance, schema-free, document-oriented database written in the C++ programming language. The database is document-oriented so it manages collections of JSON-like documents. Many applications can thus model data in a more natural way, as data can be nested in complex hierarchies and still be query-able and indexable. Install MongoDB [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/install-mongodb-on-centos-redhat/">Install MongoDB on Centos / RedHat</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>MongoDB</strong> (from &#8220;humongous&#8221;) is an open source, high-performance, schema-free, document-oriented database written in the C++ programming language. The database is document-oriented so it manages collections of JSON-like documents. Many applications can thus model data in a more natural way, as data can be nested in complex hierarchies and still be query-able and indexable.<span id="more-906"></span></p>
<h2>Install MongoDB</h2>
<p>Download the latest binaries from <a href="http://www.mongodb.org/downloads">mongodb.org</a>. When downloading MongoDB, ensure that you download a version that is compiled for the proper system architecture. (Please <a href="http://blog.mongodb.org/post/137788967/32-bit-limitations">note</a> that the 32-bit version of MongoDB has a database size limit of 2 gigabytes).</p>
<pre># wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.8.2.tgz
# tar zxvf mongodb-linux-x86_64-1.8.2.tgz
# mv mongodb-linux-x86_64-1.8.2 /mongodb</pre>
<p>Create folder /mongodb/data, it&#8217;s used to store all data in MongoDB</p>
<pre># mkdir /mongodb/data</pre>
<p>Create the file /mongodb/config and use the following example as a template:</p>
<pre>dbpath = /mongodb/data
logpath = /mongodb/mongodb.log
logappend = true
bind_ip = 127.0.0.1
port = 27017
fork = true
auth = true</pre>
<p>Create two scripts to start or stop the MongoDB process. To create start script, type the following command</p>
<pre># vi /mongodb/bin/start</pre>
<p>Add the following content</p>
<pre>#!/bin/sh
/mongodb/bin/mongod --config /mongodb/config \</pre>
<p>Create stop script</p>
<pre># vi /mongodb/bin/stop</pre>
<p>Add the following content</p>
<pre>#!/bin/bash
pid=`ps -o pid,command ax | grep mongod | awk '!/awk/ &amp;&amp; !/grep/ {print $1}'`;
if [ "${pid}" != "" ]; then
    kill -2 ${pid};
fi</pre>
<p>Set execute permission</p>
<pre># chmod +x /mongodb/bin/start
# chmod +x /mongodb/bin/stop</pre>
<p>After, create init script which provides a means for ensuring that MongoDB will start at boot. Type the following command</p>
<pre># vi /etc/init.d/mongodb</pre>
<p>Add the following content</p>
<pre>#! /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: /opt/config/mongodb
# pidfile: /opt/mongodb/mongo.pid

PATH=/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... "
        su - mongodb -c "/mongodb/bin/start"
        ;;
  stop)
        echo -n "Stopping MongoDB... "
        /mongodb/bin/stop
        ;;
      *)
            N=/etc/init.d/$NAME
            echo "Usage: $N {start|stop}" &gt;&amp;2
            exit 1
            ;;
    esac
exit 0</pre>
<h2>Install PHP Driver</h2>
<p>Once Mongo is installed we need to install the appropriate extension so that we can begin using it from within PHP. Luckily we can find the mongo extension through pecl.</p>
<pre># pecl install mongo</pre>
<p>Or you can also compile Mongo driver from the latest source code on <a href="http://github.com/mongodb/mongo-php-driver">Github</a></p>
<pre># yum install php53-devel
# wget https://github.com/mongodb/mongo-php-driver/tarball/master
# tar zxvf mongodb-mongo-php-driver-*.tar.gz
# cd mongodb-mongo-php-driver-*
# phpize
# ./configure
# make install</pre>
<p>Ater that, to load the extension on PHP startup, type the command</p>
<pre># echo "extension=mongo.so" &gt;&gt; /etc/php.ini</pre>
<g:plusone href="https://lifelinux.com/install-mongodb-on-centos-redhat/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/install-mongodb-on-centos-redhat/">Install MongoDB on Centos / RedHat</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/install-mongodb-on-centos-redhat/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
