MongoDB: Plugin: Difference between revisions

From The Uniform Server Wiki
Jump to navigation Jump to search
(New page: {{Nav MongoDB}} '''''MongoDB''''' == Introduction == Uniform Server MongoDB plugin installs MongoDB server, phpMoAdmin browser administration interface and PHP driver on Uniform Server 6-C...)
 
m (Reverted edits by Upazixorys (Talk); changed back to last version by BobS)
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
'''''MongoDB'''''
'''''MongoDB'''''
== Introduction ==
== Introduction ==
Uniform Server MongoDB plugin installs MongoDB server, phpMoAdmin browser administration interface and PHP driver on Uniform Server 6-Carbo.
The Uniform Server MongoDB plugin installs MongoDB server, the phpMoAdmin browser administration interface and the PHP driver on Uniform Server 6-Carbo.  


A Windows interface is provided allowing you to start and stop both Apache and MongoDB servers. From this interface you can start either the mongo-client or phpMoAdmin these allow you to administer mongo-databases. A single button click opens a command window giving you access to Mongo’s suite of command-line tools.
A Windows interface is provided, allowing you to start and stop both Apache and MongoDB servers. From this interface you can start either the mongo-client or phpMoAdmin.  These programs allow you to administer mongo-databases. In addition, a single button click opens a command window giving you access to Mongo’s suite of command-line tools.


