<div dir="ltr"><div><div><div><div><div>Hey all,<br></div>Here's where I am on this journey. I spent the last day or so stuck on getting my database and Debian server to talk. I FINALLY got that to work just now, and my Flask app is able to start up. It seems the Flask server can't serve to external web browsers, only those able to access localhost, but I'm trusting that the app will now work as expected.<br><br></div>I've got Nginx installed and, it claims, starting up normally. I've installed WSGI and UWSGI, and my Flask app is in a virtual environment, which I can activate successfully. At last, I'm ready for the actual configuration of the pieces to let Nginx serve Flask. Which leads to a couple questions, for clarification.<br><br></div>1. Is Mod_WSGI only for Apache? Should I stick with UWSGI, given that I'm using Nginx?<br><br></div>2. I read that UWSGI is also a web server, and that it's suggested to use UWSGI with Nginx behind it. This seems more complicated than I expected. Did I understand it right? Is this a choice, or the only/best way to set things up?<br><br></div>3. When all this is up and running, will views be relative to my app, or app/templates? That is, should I set the document root in Nginx to be /var/www/myApp, or /var/www/myApp/templates? The myApp folder has run.py, config.py, static/, and templates/.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 3:44 AM, Andrea D'Amore <span dir="ltr"><<a href="mailto:and.damore@gmail.com" target="_blank">and.damore@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 4 May 2016 at 00:02, Alex Hall <<a href="mailto:ahall@autodist.com">ahall@autodist.com</a>> wrote:<br>
> Thanks guys. I'm intrigued by Nginx, after reading more about it. The<br>
> problem is that apt-get install nginx keeps failing, with some kind of<br>
> dependency problem, sudo or no sudo.<br>
<br>
That's odd for a freshly installed Jessie, it could be a clash with<br>
the installed apache service but since you didn't paste the actual APT<br>
error there's no way to tell.<br>
<br>
> I've stopped Apache, but still get the<br>
> error. Thus, I'd like to stick to Apache if I could, simply because it's<br>
> already installed and (to my knowledge) working.<br>
<br>
I stay away from apache httpd as much as I can, for a similar need I<br>
use lighttpd as proxy to the flask application on localhost.<br>
<br>
> This is a small, internal<br>
> site that doesn't need the efficiency of Nginx to run, and I'm having enough<br>
> problems with getting Flask to work that messing with installing a stubborn<br>
> Nginx doesn't seem the best way to stay sane.<br>
<br>
uwsgi is capable of directly serving the app, if it's a LAN app you're<br>
probably fine deploying the app with it, for a very low number of<br>
clients you could even use the builtin server.<br>
Just the other day I was reading again about flask deployment and I<br>
think I saw numbers as rule of thumb, 10 clients for builtin server<br>
and 100 for uwsgi IIRC but I may as well just making those up.<br>
<br>
If you decide to go with uwsgi, that I'd suggest in this case, just<br>
follow its documentation, it's detailed and got plenty of examples. If<br>
you want another process to serve TCP 80 remember to shut down the<br>
apache service.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Andrea<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div>Alex Hall<br></div>Automatic Distributors, IT department<br></div><a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a><br></div></div>
</div>