Hello,
I am trying to run a NodeJS app but nothing is loading, have a app.js file at /basedomain.tld/sub.domain.tld/play/app.js
const express = require('express');
const app = express();
// Example route
app.get('/', (req, res) => {
res.send('Hello from Node + LiteSpeed!');
});
// Use PORT from LiteSpeed environment or fallback to 3000 for testing
const port = process.env.PORT || 3000;
app.listen(port, () => {
console.log(`Server running on port ${port}`);
});
vHost config for sub.domain/tld contains:
context /play {
type appserver
location /home/basedomain.tld/sub.domain.tld/play/
binPath /usr/bin/node
appType node
nodeStartupFile app.js
maxConns 100
addDefaultCharset off
}
which node >> /usr/bin/node
which nodejs >> /usr/bin/nodejs
node -v >> v24.13.1
Browser returns ERR_CONNECTION_REFUSED for sub.domain.tld/play and sub.domain.tld/play/ and sub.domain.tld/play:3000 and sub.domain.tld/play/:3000
If I run node app.js in the directory, Server running on port 3000 is printed, but the site does not load on any domain, or the server’s IP address.
I followed both of the articles below but neither one works
https://truehost.com/support/knowledge-base/how-to-deploy-a-nodejs-app-on-cyberpanel/
How can I get a NodeJS application running?