So I figure it out!!!!

I did some playing around and I got the appr running like :

uwsgi --home /usr/local/www/dev.example.com/wsbcenv/
--pythonpath=/usr/local/www/dev.example.com/current/facebook -w wsgi
-M -s 172.16.30.36:5900 -p 4

So one of the problems was the definition of the pythonhome , the
otherone was that the environment created originaly with virtualenv
was created in a Mac machine and with the wrong options so all the
libraries where links to the original libraries of the system so
pretty much all the libraries where missing.

But now I have a question :

We use one central devserver that runs nginx and several backend
servers for de apps, the document root is mounted through nullfs
(freebsd jails) to the backend servers so that gives you the ability
to have one backend server with php53 one with 52 one with uwsgi so
the idea will be to run uwsgi in bynamic mode so if I put this lines
in my nginx config like :

uwsgi_param     UWSGI_PYHOME /usr/local/www/dev.example.com/wsbcenv/
uwsgi_param     UWSGI_PYTHONPATH /usr/local/www/dev.example/current/facebook
uwsgi_param     UWSGI_SCRIPT wsgi;

and then I run uwsgi in full dynamic mode can I have multiple apps
using the same uwsgi server without interference or do I need to use
emperor mode instead ?


Thanks.

On Mon, Nov 21, 2011 at 11:51 AM, Jose Amengual
<[email protected]> wrote:
> Hi.
>
> So before actually sending the email I search and I tried tons of
> different configs to try to make this work but I got to a point that I
> got confused.
>
> We have some apps on django using uwsgi without any problems and we
> are pretty happy with uwsgi but now one of the developers had the
> brilliant idea of using virtualenv so I read about it and the concept
> is to have all your app requirements in a folder and you create that
> folder environment with a special command and so on but I have some
> questions about using this with uwsgi :
>
> if I use virtualenv and I installed uwsgi with python 2.7 can I still
> use a virtualenv project created in pythong 2.6 ?
>
> the python path for the different projects has to point to the virtual
> env directory in that case ?
>
> I try using dynamic apps in uwsgi passing the parameters through nginx
> but I get always the same error.
>
> My setup looks like this :
>
> in my rc.conf ( FreeBSD) I had this :
>
> uwsgi_flags="--pythonpath=/usr/local/www/dev.example.com/current/environment/bin
> -w wsgi -s 172.16.30.36:5900 -b 500 -w index -p 50 -M -R 300 -l 4096
> -t 60"
>
> nginx config was like this :
>
> server {
>        listen       80;
>        server_name  dev.example.com;
>        client_max_body_size    50m;
>        root  /usr/local/www/dev.example.com/current/appname;
>        location / {
>                index index.php index.html index.htm;
>                location ~ /\. {
>                    deny  all;
>                }
>                if (-f $request_filename) {
>                    expires max;
>                    break;
>                }
>                include uwsgi_params;
>                uwsgi_pass   172.16.30.36:5900;
>        }
> }
>
>
> I got this error :
>
> Set PythonHome to /usr/local/www/dev.example.com/current/environment
> ImportError: No module named site
>
> Then I switched to this config on nginx :
>
> server {
>        listen       80;
>        server_name  dev.example.com;
>        client_max_body_size    50m;
>        root  /usr/local/www/dev.wsbc.workatplay.com/current/appname;
>        location / {
>                index index.php index.html index.htm;
>                location ~ /\. {
>                    deny  all;
>                }
>                if (-f $request_filename) {
>                    expires max;
>                    break;
>                }
>                include uwsgi_params;
>                uwsgi_param     UWSGI_PYHOME
> /usr/local/www/dev.example.com/current/appname;
>                uwsgi_param     UWSGI_CHDIR
> /usr/local/www/dev.example.com/current/appname;
>                uwsgi_param     UWSGI_SCRIPT    uwsgi;
>                uwsgi_param     SCRIPT_NAME     /appname;
>                uwsgi_pass   172.16.30.36:5900;
>        }
> }
>
> and I started uwsgi like :
>
> uwsgi -s 172.16.30.36:5900
>
> and I got this error :
>
> uWSGI Error
>
> Python application not found
>
> Can someone explain me what I'm doing wrong an how virtualenv supposed
> to work with uwsgi ?
>
> Thanks.
>
> --
> Jose Amengual
> Senior System Administrator
> Work at Play | The Creative Technology Agency
> 5th Floor, 329 Railway Street – Vancouver, BC V6A 1A4
> o: 604.685.6418 x104 | c: 604.345.5767
>



-- 
Jose Amengual
Senior System Administrator
Work at Play | The Creative Technology Agency
5th Floor, 329 Railway Street – Vancouver, BC V6A 1A4
o: 604.685.6418 x104 | c: 604.345.5767
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to