本文介绍了如何在AWS ubuntu服务器上使用jenkins启动pm2网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 AWS ubuntu 服务器上设置了 Jenkins pm2 .我有一个由 jenkins 建立的网站 A .然后, jenkins 将在配置的Shell中的 pm2 之前启动该网站.但是,只有通过手动登录 ubuntu 服务器来启动网站并运行pm2 start A才能使网站运行.

I set up Jenkins, pm2 on AWS ubuntu server. I had a website A that built by jenkins. The jenkins then will start that website by pm2 in the configured shell. However, only I start the website by logging on to the ubuntu server manually and run pm2 start A can make the website running.

该问题似乎由用户 jenkins 启动的 pm2 在外部世界中可见.只有由用户 ubuntu 启动(通过ssh ubuntu @ myubuntuserver)才能有效公开.

The problem seems that pm2 started by user jenkins will not be visible by the outside world. Only started by user ubuntu (via ssh ubuntu@myubuntuserver) can be effectively public.

为什么以及如何使 jenkins 自动启动 pm2 ?

Why and how can I make jenkins start pm2 automatically?

推荐答案

实际上,詹金斯人已经自动启动了pm2.之所以无法通过pm2 status看到它,是因为您是用另一个用户登录到服务器的.

Actually the jenkins has already started pm2 automatically. Why you can't see it via pm2 status is because you logged in to the server with another user.

通过sudo su jenkins,您可以切换到jenkins用户,然后您可以通过pm2 status看到它们.

By sudo su jenkins you can switch to the jenkins user and then you can see them by pm2 status.

这篇关于如何在AWS ubuntu服务器上使用jenkins启动pm2网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 04:57