My first post, and I\'m new to both Python and Apache, so please go easy on me. I have a Python web application in a conda environment that serves up content just fine using Fl
To add to @dino's answer, you can also install mod_wsgi
into your root conda environment:
# Instal `mod_wsgi`
$ pip install mod_wsgi
# Find the full path to installed `mod_wsgi`
$ which mod_wsgi-express
# Install and register the `mod_wsgi` module with Apache
$ sudo /full/path/to/installed/mod_wsgi-express install-module
You can then create conda environments for multiple sites:
# Create 3 conda environments
conda create -n mysite1 python django
conda create -n mysite2 python django
conda create -n mysite3 python django
And set WSGIDaemonProcess
in the Apache site configuration file to use the appropriate environment for each site:
# /etc/apache2/sites-enabled/mysite1.conf
WSGIDaemonProcess mysite1 python-path=/path/to/anaconda3/envs/mysite1/lib/python3.5/site-packages
# /etc/apache2/sites-enabled/mysite2.conf
WSGIDaemonProcess mysite2 python-path=/path/to/anaconda3/envs/mysite2/lib/python3.5/site-packages
# /etc/apache2/sites-enabled/mysite3.conf
WSGIDaemonProcess mysite3 python-path=/path/to/anaconda3/envs/mysite3/lib/python3.5/site-packages