mongodb install problem ?
-
@ahmed26 The issue lies with how you've configured the
authorization
See below
By default, MongoDB does not require authentication to access the database. However, it is recommended to enable authentication to secure the database and prevent unauthorized access.
To enable authentication for MongoDB, follow these steps:
Edit the MongoDB configuration file:
sudo nano /etc/mongod.conf
This command will open the MongoDB configuration file in the Nano text editor.
Find the security section in the configuration file and add the following lines:
security: authorization: enabled
This will enable the authorization feature for MongoDB, which requires users to authenticate with a username and password to access the database.
Save the changes and exit the text editor.
Restart the MongoDB service:sudo systemctl restart mongod
This command will apply the changes to the MongoDB configuration and restart the service.
-
@ahmed26 You haven't configured any username or password for MongoDB according to that message
By default, MongoDB does not require a password to access the database. However, it is recommended to set a password to secure the database and prevent unauthorized access.
To set a password for MongoDB, follow these steps:
Connect to the MongoDB shell:
mongosh
This command will open the MongoDB shell, which is a command-line interface for interacting with the database.
Switch to the admin database:
use admin
This command will switch to the
admin
database, which is used to manage the users and roles in the database.db.createUser({ user: "admin", pwd: "password", roles: [ { role: "root", db: "admin" } ] })
Replace
admin
andpassword
with the desired username and password for the new user. This command will create a new user with theroot
role in theadmin
database. The root role has full access to all database resources and functions.Exit the MongoDB shell:
exit
-
You also need to do the same for the NodeBB database as outlined in
Ubuntu (Recommended) - NodeBB Documentation
Documentation portal for NodeBB Forum Software
(docs.nodebb.org)
Specifically the section "Configure MongoDB" (you can skip the "admin" user as you've created it already in the above, plus the "security" bit as you now have that working)
-
@ahmed26 you're trying to access on https but your
nginx
config is only listening on port 80 for http. You need to change that to 443 for https but you will also need a certificate which you can get from let's encrypt. -
@phenomlab installation finished
i installed nodebb via ubuntui can't access the forum as an administrator
i forgot my password it doesn't work , does not register on the forum
what is the reason?
I applied the admin password correctly in installation
-
@ahmed26 said in mongodb install problem ?:
Solved by changing This process won't cause any problems, right?
No, not at all. That's the recommended setting.