You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/hypernode-platform/tools/installation-and-configuration-of-pm2.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
2
myst:
3
3
html_meta:
4
-
description: PM2 is a porcess manager which keeps your application running as
5
-
a deamon. In this article we’ll cover the installation and configuration process
4
+
description: PM2 is a process manager which keeps your application running as
5
+
a daemon. In this article we’ll cover the installation and configuration process
6
6
of PM2.
7
7
title: How to install and configure PM2 on Hypernode?
8
8
redirect_from:
@@ -21,25 +21,25 @@ We will run PM2 in combination with a program called supervisord to make sure th
21
21
22
22
PM2 can be installed in various ways. In this article we'll install the process manager globally for the app user. We'll also create an alias for PM2, so that the program will not spawn the PM2 daemon on the fly. We don't want that to happen, because we want PM2 to run in the foreground so that it can be managed by supervisord.
23
23
24
-
```
25
-
app@abbt5w-tdgroot-magweb-cmbl:~$ # Set NPM prefix to ~/.npm
26
-
app@abbt5w-tdgroot-magweb-cmbl:~$ npm config set prefix ~/.npm
27
-
app@abbt5w-tdgroot-magweb-cmbl:~$ # Install PM2 in NPM prefix
app@abbt5w-example-magweb-cmbl:~$ # Check if pm2 program can be found
42
+
app@abbt5w-example-magweb-cmbl:~$ which pm2
43
43
/data/web/.npm/bin/pm2
44
44
```
45
45
@@ -51,7 +51,7 @@ To make use of supervisord, we first have to make sure it is enabled and running
51
51
52
52
For this article we'll use a simple web server application written in Python. Feel free to use your own application!
53
53
54
-
```
54
+
```python
55
55
#!/usr/bin/env python3
56
56
57
57
from http.server import BaseHTTPRequestHandler, HTTPServer
@@ -87,7 +87,7 @@ The application only handles `GET` requests and responds with the text "Hello, V
87
87
88
88
Now that we have PM2 installed, supervisor available and an application to run, we can combine all the things together. Create a file at /data/web/supervisor/my_application.conf with the following contents.
0 commit comments