Detailed graphic explanation of how to configure mongodb in Pagoda
This article is provided by the tutorial column of Pagoda Panel to introduce to you how to configure mongodb in Pagoda. I hope it will be helpful to you if you need it!
1. Install mongodb in the pagoda software store
2. Modify the mongodb configuration
bindIp from 127.0.0.1 to 0.0 .0.0, release IP restrictions\
authorization default is disabled, if permission verification is required, change it to enabled (note to keep the space after the colon)
3. Pagoda releases port 27017
4. Alibaba Cloud Server, Network and Security-Security Group-Configure Rules, releases port 27017
5. Configure username and password
pass Pagoda terminal link mongodb
cd /www/server/mongodb/bin mongo
Switch to the admin database, set the administrator account password
use admin db.createUser({user:'root',pwd:'123456',roles:['root']})
Verify whether the addition is successful, db.auth (user name, user password)
db.auth('root', '123456')
Create a role for a certain database
use mydata db.createUser({user:'username',pwd:'123456',roles:['readWrite']})
Verification
db.auth('username', '123456')
6. Modify the background project connection database configuration
7. Upload the backend Project
Enter the www/wwwroot directory, create a new relevant folder, and upload it to the directory
8. Install PM2 management in the Pagoda software store Explorer, start project
Add project, select the startup file path of your background project in the startup file. Other items will be filled in automatically
9. Verify the interface
Go to postman to verify whether the interface request can be successful.
If the request fails, try restarting pm2 and check the project running log to see if there are any errors.
If you encounter mongoDB startup failure
//方案一: mongod -f /www/server/mongodb/config.conf\ 或者修改MongoDB的启动文件\ /etc/init.d/mongodb
//方案二: 改了配置文件,用更高的权限运行这条命令启动服务: sudo mongod -f /www/server/mongodb/config.conf 把-f后面的路径改成你配置文件的路径即可
//方案三: cd /www/server/mongodb/bin 输入命令:`mongod`
The above is the detailed content of Detailed graphic explanation of how to configure mongodb in Pagoda. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1
Powerful PHP integrated development environment