Permalink
Browse files

Add some sample configuration file for supervisord, upstart, and uwsg…

…i. Update nginx.conf a tad, and add in sentry/raven to requirements.
  • Loading branch information...
1 parent b3c4f98 commit 0d7bb9cf6e6be1f8798787a5b6b347eecfc9ac2a @xenith committed Feb 26, 2012
Showing with 75 additions and 5 deletions.
  1. +15 −1 conf/nginx.conf
  2. +23 −0 conf/supervisord.conf
  3. +14 −0 conf/upstart.conf
  4. +15 −0 conf/uwsgi.ini
  5. +4 −4 docs/Makefile
  6. +4 −0 requirements/prod.txt
View
@@ -1,5 +1,5 @@
# Set another default user than root for security reasons
-user www www;
+user www-data www-data;
# As a thumb rule: One per CPU. If you are serving a large amount
# of static files, which requires blocking disk reads, you may want
@@ -144,6 +144,20 @@ http {
add_header Cache-Control "public";
}
+ location /static
+ alias $PROJECT_ROOT/static/;
+ }
+
+ location /media
+ alias $PROJECT_ROOT/media/;
+ }
+
+ # uWSGI configuration
+ # location / {
+ # uwsgi_pass unix:///var/run/$PROJECT_NAME.sock;
+ # include uwsgi_params;
+ # }
+
# opt-in to the future
add_header "X-UA-Compatible" "IE=Edge,chrome=1";
View
@@ -0,0 +1,23 @@
+[program:uwsgi]
+command = env/bin/uwsgi -ini conf/uwsgi.ini
+autostart = true
+autorestart = true
+redirect_stderr = true
+stopsignal = QUIT
+
+[supervisord]
+logfile = log/supervisord.log
+logfile_maxbytes = 10MB
+logfile_backups = 5
+loglevel = info
+pidfile = run/supervisord.pid
+
+[supervisorctl]
+serverurl = unix://run/supervisor.sock
+
+[unix_http_server]
+file = run/supervisor.sock
+chmod = 0777
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
View
@@ -0,0 +1,14 @@
+description "uWSGI for MyProject"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+
+kill timeout 5
+respawn
+
+env VENV=""
+env SITE=""
+
+script
+exec sudo -u www-data $VENV/bin/uwsgi -c $SITE/conf/uwsgi.ini
+end script
View
@@ -0,0 +1,15 @@
+[uwsgi]
+socket = /var/run/$PROJECT_NAME.sock
+master = true
+processes = 4
+max-requests = 1000
+harakiri = 30
+post-buffering = 8192
+logto = log/uwsgi.log
+reaper = true
+disable-logging = true
+chmod-socket = 666
+env = DJANGO_SETTINGS_MODULE=$PROJECT_NAME.settings
+module = $PROJECT_NAME.wsgi
+pythonpath = $PROJECT_NAME
+
View
@@ -72,17 +72,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/project.qhcp"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/myproject.qhcp"
@echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/project.qhc"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/myproject.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/project"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/project"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/myproject"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/myproject"
@echo "# devhelp"
epub:
View
@@ -35,3 +35,7 @@ django-debug-toolbar==0.9.4
# Various tidbits
-e git://github.com/jsocol/commonware.git#egg=commonware
-e git://github.com/mozilla/nuggets.git#egg=nuggets
+
+# Logging
+#sentry==3.2.0
+raven>=1.4.4

0 comments on commit 0d7bb9c

Please sign in to comment.