cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
10,360
1,631
363
cPanel Access Level
Root Administrator
Hey there! On that page you referenced is a link to this page, which explains in great detail how to setup the individual applications:


Can you look at that page and see if that is more along the lines of what you're looking for?
 

Rachel S

Member
Apr 28, 2022
16
4
3
United States
cPanel Access Level
Website Owner
This module will disable Apache's mod_userdir module.
It is recommended that the hosting provider install the ea-ruby27-ruby-devel

Here's how you can install the application:

Step 1:
Log in to the server via SSH as a cPanel user
Step 2: You need to create the application's directory relative to your home directory.
To do that, you need to run this command - mkdir nodejsapp

Step 3: Now, change the application's directory. Besides, it would help if you created app.js with a text editor.

Because Passenger searches for this filename when it executes, we strongly advise you to build it with this exact name. If you are creating a startup file with a different name, you must mention the filename in the 'httpd.conf' file. Then, follow the Create a custom startup file instructions below.

Step 4: Add the configuration of the application to the app.js file.
You can prefer the following example:

const http = require('http')
const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World! NodeJS \n');
});

server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});

If you want to test the application follow the following steps:

Step 1: Log in to the server via SSH as a cPanel user and run the command
-> /opt/cpanel/ea-nodejs16/bin/node app.js
You can prefer this for the output:
-> Server running at http://127.0.0.1:3000

Step 2: Open another window, try logging in to the server via SSH with the same cPanel user.

Step 3: Run the command
-> curl http://127.0.0.1:3000
You can prefer this for the output:
-> Hello World! NodeJS

Step 4: You have to stop the testing process by ctrl + c in the window, or you can run the following command
-> ps aux | grep app.js

Step 5: This will produce a list of running programs' pid (process ID) numbers that include the script name. Run the following command to terminate the test application, where PIDNUMBER is the process ID:
-> kill -9 PIDNUMBER
 

sondroyo

Registered
Oct 24, 2007
3
0
51
Did this work out for you? It seems fine for just the basic test application started with /opt/cpanel/ea-nodejs16/bin/node app.js and running on 127.0.0.1, but I'm not having any luck getting the Application Manager to register things that will actually work (i.e. the base application URL does nothing when typed into a browser). The application js file is definitely named app.js.

Further, any attempt to modify something registered in Application Manager throws 2 errors:
  1. Error: The required parameters are invalid or missing. Error #1: Invalid configuration for the parameter “python”
  2. Error: Your application is incomplete or invalid.
Running 102.0.18, port 3000 is open on ConfigServer (although unclear if the base application URL should be accessed on port 3000 or just regular https.
 

sondroyo

Registered
Oct 24, 2007
3
0
51
Just for other people, I brought someone in who knows a lot more than me. They said:

The cPanel app manager also doesn't handle starting/stopping apps (I'm not even really sure what it does honestly, other than generate an Apache config). I set up service management through systemctl:

systemctl start|stop|restart etherpad