Nodejs's koa2 project is deployed in ubuntu. Do you need nginx?

the project I wrote in koa2 is ready to be deployed on the test server. The server has pm2, installed and started. Do you need nginx configuration?
and after I started, I seemed to prompt that the mongodb service did not start, how should I start it?
how can I start the project by opening the server address after I start my pm2 without nginx,?

clipboard.png
pm2


nodeconfig
mongodb

pm2 log

clipboard.png

Mar.18,2021

  1. not required, if not port 80.
  2. just start it directly, such as service mongodb start

1 is port 80 or you can start
directly if your server has only one domain name binding. If you want to deploy multiple domain name accesses, you need to nginx

.

2 the database did not start


No nginx is required

first check to see if mongodb is started. Use the mongod command to start

.
  1. Node is already a runtime JS service environment. As long as different Node projects use different ports, you can use IP:Port to access different projects. PM2 is a software environment for managing Node, and you can easily start switching and stop multiple Node projects using PM2;
  2. Nginx is to configure the domain name association IP (if there is no domain name when there is no domain name for different Port), tests, you can just use IP, that is, as described in [1], as long as PM2.
  3. the configuration of MongoDB (you should ask how to write the database link) depends on whether the Node project and MongoDB are on the same server .
    3.1. the same , there is no difference in MongoDB configuration for development, testing and production. Database links are all in the form of mongodb://127.0.0.1:27017 (default port) / dev or / test or / production
    3.2. is different , that is, if the MongoDB database is in other servers and allows remote connections , the database links are all in the form of mongodb://IP:Port/dev or / test or / production
    or
    mongodb:// domain name / dev or / test or / production
    3.3. You can refer to the official documentation for the start, stop and restart of MongoDB.
  4. After the
  5. PM2 starts successfully, use IP:Port to access any project according to the open port in the Node project.
  6. The error in the
  7. figure is that mongoose failed to link to the MongoDB database.
  8. if you are not familiar with server environment configuration, you can use pagoda panel to view the zero foundation.

not required for port 80

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3647b-2bfe6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3647b-2bfe6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?