I would like to run Django (python) on my cPanel VPS. My current web host runs on CloudLinux, and as I understand it, that is a requirement for the Setup Python App. I also understand there is an aspect of this tool called Passenger, and that I'm entirely unfamiliar with. I'm looking for some more flexibility on software versions, hence why I'm looking into a VPS. I have come across the following link:
Install mod_wsgi?
I understand I can go through the EasyApache4 Experimental Repository to install mod_wsgi. Can anyone provide come guidance on how I would continue configuring cPanel, and most likely Apache, to serve a Django site? The Setup Python App places the following .htaccess in the web root:
The Quick Configuration Guide here:
Quick Configuration Guide — mod_wsgi 4.6.5 documentation
Is mildly similar, but doesn't reference the virtualenv that is to be used by Django:
but it also indicates "any static files contained in the DocumentRoot will be hidden and requests against URLs pertaining to the static files will instead be processed by the WSGI application." This seems somewhat different from the CloudLinux way which allows Apache to still serve any content in the document root.
I know this is all at my own risk, but I don't mind learning something, and will just redo the VPS if the cPanel installation is fubar'd. Anyone have some guidance?
Install mod_wsgi?
I understand I can go through the EasyApache4 Experimental Repository to install mod_wsgi. Can anyone provide come guidance on how I would continue configuring cPanel, and most likely Apache, to serve a Django site? The Setup Python App places the following .htaccess in the web root:
Code:
# DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION BEGIN
PassengerAppRoot "/home/user/path-to-application-directory"
PassengerBaseURI "/"
PassengerPython "/home/user/virtualenv/name-of-application-directory/3.7/bin/python3.7"
# DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION END
Quick Configuration Guide — mod_wsgi 4.6.5 documentation
Is mildly similar, but doesn't reference the virtualenv that is to be used by Django:
Code:
WSGIScriptAlias / /usr/local/www/wsgi-scripts/myapp.wsgi
I know this is all at my own risk, but I don't mind learning something, and will just redo the VPS if the cPanel installation is fubar'd. Anyone have some guidance?