I eventually figured some stuff out.
I figured I'd post my learnings here -- it's largely a recollection of
the above, but with some context:


Configuring your environment.ini or app
---------------------------------------

for simplicity, you can put everything into a uwsgi block.
all of these can be dropped into `uwsgi` command line options , shown
below

    [uwsgi]
    socket = /tmp/my_pyramid_app.sock
    master = true
    processes = 1
    daemonize = /var/log/uwsgi/my_pyramid_app-uwsgi.log
    pidfile = /tmp/my_pyramid_app.pid
    virtualenv = /webserver/environments/my_pyramid_app-2.7/

commandline equivalents , for spawning the uwsgi server
    socket = -s | --socket
    master = -M | --master
    processes = -p | --processes
    daemonize = -d | --daemonize
    pidfile = --pidfile
    virtualenv = -H | --home | --virtualenv | --venv | --pyhome



Spawning the uwsgi server
-------------------------

This will spawn the uwsgi server , but only log uwsgi events.  ie, no
Python logging

    $ uwsgi --ini-paste /path/to/your/environment.ini


This will spawn the uwsgi server with Python logging

    $ uwsgi --ini-paste-logged /path/to/your/environment.ini

If you don't have a [uwsgi] block in your environment.ini , you need
to pass in all the commandline equivalents ( see above )

uwsgi has *a lot* of commandline options.  `uwsgi --help` will list
them all.

Misc issues
-----------

1) wrong app version running

This particular project was in subversion , so I ran into an issue
while testing my tags/current_production after I merged from trunk.

I ran `python setup.py develop` in the virtualenv under the tag to
switch the package and ensure things were working.  My debugging never
showed up, and I thought logging was broken.  After an hour of
troubleshooting, I finally realized that the issue wasn't with the .py
files but the .pyc files.  I ran a cleanup script on the tag and trunk
(just removes all the .pycs), and then uwsgi started serving the right
files.  Not sure how/why this happened, but if anyone has issues with
it, that might help.


2) trouble compiling uwsgi on osx

uwsgi wouldn't install for me.  i kept getting issues regarding the
architecture that pcre was built on.  installing a new pcre didn't
work.

i eventually figured out :

   uwsgi constantly thinks the mac is x86_64
   pcre constantly thinks the mac is i386


if this happens to you, to get around this when compiling PCRE:

   ./configure CC="gcc -arch i386 -arch x86_64" \
        CXX="g++ -arch i386 -arch x86_64" \
        CPP="gcc -E" CXXCPP="g++ -E" \
        --prefix=/path/to/your/virtualenv
   make
   make install
   file /path/to/your/virtualenv/lib/libpcre.dylib

when you `file` the libpcre.dylib , you should see it built for
multiple architectures , one of which should match what uwsgi wants.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to