> Try to deploy TillyWiki with Nginx and UWSGi, and here is my config:
I've not personally had a chance to try nginx and uwsgi, so I don't
know how much help I can be. When I get back to a reasonable computer,
I'll give it a try.
In the meantime, if you're going to try to run things as CGI, then
instead of the apache.py file, you may want:
https://raw.github.com/tiddlyweb/tiddlyweb/master/index.cgi
--
Chris Dent http://burningchrome.com/
[...]
> On Fri, 30 Mar 2012, Tefekk�r Shamall wrote:
>
>> Try to deploy TillyWiki with Nginx and UWSGi, and here is my config:
>
> I've not personally had a chance to try nginx and uwsgi, so I don't
> know how much help I can be. When I get back to a reasonable computer,
> I'll give it a try.
Okay, got it running. Here's how (I'll copy this into the docs at
TPC[1] after composing).
I found a documentation page for how to deploy Flask applications
with nginx and uwsgi to be very useful for pointers.
http://flask.pocoo.org/docs/deploying/uwsgi/
1. Install nginx.
On my Mac this was as easy as "brew install nginx". Similar apt-get
and yum commands ought to do the trick on Debian or Fedora based
systems.
2. Install uWSGI.
There's uwsgi the protocol, and uwsgi the daemon. nginx supports the
protocol, but needs the daemon. The easiest way to install it is
with pip:
pip install uwsgi
3. Create or visit your TiddlyWeb instance:
twinstance cow
cd cow
4. Copy in apache.py
Thought called apache.py from the tiddlyweb distribution. Though
called "apache" it's actually a generic WSGI application starter.
cp <path to>/apache.py .
5. Start uwsgi daemon
uwsgi -s /tmp/uwsgi.sock -w apache:application
6. Change permissions on the socket
nginx's worker runs as nobody by default and needs to read and write
the uwsgi.sock file
sudo chown nobody /tmp/uwsgi.sock
7. Configure nginx.conf
Assuming you want tiddlyweb on / find the entry for "location /" in
the http section. Comment that out and add:
location / { try_files $uri @yourapplication; }
location @yourapplication {
include uwsgi_params;
uwsgi_pass unix:/tmp/uwsgi.sock;
}
8. Start or restart nginx
9. Visit the / URL
In my nginx.conf it defaults to listening on port 8080 in the
distributed config. So if I go to
I get the root page of TiddlyWeb.
[1] http://tiddlyweb.peermore.com/
location / { try_files $uri @yourapplication; }
location @yourapplication {
include uwsgi_params;
uwsgi_pass unix:/tmp/uwsgi.sock;
}