1

so I'm on StableHost shared hosting and I am using cPanel to setup a python application (super simple flask app).

The issue is, whilst everything gets setup fine, for some reason the Passenger webapp server isn't running or picking it up at all, so I have no idea if I'm doing something crazy or need to "start" it somehow manually?

Here is what I have (following this simple tutorial)

The cPanel screen under "Setup Python App". As you can see, I have deployed the app and cPanel has created the relevant files in my app directory: enter image description here

The file list, most of the files were created automatically when I created the Setup Python App: enter image description here

.htaccess file, all pointing to what seems to be the correct locations: enter image description here

And yet, THIS is the result when I navigate to the URL I specified for the python app. The webserver just lists the directory. So it almost seems as if Passenger isn't running at all and hence the python files aren't being touched: enter image description here

Does anybody have an idea why this could be. I have SSH access to the server, but when I run "passenger start" all I get is "passenger: command not found".

Jakob
  • 1,129
  • 9
  • 24
  • You don't seem to have entered the location of the WSGI file in that first screenshot. That should surely point to the passenger_wsgi.py file. – Daniel Roseman Jun 07 '17 at 12:28
  • I've done that (updated post the show screenshot with it now). But it still hasn't done anything. – Jakob Jun 07 '17 at 12:38

1 Answers1

1

Noticed that your permission for passenget_wsgi.py was set to 333. Can you try changing that to 644?

The other problem I had was only the root URL would work and all other routes returned 404.

Add the following to the top of your .htaccess file:

RewriteEngine on
RewriteRule ^http://%{HTTP_HOST}%{REQUEST_URI} [END,NE]

Got this info from: https://stackoverflow.com/a/63971427/10122266

Apologies that I couldn't add this as a comment as I do not have sufficient rights yet. But this solution worked for me and it would be a pitty if this little gem is hidden from those who may arrive here.

So would appreciate if this post is not deleted.

taiff
  • 89
  • 8