It’s the Windows interface (implemented using WinBinder) that makes this plugin specific to Uniform Server 6-Carbo. However that said its core component will run alongside any version of Uniform Server or other server see [[#MongoDB twist || '''MongoDB twist''']] for details.   
It’s the Windows interface (implemented using WinBinder) that makes this plugin specific to Uniform Server 6-Carbo. The core component, however, will run alongside any version of Uniform Server or other server. See [[#MongoDB twist || '''MongoDB twist''']] for details.   
 
'''''[[#top | Top]]'''''


== Download and Install ==
== Download and Install ==
Line 22: Line 20:
# Extract files, navigate to folder temp\mongo_plugin_v1_0
# Extract files, navigate to folder temp\mongo_plugin_v1_0
# Copy contents of this folder to folder UniServer
# Copy contents of this folder to folder UniServer
'''''[[#top | Top]]'''''


== Run ==
== Run ==
Line 33: Line 29:
Double click on file '''Start_MongoDB.exe''' located in folder UniServer.
Double click on file '''Start_MongoDB.exe''' located in folder UniServer.


* I hate nag pop-ups however this one is very important.
* I hate nag pop-ups, but this one is very important.
* Always close MongoDB before turning your PC off
* '''Always''' close MongoDB before turning your PC off.
* It needs to perform a clean up to maintain data integrity.
* It needs to perform a clean up to maintain data integrity.


The nag pop-up can be infuriating hence click no not to display it again at next start up.
The nag pop-up can be infuriating, but you can click '''''no''''' to not display it again at next start up.


'''''Note'':''' If you want to restore the nag pop-up delete the following file:
'''''Note'':''' If you want to restore the nag pop-up, delete the following file:


UniServer\usr\local\mongo\us_info\'''no_nag.txt'''
UniServer\usr\local\mongo\us_info\'''no_nag.txt'''
Line 50: Line 46:
Start server click '''Start MongoDB and Apache''' button.
Start server click '''Start MongoDB and Apache''' button.


'''''Note'':''' With the servers running greyed out buttons are enabled.
'''''Note'':''' With the servers running, greyed out buttons are enabled.


'''''Stop Server'''''
'''''Stop Server'''''
Line 67: Line 63:
'''Button ''Start Mongo Client'''''
'''Button ''Start Mongo Client'''''


Opens a command window and runs mongo-client. Button is enabled when servers are running otherwise is disabled.
Opens a command window and runs mongo-client. Button is enabled when servers are running; otherwise it's disabled.


'''Button ''Run phpMoAdmin'''''
'''Button ''Run phpMoAdmin'''''


Opens phpMoAdmin in default browser. Button is enabled when servers are running otherwise is disabled.
Opens phpMoAdmin in default browser. Button is enabled when servers are running; otherwise it's disabled.


'''Button ''Help and Information'''''
'''Button ''Help and Information'''''
Line 81: Line 77:
|}
|}


'''''Note 1'':''' When challenged by your firewall always grant Internet access
'''''Note 1'':''' When challenged by your firewall, always grant Internet access


'''''Note 2'':''' Plugin is self-contained no need to run UniTray.   
'''''Note 2'':''' Plugin is self-contained. No need to run UniTray.   


'''''Note 3'':''' This plugin runs as a standard program and not as a service. It is for         development only do not use for a production server.
'''''Note 3'':''' This plugin runs as a standard program and not as a service.  
It is for development '''only'''! Do not use for a production server!


'''''[[#top | Top]]'''''
=== Test ===
=== Test ===
This plugin includes a test script allowing you to explore.   
This plugin includes a test script allowing you to explore.   
Line 102: Line 98:
Type into a browser http://localhost/mongo_test_1.php
Type into a browser http://localhost/mongo_test_1.php


Nothing spectacular, it creates a database and display entries as shown on the right.
Nothing spectacular happens; it creates a database and displays entries as shown on the right.
|
|
[[Image:MongoDB_1_test_script.gif]]
[[Image:MongoDB_1_test_script.gif]]
Line 111: Line 107:
Click "Run phpMoAdmin" button
Click "Run phpMoAdmin" button


Test script creates a database with two entries this allows you to explore phpMoAdmin features.  
Test script creates a database with two entries; this allows you to explore phpMoAdmin features.  


Generally have a play run mongo-client and explore its capabilities.
Generally have a play. Run mongo-client and explore its capabilities.


Refresh phpMoAdmin to view changes.
Refresh phpMoAdmin to view changes.
Line 124: Line 120:
# Close MongoDB – Click "Stop MongoDB and Apache" button
# Close MongoDB – Click "Stop MongoDB and Apache" button
# Navigate to folder: UniServer\usr\local\mongo\data\'''mongodb'''
# Navigate to folder: UniServer\usr\local\mongo\data\'''mongodb'''
# Delete its contents. Removing all databasss created effectively gives you a clean install.
# Delete its contents. Removing all databases created, which effectively gives you a clean install.


==== New User ====
==== New User ====
If you are a new user to Uniform Server welcome, your website files are placed in folder UniServer\www.
If you are a new user to Uniform Server, welcome. Your website files are placed in folder UniServer\www.


To clean this folder prior to adding your material with the exception of file '''.htaccess''' you can delete everything.
To clean this folder prior to adding your material, you can delete everything except file '''.htaccess'''.
 
Plugins may add to this folder for testing. MongoDB plugin adds a single file '''mongo_test_1.php''' which you may delete after testing.


Plugins may add to this folder for testing. MongoDB plugin adds a single file '''mongo_test_1.php''' hence deletr it after testing.


'''''[[#top | Top]]'''''
== MongoDB twist ==
== MongoDB twist ==
MongoDB is a server in its own right and can be run independently of Uniform Server.  
MongoDB is a server in its own right and can be run independently of Uniform Server.  


If you have ever looked at other Uniform Server plugins you will find what appears to be redundant code. This plugin is no exception it contains minimal amount of code to run MongoDB server independently.  
If you have ever looked at other Uniform Server plugins you will find what appears to be redundant code. This plugin is no exception. It contains the minimal amount of code to run MongoDB server independently.  


=== Extract MongoDB core ===
=== Extract MongoDB core ===
Buried within the plugin is a MongoDB core once extracted it can be run indecently.
Buried within the plugin is a MongoDB core; once extracted it can be run independently.


Extract as follows:
Extract as follows:
Line 156: Line 152:
You can copy folder mongo_temp2\mongo and all its contents to any location and run from there.
You can copy folder mongo_temp2\mongo and all its contents to any location and run from there.


'''''[[#top | Top]]'''''


=== Alternative control ===
=== Alternative control ===
Line 165: Line 160:
They use '''uniserv.exe''' to run MongoDB hidden in the background.   
They use '''uniserv.exe''' to run MongoDB hidden in the background.   


For convenience two batch files are provided one opens a command prompt allowing you to access Mongo’s command line tools the other directly runs the Mongo client tool.
For convenience, two batch files are provided.  One opens a command prompt allowing you to access Mongo’s command line tools, and the other directly runs the Mongo client tool.


'''''Files'':'''
'''''Files'':'''
Line 179: Line 174:
'''''Note'':'''
'''''Note'':'''


You can delete folder '''alt_control''' it contains batch/script pairs that are not required.   
You can delete folder '''alt_control'''. It contains batch/script pairs that are not required.   


'''''[[#top | Top]]'''''


== Summary ==
== Summary ==
Installing and running the MongoDB plugin is quick and easy.
Installing and running the MongoDB plugin is quick and easy.


Hey! Don’t like the control interface, change it; [[MongoDB Tutorial 2: Introduction | MongoDB Tutorial 2]]  provides details.
Hey! If you don’t like the control interface, change it; [[MongoDB Tutorial 2: Introduction | MongoDB Tutorial 2]]  provides details.
 
 
'''''[[#top | Top]]'''''


----
----

Latest revision as of 07:54, 24 November 2010

 

UniServer 6-Carbo
MongoDB Uniform Server Series.

MongoDB

Introduction

The Uniform Server MongoDB plugin installs MongoDB server, the phpMoAdmin browser administration interface and the PHP driver on Uniform Server 6-Carbo.

A Windows interface is provided, allowing you to start and stop both Apache and MongoDB servers. From this interface you can start either the mongo-client or phpMoAdmin. These programs allow you to administer mongo-databases. In addition, a single button click opens a command window giving you access to Mongo’s suite of command-line tools.

It’s the Windows interface (implemented using WinBinder) that makes this plugin specific to Uniform Server 6-Carbo. The core component, however, will run alongside any version of Uniform Server or other server. See | MongoDB twist for details.

Download and Install

Options 1

  1. Download file mongo_plugin_v1_0.exe from Sourceforge. For download details see MongoDB Introduction (Main Start page)
  2. Save it to folder UniServer.
  3. To extract files, double click on file mongo_plugin_v1_0.exe, no need to change the path.
  4. A new file Start_MongoDB.exe is added to folder UniServer.

Options 2

  1. Download file mongo_plugin_v1_0.zip from Sourceforge. For download details see MongoDB Introduction (Main Start page)
  2. Save to any folder e.g temp
  3. Extract files, navigate to folder temp\mongo_plugin_v1_0
  4. Copy contents of this folder to folder UniServer

Run

Start Windows interface

Double click on file Start_MongoDB.exe located in folder UniServer.

  • I hate nag pop-ups, but this one is very important.
  • Always close MongoDB before turning your PC off.
  • It needs to perform a clean up to maintain data integrity.

The nag pop-up can be infuriating, but you can click no to not display it again at next start up.

Note: If you want to restore the nag pop-up, delete the following file:

UniServer\usr\local\mongo\us_info\no_nag.txt

Start Servers

Start server click Start MongoDB and Apache button.

Note: With the servers running, greyed out buttons are enabled.

Stop Server

Button toggles displaying Stop MongoDB and Apache

Open cmd Window

Opens a command window and changes to folder:UniServer\usr\local\mongo\bin

Provides access to Mongo’s suite of command-line tools.

Button Start Mongo Client

Opens a command window and runs mongo-client. Button is enabled when servers are running; otherwise it's disabled.

Button Run phpMoAdmin

Opens phpMoAdmin in default browser. Button is enabled when servers are running; otherwise it's disabled.

Button Help and Information

Opens main read me file in Notepad.

Note 1: When challenged by your firewall, always grant Internet access

Note 2: Plugin is self-contained. No need to run UniTray.

Note 3: This plugin runs as a standard program and not as a service. It is for development only! Do not use for a production server!

Test

This plugin includes a test script allowing you to explore.

I assume you have started Windows interface and servers:

  • Start MongoDB - Double click on Start_MongoDB.exe
  • Run Servers - Click "Start MongoDB and Apache" button

Run test script

Type into a browser http://localhost/mongo_test_1.php

Nothing spectacular happens; it creates a database and displays entries as shown on the right.

Run phpMoAdmin

Click "Run phpMoAdmin" button

Test script creates a database with two entries; this allows you to explore phpMoAdmin features.

Generally have a play. Run mongo-client and explore its capabilities.

Refresh phpMoAdmin to view changes.

Clean up

When you have finished playing you probably will want to clean up and start afresh.

  1. Close MongoDB – Click "Stop MongoDB and Apache" button
  2. Navigate to folder: UniServer\usr\local\mongo\data\mongodb
  3. Delete its contents. Removing all databases created, which effectively gives you a clean install.

New User

If you are a new user to Uniform Server, welcome. Your website files are placed in folder UniServer\www.

To clean this folder prior to adding your material, you can delete everything except file .htaccess.

Plugins may add to this folder for testing. MongoDB plugin adds a single file mongo_test_1.php which you may delete after testing.


MongoDB twist

MongoDB is a server in its own right and can be run independently of Uniform Server.

If you have ever looked at other Uniform Server plugins you will find what appears to be redundant code. This plugin is no exception. It contains the minimal amount of code to run MongoDB server independently.

Extract MongoDB core

Buried within the plugin is a MongoDB core; once extracted it can be run independently.

Extract as follows:

  • Create two new folders for example mongo_temp and mongo_temp2
  • Download plugin either mongo_plugin_v1_0.exe or mongo_plugin_v1_0.zip
  • Save to mongo_temp and extract by double clicking on mongo_plugin_v1_0.exe
  • Navigate to folder mongo_temp\usr\local\mongo
  • Copy this folder and all its content to folder mongo_temp2
  • You can delete folder mongo_temp its no longer required.
  • Delete folder mongo_temp2\mongo\us_info not required

Note:

You can copy folder mongo_temp2\mongo and all its contents to any location and run from there.


Alternative control

That redundant code I mentioned above is contained in folder alt_control_2

It contains batch files to start and stop MongoDB server.

They use uniserv.exe to run MongoDB hidden in the background.

For convenience, two batch files are provided. One opens a command prompt allowing you to access Mongo’s command line tools, and the other directly runs the Mongo client tool.

Files:

Start_mongo.bat   - Run MongoDB server hidden
Stop_mongo.bat    - Cleanly stop MongoDB server
monogo_client.bat - Directly runs mongo-client
run_cmd.bat       - Opens a command window changes to bin folder allowing
                    you to run MongoDB's command line tools
uniserv.exe       - Uniform Server utility. Runs a program in background.

Note:

You can delete folder alt_control. It contains batch/script pairs that are not required.


Summary

Installing and running the MongoDB plugin is quick and easy.

Hey! If you don’t like the control interface, change it; MongoDB Tutorial 2 provides details.