[Flask] Deploying Flask on Debian

Alex Hall ahall at autodist.com
Wed May 4 08:42:38 EDT 2016


Thanks for the help thus far, everyone. Just a quick update to say that I
got Nginx installed on Jessie. The problem was that, though I'd killed
Apache2, it hadn't stopped. I stopped it again, and this time the Nginx
installation went smoothly. I still see the Apache index page, but I
suspect that's because Nginx is looking in /var/www and just serving the
index.html file it finds, which is the Apache file.

Anyway, since that works and people here seem to prefer Nginx, I'll try to
use Flask with Nginx first before reverting to Apache should I fail. Back
to the Digital Oceans tutorial I go.

On Wed, May 4, 2016 at 6:41 AM, David Nieder <davidnieder at gmx.de> wrote:

> Sorry for the second mail, Alex. I didn't reply to the list the first time.
>
> On 03.05.2016 22:05, Alex Hall wrote:
>
>> Hello list,
>> My work has a Google Cloud account, so my boss just made me a Debian
>> server. Being virtual, I can't physically access it, but I've got SSH and
>> SCP, so  same thing. No remote GUI, though, just command line.
>>
>> I've been looking up how to deploy Flask on Linux, Debian specifically,
>> for
>> a couple hours. I'm getting a *lot* of hits, but nothing that seems to be
>> in line with anything else. Some tell me to use WSGI (which I expected),
>> but others say mod_wsgi, and others UWSGI. Mod_wsgi might mean, some say,
>> compiling it for Python3, but I'm on Python 2.7.9? Most assume I'm using a
>> virtual environment, which I'm not, because Python and other web projects
>> are the only things on this server. The Flask docs talk about UWSGI, then
>> something called MGinx? I'm using Apache2, again on Debian 8.
>>
>> Is there a single tutorial or article that most people recommend? I'm not
>> very experienced with Debian, but I'm fine with a command line interface
>> in
>> general. I've got Flask, Flask-WTF, and the pyodbc module I'll need, and
>> now just want to get Flask running with Apache2 so Apache can serve my
>> Flask app. Thanks.
>>
>>
> Hello Alex
> I'm using Apache and mod_wsgi for some years now without any bigger
> problems. There is a section in the flask docs:
> http://flask.pocoo.org/docs/0.10/deploying/mod_wsgi/
>
> Altough the Apache configuration changed a bit with 2.4, which is the
> version that comes with Debian 8.
>
> If you search for "debian 8 mod_wsgi" or "debian mod_wsgi flask" you
> will find a lot of guides (deploying a django app is very similar to a
> flask app and ubuntu is similar to debian)
>
> For a basic configuration you just need two things. A wsgi-file that
> imports you flask app and a WSGIScriptAlias directive in your
> apache/vhost config.
>
> Chances are it won't work on your first try so keep an eye on the apache
> error logs which should by in /var/log/apache2
>
> I also would recommend using virtualenv but you can start without.
>
>
> Good luck ;)
> David
>
>
>>
>> _______________________________________________
>> Flask mailing list
>> Flask at python.org
>> https://mail.python.org/mailman/listinfo/flask
>>
>>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>



-- 
Alex Hall
Automatic Distributors, IT department
ahall at autodist.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160504/f606a126/attachment-0001.html>


More information about the Flask mailing list