On our production server, we run Ubuntu 12.04 to ensure that our application runs in a predefined, consistent environment, we use Pythonbrew to compile custom Python. I created a user who will start our API server, the user has his own Python 2.7.2 environment created using Pythonbrew, with the necessary packages installed using pip.
I also installed uWSGI on the system, it is going to wrap the API application and make it available to Apache via mod_wsgi. The problem is that I cannot force uWSGI to use the correct python binary. The current configuration is as follows:
[uwsgi] socket = 127.0.0.1:3031 processes = 4 chdir = /home/app/ pythonpath = /home/app gid = 1002 uid = 1002 module = api callable = APP enable-threads = true
When I try to run this configuration on the terminal with:
uwsgi --ini app.ini
Failed to import any module. This module is installed only in the Pythonbrew environment that the user of the API uses. The problem is that uWSGI uses the default python binary in / usr / bin.
One solution is to use a separate uWSGI installed using pip in the user API, but I really want to use the uWSGI system because it integrates better with the OS.
Is there a way to indicate which Python should use binary uWSGI, otherwise by setting a separate one? If I need to install a separate instance of uWSGI, what is the best way to start it at system startup?
Edit: just realized that it probably is not using the python binary, but simply imposes a library on it, so I am unable to use the standard wsgi installation and non-standard python. But the question still remains, what is the best way to integrate custom embedded uWSGI into the system.
source share