MongoDB: Production Plugin: Difference between revisions

From The Uniform Server Wiki
Jump to navigation Jump to search
(New page: {{Nav MongoDB}} '''''MongoDB''''' == Introduction == MongoDB Plugin Production installs MongoDB server. A Windows interface is provided allowing you to start and stop MongoDB server. Fro...)
 
(Punctuation and grammatical changes; some clarification.)
Line 2: Line 2:
'''''MongoDB'''''
'''''MongoDB'''''
== Introduction ==
== Introduction ==
MongoDB Plugin Production installs MongoDB server.  
The Uniform Server MongoDB Plugin Production 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 MongoDB server. From this interface you can start either the mongo-client or a cmd prompt. These allow you to administer mongo-databases.  
A Windows interface is provided allowing you to start and stop MongoDB server. From this interface you can start either the mongo-client or a cmd prompt. These allow you to administer mongo-databases.  


From the drop-down menus you can create and delete databases in addition you can assign and delete users for a database. Inaddition you can run phpMoAdmin  
From the drop-down menus you can create and delete databases. In addition, you can assign and delete users for a database. You can also run phpMoAdmin.


Production in this context is referring to authenticated access. All databases are assigned a user name and user password. Creating a database you are forced to provide a name and password.
Production in this context is referring to authenticated access. All databases are assigned a user name and user password. Creating a database you are forced to provide a name and password.


The Admin database is pre-configured with a name and password of root and root respectively.
The Admin database is pre-configured with a name and password of '''root''' and '''root''' respectively. The first task after installation is to change the Admin default password.


First task after installation is to change the Admin default password.
'''''[[#top | Top]]'''''


== Download and Install ==
== Download and Install ==
Line 31: Line 28:
For download details see [[MongoDB: Introduction | '''MongoDB Introduction (Main Start page)''']]
For download details see [[MongoDB: Introduction | '''MongoDB Introduction (Main Start page)''']]


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


== Run ==
== Run ==
Line 41: Line 37:
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 58: Line 54:
Start server click '''Start Servers''' button.
Start server click '''Start Servers''' 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 75: Line 71:
'''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 is 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 is disabled.


'''Button ''Help and Information'''''
'''Button ''Help and Information'''''
Line 89: Line 85:
|}
|}


'''''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.  
'''''Note 3'':''' This plugin runs as a standard program and not as a service.  


'''''Note 4'':''' Status bar is dual function displays messages or acts as a progress bar
'''''Note 4'':''' Status bar is dual function: it displays messages or acts as a progress bar


'''''[[#top | Top]]'''''
== Menu Bar ==
== Menu Bar ==
* '''''File'''''
* '''''File'''''
Line 119: Line 114:
# ''About''                - Displays Components details and version
# ''About''                - Displays Components details and version


'''''[[#top | Top]]'''''
=== Configuration ===
=== Configuration ===
Both menu items open the same pop-up window
Both menu items open the same pop-up window
Line 146: Line 140:
[[Image:Mongodb_common_2.gif]]
[[Image:Mongodb_common_2.gif]]
|}
|}
'''''[[#top | Top]]'''''


=== Databases ===
=== Databases ===
Line 176: Line 169:
[[Image:Mongodb_drop_db.gif]]
[[Image:Mongodb_drop_db.gif]]
|}
|}
'''''[[#top | Top]]'''''
 
=== Users ===
=== Users ===
These menu items require MongoDB to be running  
These menu items require MongoDB to be running  
Line 210: Line 203:
[[Image:Mongodb_delete_user.gif]]
[[Image:Mongodb_delete_user.gif]]
|}
|}
'''''[[#top | Top]]'''''
 


== Test ==
== Test ==
Line 246: Line 239:
When you have finished playing you probably will want to clean up and start afresh.
When you have finished playing you probably will want to clean up and start afresh.


# Use the drop-down menus and delete any databases ou created.
* Use the drop-down menus and delete any databases you created.


