suresh
suresh

Reputation: 49

How to run node.js application on pm2

I am new to pm2 manager and ssh. I developed one project in node.js and hosted into pm2 and ssh.That's Working fine and give correct output Now my question is Same way i hosted another project into pm2 server and then i follow below procedure to run this application. Step1: ssh and Mycredentials step2: cd folder projectname step3 : pm2 start www That shows Done. I will run url i didn't get output default it shows first project ouput\ please help me!

Upvotes: 0

Views: 8305

Answers (2)

suresh
suresh

Reputation: 49

i tried but not working. pm2 stop appname pm2 delete appname After enter above commands it show process is deleted,Then i enter second project and pm2 start www but i got first project output

Upvotes: 0

Ashok JayaPrakash
Ashok JayaPrakash

Reputation: 2293

Start your pm2 service with name argument to differentiate with multiple services

pm2 start www --name="my-sample-app1"
pm2 start index.js --name="my-sample-app2"

In order to list out the running process, enter the following command,

pm2 list

Using this you can debug the list of running process

To know the detailed information about your running process, use the following command

pm2 show my-sample-app1
pm2 show my-sample-app2

Upvotes: 1

Related Questions