Operating System & Version
Alma linux
cPanel & WHM Version
96.0 (build 0)

binooetomo

Member
Sep 24, 2018
13
1
3
Indonesia
cPanel Access Level
DataCenter Provider
Dear All

I just learn to deploy simple python app on CPanel.

My system is alamalinux with CPanel.

The app is under virtual environment, just a single passenger to show 'helo world'.

here it is (passenger_wsgi.py)

Python:
import sys, os

INTERP = "/home/binojcamp3/virtualenv/teluwolu/3.8/bin/python"


if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)


cwd = os.getcwd()

sys.path.append(cwd)

sys.path.append(cwd + '/proj')  #You must add your project here


sys.path.insert(0,cwd+'/virtualenv/teluwolu/3.8/bin')

sys.path.insert(0,cwd+'/virtualenv/teluwolu/3.8/lib/python3.8/site-packages')



def application(environ, start_response):

    start_response('200 OK', [('Content-Type', 'text/plain')])

    message = 'It works!\n'

    version = 'Python %s\n' % sys.version.split()[0]

    response = '\n'.join([message, version])

    return [response.encode()]

When I open the site via web browser, looks like the passenger is 'called'.
But it show some error.
You can check it at REDACTED FOR SECURITY

Kindly please give me any clues to fix this problem

regards
-bino-
 
Last edited by a moderator:

cPDavidL

Linux Analyst II
Oct 15, 2012
79
18
133
cPanel Access Level
Root Administrator
Greetings!

In checking the URL you gave, I see a string of warnings about failing to open and create files associated with the operation of the application. My first recommendation would be to check that the paths referenced in the warnings exist, and that the user can open/create files in that path.

I would also recommend opening a ticket with our support staff( cPanel ), then we'll be able to investigate first hand and advise you in more detail. If you do open a ticket, please let me know the ticket number and I'll follow up accordingly.
 

binooetomo

Member
Sep 24, 2018
13
1
3
Indonesia
cPanel Access Level
DataCenter Provider
Dear David
Greetings!

In checking the URL you gave, I see a string of warnings about failing to open and create files associated with the operation of the application. My first recommendation would be to check that the paths referenced in the warnings exist, and that the user can open/create files in that path.

I would also recommend opening a ticket with our support staff( cPanel ), then we'll be able to investigate first hand and advise you in more detail. If you do open a ticket, please let me know the ticket number and I'll follow up accordingly.
I really appreciate your very fast response.
Ok, I'll open a ticket.
But first I'll consult the server admin if it OK for your team to fully access the server, since I knew that it'll get best solution.

Sincerely
-bino-