| | 1 | = MongoDB = |
| | 2 | |
| | 3 | May First/People Link does not officially support mongodb databases and does not make backups of databases created by users. However, if requested, we can setup a mongodb for you. |
| | 4 | |
| | 5 | == Admin steps == |
| | 6 | |
| | 7 | * Install mongodb: `apt install mongodb` |
| | 8 | * Login: `mongo mongodb://localhost:27017` |
| | 9 | * Add admin user/password (save password in [wiki:keyringer]) |
| | 10 | {{{ |
| | 11 | db.createUser( |
| | 12 | { |
| | 13 | user: "useradmin", |
| | 14 | pwd: "xxxxxxxxxxxxxxxxxxxxxxxxP", |
| | 15 | roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] |
| | 16 | } |
| | 17 | ) |
| | 18 | }}} |
| | 19 | * Logout (`ctl-d`) |
| | 20 | * Edit `/etc/mongodb.conf` and uncomment `auth = true` |
| | 21 | * Restart mongodb `systemctl restart mongodb` |
| | 22 | * Login again (this time with password) `mongo -u useradmin -p mongodb://localhost:27017` |
| | 23 | * Create requested database: `use <dbname>` |
| | 24 | * Create user account: |
| | 25 | {{{ |
| | 26 | db.createUser( |
| | 27 | { |
| | 28 | user: "<username>", |
| | 29 | pwd: "xxxxxxxxxxxxxxxxxxx", |
| | 30 | roles: [ { role: "readWrite", db: "<dbname>" } ] |
| | 31 | } |
| | 32 | ) |
| | 33 | }}} |
| | 34 | * Create file in user home directory with the credentials. |