pm2

开发者实验室之------搭建微信订阅号后台服务

孤人 提交于 2019-12-09 09:53:04
准备域名 任务时间:20min ~ 40min 微信公众平台需要配置服务器地址 URL 访问,在实验开始之前,我们要准备域名。 域名注册 如果您还没有域名,可以 在腾讯云上选购 ,过程可以参考下面的视频。 视频 - 在腾讯云上购买域名 域名解析 域名购买完成后, 需要将域名解析到实验云主机上,实验云主机的 IP 为: <您的 CVM IP 地址> 在腾讯云购买的域名,可以 到控制台添加解析记录 ,过程可参考下面的视频: 视频 - 如何在腾讯云上解析域名 域名设置解析后需要过一段时间才会生效,通过 ping 命令检查域名是否生效 [ ? ],如: ping www.yourmpdomain.com 如果 ping 命令返回的信息中含有你设置的解析的 IP 地址,说明解析成功。 注意替换下面命令中的 www.yourmpdomain.com 为您自己的注册的域名 申请微信个人订阅号 任务时间:5min ~ 10min 在开始搭建我们的订阅号服务器之前,需要先拿到订阅号相关信息。 注册开发者账号 如果你还不是微信订阅号开发者,请先在微信公众平台注册: https://mp.weixin.qq.com 具体注册流程可参考如下视频: 视频 - 注册开发者账号 若您已注册,请点击下一步。 获取微信订阅号公众平台认证字段信息 我们需要获取3个字段:AppID Token

How to hide node cmd windows created by “pm2 start”

杀马特。学长 韩版系。学妹 提交于 2019-12-08 17:26:43
问题 One cmd window per node process, I don't know what these windows for. Can I hide them? 回答1: What you can do is, well... in my case I use Visual Studio Code, you forgot to include your IDE in your question. Now with VSC I have integraded the terminal, so I don't really have 3 windows floating around. Now, there is a work-around with windows, which in mac doesn't happen, in order to have the 3 windows you would have to include in your settings: //Terminal Configurations //PowerShell Windows //

在阿里云服务器上安装node,mongose

核能气质少年 提交于 2019-12-08 14:20:05
1.安装Node.js (1)、wget命令下载Node.js安装包。 该安装包是编译好的文件,解压之后,在bin文件夹中就已存在node和npm,无需重复编译。 wget https://nodejs.org/dist/v6.9.5/node-v6.9.5-linux-x64.tar.xz (2)、解压文件。 tar xvf node-v6.9.5-linux-x64.tar.xz (3)、软件默认安装在/root/node-v6.9.5-linux-x64/目录下。如果需要将该软件安装到其他目录(如:/opt/node/)下,请进行如下操作: mkdir -p /opt/node/ mv /root/node-v6.9.5-linux-x64/* /opt/node/ rm -f /usr/local/bin/node rm -f /usr/local/bin/npm ln -s /opt/node/bin/node /usr/local/bin/node ln -s /opt/node/bin/npm /usr/local/bin/npm (4)、查看node.js和npm版本: node -v npm -v 2.安装mongodb (1)、进入 /usr/local/: cd /usr/local (2)、安装mongodb: wget https://fastdl

How to use pm2 startup command on Debian platform?

老子叫甜甜 提交于 2019-12-08 01:42:46
问题 Here is the link to the documentation on GitHub: https://github.com/Unitech/pm2#startup-script-generation--pm2-startup It is setup to work with Ubuntu/CentOS/Redhat. I need it to work with my Dreamhost VPS which is a Debian machine. Can someone advise me on how I might tweak the init script to make it work on a Debian box? Thanks!! 回答1: Try ubuntu solution. Since ubuntu is a debian fork, it should work there. 回答2: If your vps is running the Jessie release (>8) then Jessie uses systemd not

How to run “npm install” before every pm2-restart?

故事扮演 提交于 2019-12-07 15:42:50
问题 I am trying to automatically deploy a hobby-node-app to my Raspberry Pi 2 via PM2. The PM2 package "autopull" automatically pulls the latest commit from the checked out branch of my Bitbucket-Repo (in case of the RBPi 2 -> master) and restarts PM2. However, if I add new dependencies in my bower.json or package.json in the latest commit, those would not be installed by PM2. Is there a way to have PM2 automatically run "npm install && bower install" after every git pull? I would also be

Node app unresponsive after certain amount of time

谁说胖子不能爱 提交于 2019-12-07 12:08:25
问题 I'm trying to figure out why my nodejs app becomes unresponsive after 11h 20min . It happens every time, no matter if I run it on amazon-linux or Red Hat . My Stack: nodejs (v. 6.9.4) mongodb (3.2) pm2 process manager AWS EC2 instance T2 medium Every time I'm running the app it becomes unresponsive with an error returned to the browser: net::ERR_CONNECTION_RESET Pm2 doesn't restart the app, so I suspect it has nothing to do with nodejs , I also analysed the app and it doesn't have memory

PM2 and Nginx: 502 Bad Gateway

狂风中的少年 提交于 2019-12-07 07:59:03
问题 I've been trying to deploy my Node project on a brand new DO droplet, but i'm having some problems with PM2. My steps are a follows: Node came installed on the Droplet image (Ubuntu, Node v4.4.4) Installed PM2 globally Setup Nginx to reverse proxy 127.0.0.1:3000 Cloned my project and did npm install All i get is Nginx complaining about a 502 Bad Gateway. If i look at the Nginx error.log i get this: connect() failed (111: Connection refused) while connecting to upstream, client: client.ip ,

PM2 on vagrant - starting app AFTER shared folder is mounted

╄→гoц情女王★ 提交于 2019-12-07 07:27:00
问题 How can I set PM2 to start the app after the shared directories get mounted? By default pm2 startup adds script which try to run script right after OS boot, which causes program error (because the folder is not yet mounted by that time). 回答1: you can add the following line in your Vagrantfile config.vm.provision :shell, :inline => "pm2 start /vagrant/project/server/index.js && pm2 startup", :run => 'always', privileged: false read about shell provisioning : inline (string) - Specifies a shell

pm2 可视化在线监控平台 介绍 keymetrics

99封情书 提交于 2019-12-07 06:03:56
使用 node 的同学进行项目部署时,基本上都是用 pm2 进行部署。 我使用 keymetrics 进行实时监控 1、进行登录 地址: https://app.keymetrics.io/#/register 2、获取系统分配 public key 和 secret key 3、在安装有pm2的服务器端输入以下命令 pm2 interact your - secret - key your - public - key 这样就好了,其他交给天意了。 来源: CSDN 作者: 曹天骄 链接: https://blog.csdn.net/solocao/article/details/86554207

nodejs api not working after socket hangup and gets resolved automatically

我的未来我决定 提交于 2019-12-06 21:57:34
Nodejs api not working after socket hangup and gets resolved automatically.I have also added res.end() while sending the response Also added connection:close header in request so as to tell server to close connection after sending the response .This error occurs UNCEREMONIOUS and gets resolved automatically but it blocks some of the trailing apis. #!/usr/bin/env node var app = require('../app'); var debug = require('debug')('rkdemo:server'); var http = require('http'); var port = normalizePort(process.env.PORT || '3000'); app.set('port', port); var server =http.createServer(app,function (req,