Deploy nodejs app doesn'nt work

After following this tutorial i get this error:

**Request Timeout**

This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.

Server logs:

[LocalWorker::workerExec] Config[Node:spadomain.com:/]: suExec uid 65534 gid 65534 cmd /usr/bin/node /usr/local/lsws/fcgi-bin/lsnode.js, final uid 65534 gid 65534, flags: 0.
#spadomain.com] Connection idle time too long: 301 while in state: 6 watching for event: 270336, close!
#spadomain.com] HttpExtConnector state: 8, request body sent: 0, response body size: -2, response body sent:0, left in buffer: 0, attempts: 0.
#spadomain.com] Proxy connection state: 2, watching event: 25, Request header:673, body:0, sent:0, Response header: 0, total: 0 bytes received in 301 seconds,Total processing time: 301.

I have tried the following:

  • Restarting server once
  • Using PM2 to set it up
Version: Current Version:  2.3 
Build:  2
Current Commit: d617e48d37b9f7bb65ffa6a23547bd8a9a99853e
Latest Version:  2.3
Latest Build:  2
Latest Commit: d617e48d37b9f7bb65ffa6a23547bd8a9a99853e

After really messing around with all the options i could take there should be a caveat that: Do not install your own opinionated nodejs version when setting it up for the first time

  1. I updated cyberpanel to latest commit
  2. I installed nodejs as instructed here
  3. I setup my app
  4. Used the n module to upgrade node with a chance for me to fallback to old node
sudo npm cache clean -f
sudo npm install -g n
sudo n latest
## skip this part for almalinux/centos/rockylinux
sudo apt-get install --reinstall nodejs
## exit console and start new one or
sudo reboot

Using latest node v18.7.0 that i have tested with Express.js server and served a simple reactjs spa

Optional if you still see no changes to node and npm versions

Change the location of the App Server application binary from /usr/bin/node to

I have followed the examples before but i haven’t seen where they show us how to deploy react application from our files

Welcome @Victormomanyi, Happy to have you here

single-page React applications can be deployed using NodeJS and Express.js NodeJS framework. First install the Nodejs as per my instructions on this post.

Secondly, follow the instructions here. Finally Setup AppServer Context to Serve Express.js Application

If you get any issues raise a question here.

Hello, I have followed the corresponding steps as an example.

I am building an api created in node (adonis.js v5).

I have the code and if I use the node server.js command it works perfectly for port 3005 (decided in the .env)

But even following these steps I couldn’t get it to work.

I’m planning to finally use pm2 and abandon this way for good.

I leave my vhost to see if they can help me (it’s a subdomain).

docRoot /home/neuronwebfactory.com/load
vhDomain $VH_NAME
vhAliases www.$VH_NAME
adminEmails [email protected]
enableGzip 1
enableIpGeo 1

errorlog $VH_ROOT/logs/neuronwebfactory.com.error_log {
useServer 0
logLevel WARN
rollingSize 10M
}

accesslog $VH_ROOT/logs/neuronwebfactory.com.access_log {
useServer 0
logFormat “%h %l %u %t “%r” %>s %b “%{Referer}i” “%{User-Agent}i””
logHeaders 5
rollingSize 10M
keepDays 10
compressArchive 1
}

index {
useServer 1
indexFiles index.php, index.html
}

scripthandler {
add lsapi:neuro37049504 php
}

phpIniOverride {
php_admin_value open_basedir “/tmp:$VH_ROOT”
}

extprocessor neuro37049504 {
type lsapi
address UDS://tmp/lshttpd/neuro37049504.sock
maxConns 10
env LSAPI_CHILDREN=10
initTimeout 60
retryTimeout 0
persistConn 1
pcKeepAliveTimeout 1
respBuffer 0
autoStart 1
path /usr/local/lsws/lsphp80/bin/lsphp
extUser neuro3704
extGroup neuro3704
memSoftLimit 2047M
memHardLimit 2047M
procSoftLimit 400
procHardLimit 500
}

context /.well-known/acme-challenge {
location /usr/local/lsws/Example/html/.well-known/acme-challenge
allowBrowse 1

rewrite {
enable 0
}
addDefaultCharset off

phpIniOverride {

}
}

context / {
type appserver
location /home/neuronwebfactory.com/load
binPath /usr/bin/node
appType node
startupFile server.js
maxConns 100

rewrite {

}
addDefaultCharset off
}

vhssl {
keyFile /etc/letsencrypt/live/load.neuronwebfactory.com/privkey.pem
certFile /etc/letsencrypt/live/load.neuronwebfactory.com/fullchain.pem
certChain 1
sslProtocol 24
enableECDHE 1
renegProtection 1
sslSessionCache 1
enableSpdy 15
enableStapling 1
ocspRespMaxAge 86400
}

module cache {
storagePath /usr/local/lsws/cachedata/$VH_NAME
}

What way ?

This is not amethod for deploying. This was an issue with node version that is fixed on ubuntu, centos and almalinux using the steps here Deploy nodejs app doesn'nt work - #2 by josephgodwinke

PM2 should be used to deploy adonisjs that is what I use and that is what is ultimately recommended in their docs Deployment

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.