WebFaction
Community site: login faq

I setup an app via the web interface: mod_wsgi 3.4/Python 2.7.

I used this to create a virtualenv and deploy my django app. Its been working fine. However, with a new update, we're trying to use gevent which doesn't seem to work nicely with mod_wsgi. We think it will work correctly under uWSGI. I'm having trouble setting things up under uWSGI. I found these instructions: http://projects.unbit.it/uwsgi/wiki/Example

My WSGI file contains this: import os import sys

from django.core.handlers.wsgi import WSGIHandler

os.environ['DJANGO_SETTINGS_MODULE'] = 'cpc.settings_staging'
application = WSGIHandler()

I tried the change to apache2/conf/http.conf and added this: <location/> SetHandler uwsgi-handler uWSGISocket 127.0.0.1:3031 </location>

when I try apache2/bin/restart I get:

Syntax error on line 38 of /home/cpcadmin/webapps/cpcstaging/apache2/conf/httpd.conf:
Invalid command 'uWSGISocket', perhaps misspelled or defined by a module not included in the server configuration

One more thing, the last line says "Do not forget to load the uwsgi apache2 module in your apache configuration (normally it will be installed in /usr/lib/apache2)". I assume that will fix my problem, but I don't know how to install/load these module's on webfaction?

asked 27 Oct '14, 23:35

rsp
141612
accept rate: 0%

edited 28 Oct '14, 03:37

Have you seen the existing guide to using Nginx + uWSGI + Django? If not, please review this one:

https://community.webfaction.com/questions/10242/installing-nginx-uwsgi

I'm not sure if your priority is to keep Apache or to use uWSGI. It was my understanding that most people that do use uWSGI do so with Nginx instead of Apache.

(28 Oct '14, 01:18) ryans ♦♦

Thanks. I did see that. I'm going to try it. I'm not too familiar with deployment setups which is one reason I stuck with webfaction's default apache/mod_wsgi. However, I think mod_wsgi is the thing causing the problem with our code so I wanted to see if its easy to just change to uwsgi without making a lot of other changes (like switching to nginx from apache). nginx deployment seems like a bunch of stuff out of my league, but I'll take a look at it, unless there is a simpler solution?

(28 Oct '14, 03:34) rsp

It might be simpler to use uWSGI with apache, but it's not something I have any experience with and it's not something we have a how-to guide for. Given that we have a setup guide for uWSGI on Nginx, and because it's probably going to be easier to obtain support from the uWSGI community when using Nginx, I'd still go that route if it were me. It may be a bigger change, but it's still probably the simpler solution given the tools available.

(28 Oct '14, 10:00) ryans ♦♦
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×225
×17

question asked: 27 Oct '14, 23:35

question was seen: 4,707 times

last updated: 28 Oct '14, 10:00

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM