For a person who does not learn front-end development by himself, the deployment of back-end API interface is completely trivial, do not know Linux command, at the beginning do not know what Xshell is, after buying Ali cloud server, I will not use it, then AFTER I slowly explore these I will slowly, if you just start like me do not lose heart, just do it! It will work out

So let's get back to what we need to do when we write our backend interface and we want to put it on the server, what do we need to do and how do we do that?Copy the code

Need: Aliyun or Tencent cloud server,

Xshell (for connecting to remote servers)

What to do:

1. Connect to the server

2. Download the Pagoda panel

3. Deploy using the pagoda panel

Here are the steps:

1. Connect to the server using Xshell

When you go into ECS after you buy a server, you can see your public IP address,Then use Xshell (download if not available) to connect to the serverAfter the identity authentication, fill in the user name and password (the user name and password are in Aliyun)

If you forget the user name and password, you can change it in the following section. The default user name is root

When you see this, you are connected

2. Download the Pagoda panel

The pagoda panel is used to manage a server just like a navicate panel is used to manage mysql. Go to the Pagoda official website and click here on the Linux panel

In the installation method, find the corresponding installation script (for example, my Centos) when you buy the server.

Copy the installation script to Xshell and run it. Once installed, this will appear

Copy the address of the extranet panel and log in.There is a detail here and there that your corresponding ports should be openOtherwise, I can’t visit

3. Use pagoda panels

After entering the pagoda panel, we need to install the corresponding environment, such as Node, NPM, mysql. Here we install the PM2 manager (which contains Node, NPM, NVM, PM2) and mysql.

When the environment is ready we can add the site here in the pagoda

Delete the node_modules folder before uploading, and then upload the database file as follows

Change the back-end database configuration file

Note that the ports you use in this process, such as 3306, 8888, 80 and so on, should be open in the security facade of pagoda and Aliyun, otherwise they cannot be accessed

Then go to the directory on the SSH terminal and run Node app.js using NPM install

I reported this error when I was running

Later, I asked a big guy that the database was not connected successfully. After we checked the reason together, we found that it was my port mismatch, I matched 3308, using sudo netstat -antp 3308 command can see that the database port is 3306, and reported such error after the mismatch

ManageSys = manageSys; manageSys = manageSys; manageSys = manageSys; manageSys = manageSys; manageSys = manageSys