Web Projects Outsourcing

Setting Up MongoDB on Fedora with Basic Security Options

MongoDB is a popular NoSQL database solution with growing popularity over professional and non-professional users. Blah. Now to setting all up.

MongoDB in Fedora repo will not work with authentication and segfault, get it and install from MongoDB site.

Cut and paste the below:

[text gutter=”false”]
name=10gen Repository

Install MongoDB:

Edit the default config file.

Find and edit:

[text gutter=”false”]
bind_ip =
port = 27017

Create a very basic service:

Cut and paste:

#! /bin/sh

chkconfig: 345 20 80

description: mongod daemon

processname: mongod


set -e

case "$1" in
$N -f /etc/mongod.conf –journal
echo "Usage: $N {start|stop|restart|force-reload}" >&2exit 1

exit 0

Run service:

Check if all ok:

Or visit in browser: //localhost:28017 (we are going to close that later).

You can stop the above service from mongo console:

Add possibility for PHP to connect to it and restart web server:


Add more security:

Edit the config again:

Find and edit:

[text gutter=”false”]
noauth = false
auth = true
nohttpinterface = true

Stop and start the server again as described above.

Get and install some web admin tool into a folder on your web server, for instance //code.google.com/p/rock-php/wiki/rock_mongo. To connect, edit the config.php file from this package with the following values:

DISCLAIMER: tested for Fedora 15 only and might require more security fixes.

RockMongo with auth in Fedora 15


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.