{"id":4330,"date":"2012-01-03T18:20:59","date_gmt":"2012-01-03T23:20:59","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=4330"},"modified":"2012-01-03T18:20:59","modified_gmt":"2012-01-03T23:20:59","slug":"install-mongodb","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/install-mongodb\/","title":{"rendered":"Install Mongodb"},"content":{"rendered":"<p>From <a href=\"http:\/\/www.mongodb.org\/display\/DOCS\/Quickstart+Unix\" target=\"_blank\" rel=\"noopener noreferrer\">mongodb.org<\/a><br \/>\nFrom <a href=\"http:\/\/www.if-not-true-then-false.com\/2010\/install-mongodb-on-fedora-centos-red-hat-rhel\/\" target=\"_blank\" rel=\"noopener noreferrer\">if-not-true-then-false.com<\/a><br \/>\nFrom <a href=\"http:\/\/www.php.net\/manual\/en\/mongo.installation.php\" target=\"_blank\" rel=\"noopener noreferrer\">php.net<\/a><\/p>\n<p>To install mongodb, add the appropriate repo information below for your distribution version (x86_64 or i686) to \/etc\/yum.repos.d\/10gen.repo:<\/p>\n<p><code>vim \/etc\/yum.repos.d\/10gen.repo<\/code><\/p>\n<p>add<\/p>\n<p><code><br \/>\n[10gen]<br \/>\nname=10gen Repository<br \/>\nbaseurl=http:\/\/downloads-distro.mongodb.org\/repo\/redhat\/os\/x86_64<br \/>\ngpgcheck=0<\/code><\/p>\n<p>or<\/p>\n<p>[10gen]<br \/>\nname=10gen Repository<br \/>\nbaseurl=http:\/\/downloads-distro.mongodb.org\/repo\/redhat\/os\/i686<br \/>\ngpgcheck=0\n<\/p>\n<p>then run<\/p>\n<p><code>yum update && yum install mongo-10gen mongo-10gen-server<\/code><\/p>\n<p>Check the basic mongodb configuration settings before starting MongoDB (default settings are usually good)<\/p>\n<p><code><br \/>\nvim \/etc\/mongod.conf<\/code><\/p>\n<p>logpath=\/var\/log\/mongo\/mongod.log<br \/>\nport=27017<br \/>\ndbpath=\/var\/lib\/mongo\n<\/p>\n<p><!--more--><\/p>\n<p>Start the service<br \/>\n<code>service mongod start<\/code><\/p>\n<p>Start the service on boot<br \/>\n<code>chkconfig --levels 235 mongod on<\/code><\/p>\n<p>Now, lets test the server. Start it with the &#8216;mongo&#8217; command<br \/>\n<code>mongo<\/code><\/p>\n<p>Save, Update and Find Some Test Data on MongoDB<br \/>\n<code><br \/>\n> use test<br \/>\n  switched to db test<br \/>\n> db.foo.find()<br \/>\n> db.foo.save({a: 1})<br \/>\n> db.foo.find()<br \/>\n { \"_id\" : ObjectId(\"4b8ed53c4f450867bb35a1a9\"), \"a\" : 1 }<br \/>\n> db.foo.update( {a: 1}, {a: 5})<br \/>\n> db.foo.find()<br \/>\n { \"_id\" : ObjectId(\"4b8ed53c4f450867bb35a1a9\"), \"a\" : 5 }<br \/>\n<\/code><\/p>\n<p>Now, let&#8217;s oOpen MongoDB Port (27017) in Iptables<br \/>\n<code><br \/>\niptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 27017 -j ACCEPT<br \/>\nservice iptables save<br \/>\nservice iptables  restart<br \/>\n<\/code><\/p>\n<p>Let&#8217;s also add the port to csf in \/etc\/csf\/csf.conf<br \/>\n<code><br \/>\n# Allow incoming TCP ports<br \/>\nTCP_IN = 27017<br \/>\n<\/code><\/p>\n<p>To install the php extension:<br \/>\n<code>pecl install mongo<\/code><\/p>\n<p>Then add the following line to your php.ini file:<br \/>\n<code>extension=mongo.so<\/code><\/p>\n<p>Now, verify that the mongo port is open and listening<br \/>\n<code>lsof -i |grep 27017<\/code><\/p>\n<p>That&#8217;s it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From mongodb.org From if-not-true-then-false.com From php.net To install mongodb, add the appropriate repo information below for your distribution version (x86_64 or i686) to \/etc\/yum.repos.d\/10gen.repo: vim \/etc\/yum.repos.d\/10gen.repo add [10gen] name=10gen Repository baseurl=http:\/\/downloads-distro.mongodb.org\/repo\/redhat\/os\/x86_64 gpgcheck=0 or [10gen] name=10gen Repository baseurl=http:\/\/downloads-distro.mongodb.org\/repo\/redhat\/os\/i686 gpgcheck=0 then run yum update &#038;&#038; yum install mongo-10gen mongo-10gen-server Check the basic mongodb configuration settings before starting&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/install-mongodb\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-4330","post","type-post","status-publish","format-standard","hentry","category-linux-apps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Install Mongodb - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/install-mongodb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install Mongodb - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"From mongodb.org From if-not-true-then-false.com From php.net To install mongodb, add the appropriate repo information below for your distribution version (x86_64 or i686) to \/etc\/yum.repos.d\/10gen.repo: vim \/etc\/yum.repos.d\/10gen.repo add [10gen] name=10gen Repository baseurl=http:\/\/downloads-distro.mongodb.org\/repo\/redhat\/os\/x86_64 gpgcheck=0 or [10gen] name=10gen Repository baseurl=http:\/\/downloads-distro.mongodb.org\/repo\/redhat\/os\/i686 gpgcheck=0 then run yum update &amp;&amp; yum install mongo-10gen mongo-10gen-server Check the basic mongodb configuration settings before starting... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/install-mongodb\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2012-01-03T23:20:59+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-mongodb\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-mongodb\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Install Mongodb\",\"datePublished\":\"2012-01-03T23:20:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-mongodb\\\/\"},\"wordCount\":154,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"Apps\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-mongodb\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-mongodb\\\/\",\"name\":\"Install Mongodb - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2012-01-03T23:20:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-mongodb\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-mongodb\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/install-mongodb\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install Mongodb\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Install Mongodb - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/install-mongodb\/","og_locale":"en_US","og_type":"article","og_title":"Install Mongodb - Linux Shtuff","og_description":"From mongodb.org From if-not-true-then-false.com From php.net To install mongodb, add the appropriate repo information below for your distribution version (x86_64 or i686) to \/etc\/yum.repos.d\/10gen.repo: vim \/etc\/yum.repos.d\/10gen.repo add [10gen] name=10gen Repository baseurl=http:\/\/downloads-distro.mongodb.org\/repo\/redhat\/os\/x86_64 gpgcheck=0 or [10gen] name=10gen Repository baseurl=http:\/\/downloads-distro.mongodb.org\/repo\/redhat\/os\/i686 gpgcheck=0 then run yum update && yum install mongo-10gen mongo-10gen-server Check the basic mongodb configuration settings before starting... Read More","og_url":"https:\/\/g33kinfo.com\/info\/install-mongodb\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2012-01-03T23:20:59+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/install-mongodb\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/install-mongodb\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Install Mongodb","datePublished":"2012-01-03T23:20:59+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/install-mongodb\/"},"wordCount":154,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["Apps"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/install-mongodb\/","url":"https:\/\/g33kinfo.com\/info\/install-mongodb\/","name":"Install Mongodb - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2012-01-03T23:20:59+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/install-mongodb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/install-mongodb\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/install-mongodb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Install Mongodb"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/4330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=4330"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/4330\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=4330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=4330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=4330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}