Node.Js Website stalling after MongoDB module required

#1
I created a website using the normal CyberPanel options and edited the context menue in OLS :)7080) to run node. The website runs fine but the moment I try to connect it with my MongoDB instance either using Mongoose or the native MongoDB Driver, the website stalls.

I can't access the error logs as well. However, when I remove the code that requires MongoDB, and restart the server, the website works. Any solutions?
 

Pong

Administrator
#2
You should provide more details on each configuration. Otherwise, we don't know how did you run node.js on OLS, what change did you make, what errors did you experience.
 
#3
So, I run CyberPanel & Created a website via their panel. Then I went into the OLS Panel and edited the Conext. I have attached the same below. With regards to the server, I run the same on EC2, I have Ubuntu & Node 14.4.0

errorlog $VH_ROOT/logs/$VH_NAME.error_log {
useServer 0
logLevel DEBUG
rollingSize 10M
}

accesslog $VH_ROOT/logs/$VH_NAME.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 0
indexFiles index.php, index.html
}

scripthandler {
add lsapi:indra7578 php
}

phpIniOverride {

}

accessControl {
allow *
}

extprocessor indra7578 {
type lsapi
address UDS://tmp/lshttpd/indra7578.sock
maxConns 100
env LSAPI_CHILDREN=10
initTimeout 600
retryTimeout 0
persistConn 1
pcKeepAliveTimeout 1
respBuffer 0
autoStart 2
path /usr/local/lsws/lsphp74/bin/lsphp
extUser indra7578
extGroup indra7578
memSoftLimit 5000M
memHardLimit 5000M
procSoftLimit 3000
procHardLimit 3000
}

context / {
type appserver
location $VH_ROOT/public_html/
binPath /usr/bin/node
appType node
startupFile server.js
appserverEnv 1
maxConns 100

accessControl {
allow *
}

rewrite {

}
addDefaultCharset off
}

rewrite {
enable 1
autoLoadHtaccess 1
}
 
Top