Working with the 10gen Admin Site
Each 10gen site automatically gets administrative functionality that includes a
- db manager
- user manager
- file manager
- interactive JavaScript shell
http://<siteURL>/admin
In order for you to use the admin features, you first need to create an admin account. Here's how to do it :
1) Ensure that the database is running, as described in the QUICKSTART.txt instructions included in the SDK.
2) Run the "adduser" script to create a new user. To do this, lets run it first without any parameters to have it show us the required parameters. Start in the appserver directory of the SDK :
$ cd appserver
Then, run the adduser script. It is located in bin/scripts :
$ bin/scripts/adduser
You should see output similar to the following. What's important is the last line :
[Wed Jul 16 2008 10:16:25 GMT-0400 (EDT)] main || cloud INFO >> SERVER_NAME : geir-magnusson-jrs-mac-pro.local
[Wed Jul 16 2008 10:16:25 GMT-0400 (EDT)] main || cloud INFO >> me : {Server. location:unknown provider:unknown n:0}
[Wed Jul 16 2008 10:16:25 GMT-0400 (EDT)] main || cloud INFO >> grid server : null
DBApiLayer : DBTCP : 127.0.0.1:27017/grid
[Wed Jul 16 2008 10:16:26 GMT-0400 (EDT)] main || cloud INFO >> isOnGrid : false
usage : adduser <database> <name> <email> <pass> [optional permissions, just add as extra parameters]
So the parameters we need are :
- database : name of the database for the site. In the case of the sample app called "samplesite", the database name is "samplesite". You can see this in the data/ directory if you've already run the appserver and viewed this site.
- name : your name
- email : your email address
- pass : your password
So, to create an admin account for bob with email bab@bob.com with password '10genIsCool' you should run :
$ bin/scripts/adduser samplesite bob bob@bob.com 10genIsCool admin
Don't forget the "admin" at the end. It's important. Once completed, you should have an admin account.
Now you can go to the admin site for the sample site (db and appserver must be running, of course) :
http://localhost:8080/admin
And log in with "bob" and "10genIsGreat" when prompted. Note that you must specify port 8080 when using the SDK in default mode.
When your application is hosted on 10gen, you'll need to simply use http://your_domain_name/admin to reach it.
For further information on the admin site, please see :
http://www.10gen.com/wiki/pub.Getting%20Started.Admin_Application