==== 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''' hence deletr it after testing.
Plugins may add to this folder for testing. MongoDB plugin adds a single file '''mongo_test_1.php''' which you may delete after testing.


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


== Alternative control ==
== Alternative control ==
Line 264: Line 256:
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 278: Line 270:
'''''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 4: Introduction | MongoDB Tutorial 4]] provides details.
Hey! If you don’t like the control interface, change it; [[MongoDB Tutorial 4: Introduction | MongoDB Tutorial 4]] provides details.
 
 
'''''[[#top | Top]]'''''


----
----

Revision as of 01:44, 6 September 2010

 

UniServer 6-Carbo
MongoDB Uniform Server Series.

MongoDB

Introduction

The Uniform Server MongoDB Plugin Production 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 MongoDB server. From this interface you can start either the mongo-client or a cmd prompt. These allow you to administer mongo-databases.

From the drop-down menus you can create and delete databases. In addition, you can assign and delete users for a database. You can also run phpMoAdmin.

Production in this context is referring to authenticated access. All databases are assigned a user name and user password. Creating a database you are forced to provide a name and password.

The Admin database is pre-configured with a name and password of root and root respectively. The first task after installation is to change the Admin default password.


Download and Install

Options 1

  • Download file mongo_pro_plugin_v1_0.exe from Sourceforge
  • Save it to folder UniServer.
  • To extract files, double click on file mongo_pro_plugin_v1_0.exe, no need to change the path.
  • A new file Start_MongoDB.exe is added to folder UniServer. Note: Double click to run MongoDB control window.

Options 2

  • Download file mongo_pro_plugin_v1_0.zip from Sourceforge
  • Save to any folder e.g temp
  • Extract files, navigate to folder temp\mongo_pro_plugin_v1_0
  • Copy contents of this folder to folder UniServer
  • Double click Start_MongoDB.exe runs MongoDB control window.

For download details see MongoDB Introduction (Main Start page)


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 Servers button.

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

Stop Server

Button toggles displaying Stop Servers

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 is disabled.

Button Run phpMoAdmin

Opens phpMoAdmin in default browser. Button is enabled when servers are running; otherwise is 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.

Note 4: Status bar is dual function: it displays messages or acts as a progress bar

Menu Bar

  • File
  1. Run phpMoAdmin - Runs phpMoAdmin in a browser
  2. Exit - Close application
  • Configuration
  1. Change Port - Change Mongo listen port
  2. Change Admin Password - Change default Admin passwordd
  • Databases
  1. Create Database - Create a new database assign user and password
    For an existing database update user password
    For existing database assign a new user and password
  2. Drop Database - Select a datbase and delete it -
  • Users
  1. Add User - Addnew user and password to existing database
  2. Delete User - Select database lists all users select a user and delete
  • Help
  1. Help - Displays help file
  2. About - Displays Components details and version

Configuration

Both menu items open the same pop-up window

Change Port

  • Enabled only when MongoDB server stopped
  • Eneter new listening port
  • Click button Set MongoDB Port
  • Close window (cross top right)

Change Admin Password

  • Enabled only when MongoDB server is running
  • Enter a new password
    • Minimum of six alphanumeric characters
    • No spaces allowed
  • Click Set Admin Password
  • Close window (cross top right)

Databases

These menu items require MongoDB to be running

Create Database

  • Enter a User Name
  • Enter a password for that user  
  • Enter database name to create
  • Click Create or change button

Note:

This pop-up is mufti-purpose

Drop Database

  • Either enter a database name
  • Or select one from the list
  • Click Drop button

Users

These menu items require MongoDB to be running

Add User

  • Select a database from the list

New User - No user or password displayed

  • Enter a User name
  • Enter a password for that user
  • Click Click Create or change button

Existing User - User name displayed

Change password for that user

  • Enter a new password for that user
  • Click Click Create or change button

Delete User

  • Select database from list
  1. Displays database in top text window
  2. Displays a list of user on right
  • Select a user from this list
  1. User displayed in top text window
  • Click Delete button


Test

This plugin includes a test script allowing you to explore.

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

Run test script

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

Nothing spectacular, it creates a database and display 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.

  • Use the drop-down menus and delete any databases you created.

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.


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 4 provides details.