Deploy python django project on cyberpanel at hostinger using openlitespeed

109 views Asked by At

I am trying to Deploy python django project on cyberpanel at hostinger using openlitespeed.

I have setup all things but i am facing the 503, service unavailable error, My WSGI Script is runnig fine when i test it alone in a different directory. I had also take help from this article but no success, https://openlitespeed.org/kb/python-wsgi-applications/#Set_up_Context-2

docRoot                   $VH_ROOT/public_html
vhDomain                  $VH_NAME
vhAliases                 www.$VH_NAME
adminEmails               [email protected]
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:arist7587 php
}

extprocessor arist7587 {
  type                    lsapi
  address                 UDS://tmp/lshttpd/arist7587.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                 arist7587
  extGroup                arist7587
  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  {
     enable                  0
  }
  addDefaultCharset       off

  phpIniOverride  {

  }
}

vhssl  {
  keyFile                 /etc/letsencrypt/live/aristonvillagepizza.uk/privkey.pem
  certFile                /etc/letsencrypt/live/aristonvillagepizza.uk/fullchain.pem
  certChain               1
  sslProtocol             24
  enableECDHE             1
  renegProtection         1
  sslSessionCache         1
  enableSpdy              15
  enableStapling           1
  ocspRespMaxAge           86400
}
context / {
  type                    appserver
  uri                     /
  location                /var/www/html/demo/
  binPath                 /usr/local/lsws/fcgi-bin/lswsgi
  appType                 wsgi
  startupFile             demo/wsgi.py
  env                     LS_PYTHONBIN=/var/www/html/venv/bin/python
  env                     PYTHONHOME=/var/www/html/venv/bin/python:/var/www/html/demo
}

This is my vhost file,

and here is the directory structure.

enter image description here

[ enter image description here] (https://i.stack.imgur.com/N7E8b.png)

I have tried different things, but no results.

0

There are 0 answers