Apache vs. Nginx

21 views
Skip to first unread message

sdc50

unread,
Nov 15, 2016, 10:57:50 AM11/15/16
to Tethys Platform, Nathan Swain, Zhiyu Li, Jacob Fullerton
I updated the comments on issue #195 with the instructions and Conda configuration file that I used to successfully install Tethys with Conda on Ubuntu 16.04 server (if anyone else has a chance to test it out I would appreciate any other validation). I am now trying to get the Conda environment to work with a production server, but it looks like mod_wsgi is compiled against the system Python and so it will not work with the Conda Python unless we compile it specifically with that Python (not something I'm anxious to do). It was quite easy however to get uWSGI to work. I've found instructions for configuring Django to work with uWSGI and Nginx so that should be fairly straight forward. I also found this blog post describing how to set up uWSGI with Apache for a Flask application, so I think we could probably figure out how to adapt that for Django fairly easily. My question is, should the official documentation describe how to set up production installation with Apache or Nginx (or both)? 

@zyli2004 You have been using Nginx for the HydroShare server haven't you? What are the reasons that you chose Nginx? Would you recommend that in general?

@swainn Apache + mod_wsgi is Django's official recommendation. Does switching to uWSGI cause any angst? 

It will likely be a month or so before I can dedicate more time to testing out a production environment with Conda. If anyone else wants to test the development instructions I posted on issue #195 or even go on to trying to figure out a production setup in the meantime that would be great. @jacobfull, I recall you mentioning that you have an app that needs numpy or gdal. If you want to install this Conda environment version of Tethys then installing those will be a breeze. 

swainn

unread,
Nov 15, 2016, 11:18:09 AM11/15/16
to Tethys Platform, nsw...@aquaveo.com, zyli...@gmail.com, jacob...@gmail.com
I'm not opposed to moving to an NGINX production setup. The decision to use Apache was made based on Django's recommendation. I suppose the only concern I would raise is that Apache has a long track record and some IT professionals may prefer it to NGINX. That said, NGINX is becoming more popular all the time and is certainly robust. I saw your instructions on issue #195. I think we ought to create a branch with the YML committed documentation updated appropriately to test with.

Zhiyu (Drew) Li

unread,
Nov 15, 2016, 12:07:32 PM11/15/16
to Scott Christensen, Tethys Platform, Nathan Swain, Jacob Fullerton
My personal feeling is using Nginx made the architecture more clear, more loosely coupled as it can separate django from http server physically. Especially when dockerizing Tethys, we put Ngnix, Tethys(Django + uWSGI/Gunicorn), postgis, geoserver in different containers. Nginx is the single access point (reverse proxy) of the whole Tethys platform instance. It is easier to isolate errors. 

P.S. HydroShare is using Nginx + Gunicorn, not Nginx + uWSGI. I dont know which is better though...

Thanks
Drew

Reply all
Reply to author
Forward
0 new messages