简体   繁体   中英

CyberPanel OpenLiteSpeed: Host Node JS Website

I bought my own VPS and installed CyberPanel. Now I want to host my application written in NodeJS (Typescript).

So I have uploaded my application into public_html folder:

在此处输入图像描述

The application is resulted from these commands:

"build": "tsc --project ./&&copyFiles www/* build",
"build-deploy": "npm run build && cp package*.json build && cd build && npm install --only=production",

I use the build-deploy npm run command to include the node_modules folder as well. The problem is that my website cannot be accessed. It gives a timeout error, it keeps loading the page, then a timeout error shows up.

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'.

This is my vHost Conf :

docRoot                   $VH_ROOT/public_html
vhDomain                  $VH_NAME
vhAliases                 www.$VH_NAME
adminEmails               xxxxxx@gmail.com
enableGzip                1
enableIpGeo               1

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

errorlog $VH_ROOT/logs/$VH_NAME.error_log {
  useServer               0
  logLevel                WARN
  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
}

scripthandler  {
  add                     lsapi:apidi5248 php
}

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

phpIniOverride  {

}

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

rewrite  {
 enable                  1
  autoLoadHtaccess        1
}

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

  rewrite  {

  }
  addDefaultCharset       off

  phpIniOverride  {

  }
}


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

context / {
  type                    appserver
  location               $VH_ROOT/public_html
  startupFile             server.js
  binPath                 /usr/bin/node
  appType                 node
  maxConns                100
 
  accessControl  {
    allow                 *
  }

  rewrite  {

  }
  addDefaultCharset       off
}

Please help

check this file /usr/local/lsws/logs/stderr.log. It's node errors log, maybe you`ll find something useful)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM