Setup Rock Mongo web interface

I was looking for a admin web interface for mongoDB just like PHPMyAdmin for My SQL and found RockMongo a good one. In this article will show how to setup RockMongo using the authentication created in your mongoDB service. Please checkout this article Setup Drupal 7 Panopoly distribution with mongoDB on CentOS 7 if you haven't setup your mongoDB service and its PHP driver in your server.

  1. Go to your web directory where you want the RockMongo web interface be accessed:
          
    cd /home/webfoobar/public_html
          
        
  2. Download the RockMongo web interface from github and change its ownership:
          
    git clone https://github.com/iwind/rockmongo.git
    chown -R webfoobar:webfoobar rockmongo
          
        
  3. Edit the config.php of RockMongo and make sure this item $MONGO["servers"][$i]["mongo_auth"] = true; is set to true to fix this error logging in to your RockMongo:

    MongoDB authenticate failed. Please check your username and password from your mongo administrator.

    My basic RockMongo config:

          
    $MONGO["servers"][$i]["mongo_name"] = "Localhost";
    $MONGO["servers"][$i]["mongo_host"] = "127.0.0.1";
    $MONGO["servers"][$i]["mongo_port"] = "27017";
    $MONGO["servers"][$i]["mongo_timeout"] = 0;
    $MONGO["servers"][$i]["mongo_auth"] = true;
    $MONGO["servers"][$i]["control_auth"] = true;
    $MONGO["servers"][$i]["control_users"]["admin"] = "admin";
    $MONGO["servers"][$i]["ui_only_dbs"] = "";
    $MONGO["servers"][$i]["ui_hide_dbs"] = "";
    $MONGO["servers"][$i]["ui_hide_collections"] = "";
    $MONGO["servers"][$i]["ui_hide_system_collections"] = false;
           
        
  4. You can access your RockMongo web interface at http://www.yoursite.com/rockmongo/index.php and enter the credential you have created in your mongoDB server.

Comments

Hi Team,

Is it possible to add multiple user in config.php file, so that we can access particular db with specific user access only?

If yes than how to do that?

Thanks

I haven't tried this but I think you can have multiple user. In config.php file, you will notice the:
  
$i = 0;
  
... try to experiment to hard code the value of $i in:
  
$MONGO["servers"][$i]["mongo_name"] = "Localhost";
$MONGO["servers"][$i]["mongo_host"] = "127.0.0.1";
$MONGO["servers"][$i]["mongo_port"] = "27017";
$MONGO["servers"][$i]["mongo_timeout"] = 0;
$MONGO["servers"][$i]["mongo_auth"] = true;
$MONGO["servers"][$i]["control_auth"] = true;
$MONGO["servers"][$i]["control_users"]["admin"] = "admin";
$MONGO["servers"][$i]["ui_only_dbs"] = "";
$MONGO["servers"][$i]["ui_hide_dbs"] = "";
$MONGO["servers"][$i]["ui_hide_collections"] = "";
$MONGO["servers"][$i]["ui_hide_system_collections"] = false;
  

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.