Skip to main content

Configure EasyApache-Experimental for Python with mod_wsgi

Comments

6 comments

  • CanadaGuy
    I managed to get things going and thought I would document it here. I installed these packages: yum install ea4-experimental yum install ea-apache24-mod_wsgi
    then followed this, created the include file as directed:
    0
  • CanadaGuy
    I have not yet figured out how to install and point to Python 3.7 however...

    Does a CentOS cPanel install make use of Python in any way? I used a symbolic link to point to python36, and it seems to work after reloading Apache. I was thinking this could work until I find a better solution at the server configuration level and to work with virtualenv.
    0
  • cPanelLauren
    HI @CanadaGuy We do use python 2.7.5: # python --version Python 2.7.5
    As far as installing a newer version of Python, we don't provide support for that but I did find a few tutorials online that suggested ways this can be done: Install Python 3.x in WHM-cPanel Server - Sysally Building Python2.7 and Python3 on CentOS and cPanel - The Wonderful World Of Linux I can't speak for the validity of these but I did look them over, there are a number of other tutorials out there as well. Thanks!
    0
  • CanadaGuy
    HI @CanadaGuy We do use python 2.7.5:

    Is there a list of scripts that use the default Python install? I'd be interested in verifying they could run under Python 3, unless you already know it doesn't. **edit** I guess this is pretty irrelevant. Installing python3 in parallel isn't the trouble, it is the server configuration I'm having difficulty with.
    0
  • cPanelLauren
    Hi @CanadaGuy I do not have a list, though amongst other items I can tell you mailman and SpamAssassin are both python based. The links I shared should have provided some information on how to run Python3 on the server though I'm sure there are other tutorials out there.
    0
  • mostaquim
    Hi @CanadaGuy I am not sure if you have solved this or not. This is the steps I took to serve Django App, I am sure someone might find it useful. 1. Install Python3.6 2. Install mod-alt-passenger package which comes with CloudLinux 3. Uploaded the django app on a directory ( let's say it is /home/user/approot/) 4. Install virtual environment, I installed it in the app root ( /home/user/approot/env) 5. Activate the virtual environment and install required packages. 6. Run manage.py runserver to check if the server runs without any error. ( I did it as a final check if I missed anything) 7. Build the passenger_wsgi.py, this is my very simple passenger_wsgi.py, advanced = "appname.settings" from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
    7. Now to overwrite Apache settings. Create a include.conf file and follow the
    0

Please sign in to leave a comment.