On 02/11/2011 16:31, Roberto De Ioris wrote:
Hi,

I'm trying to set up VirtualHosting as is done here:

http://projects.unbit.it/uwsgi/wiki/VirtualHosting

I've tried several different configurations but I can't seem to get it
working. If someone would please be so kind as to take a look and see
what I might be doing wrong, it would be very much appreciated.

uwsgi is started with these flags: -M -L --vhost --no-site

Mercurial is installed system-wide and should be available to any Python
application.

--- nginx.conf ---

server {
      listen      443;
      server_name hg.domain.com;
      location / {
          uwsgi_pass unix:/tmp/uwsgi.sock;
          uwsgi_param UWSGI_SCRIPT    hgweb_wsgi;
          uwsgi_param UWSGI_PYHOME    /usr/local/www/vhosts/hg.domain.com;
          include uwsgi_params;

UWSGI_PYHOME set what we call "dynamic virtualenv". This means your
pythonpath will be something like
/usr/local/www/vhosts/hg.domain.com/lib/python2.x/site-packages

You'd better to use

UWSGI_CHDIR /usr/local/www/vhosts/hg.domain.com

or add /usr/local/www/vhosts/hg.domain.com to the pythonpath
with

--pp /usr/local/www/vhosts/hg.domain.com

in the command line


Hi Roberto,

Thank you very much for your reply and help with this. I've replaced UWSGI_PYHOME with UWSGI_CHDIR and reloaded nginx; I seem to get the same result:

ImportError: No module named hgweb_wsgi
unable to load app mountpoint=hg.domain.com


For completeness, I also tried adding '--pp /usr/local/www/vhosts/hg.domain.com' to uwsgi's flags and get this error:

Traceback (most recent call last):
File "/usr/local/www/vhosts/hg.domain.com/hgweb_wsgi.py", line 13, in <module>
    from mercurial import demandimport; demandimport.enable()
ImportError: No module named mercurial
unable to load app mountpoint=hg.domain.com|


I personally think the first approach seems more "tidy", I'd really like to try and get that working if possible please.

Again, thank you for your time and consideration.
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to