You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by ni...@apache.org on 2017/09/05 13:51:32 UTC
svn commit: r1807348 - in /comdev/nearby_people:
gunicorn-nearby.service.example installation.txt run.cgi run_wsgi.py
Author: nick
Date: Tue Sep 5 13:51:31 2017
New Revision: 1807348
URL: http://svn.apache.org/viewvc?rev=1807348&view=rev
Log:
New server paths, Gunicorn SystemD config, Gunicorn install docs section
Added:
comdev/nearby_people/gunicorn-nearby.service.example
Modified:
comdev/nearby_people/installation.txt
comdev/nearby_people/run.cgi
comdev/nearby_people/run_wsgi.py
Added: comdev/nearby_people/gunicorn-nearby.service.example
URL: http://svn.apache.org/viewvc/comdev/nearby_people/gunicorn-nearby.service.example?rev=1807348&view=auto
==============================================================================
--- comdev/nearby_people/gunicorn-nearby.service.example (added)
+++ comdev/nearby_people/gunicorn-nearby.service.example Tue Sep 5 13:51:31 2017
@@ -0,0 +1,12 @@
+[Unit]
+Description=Gunicorn Daemon - Nearby People
+After=network.target
+
+[Service]
+User=www-data
+Group=www-data
+WorkingDirectory=/var/www/apps/nearby_people/
+ExecStart=/usr/bin/gunicorn --access-logfile - --workers 4 run_wsgi:application
+
+[Install]
+WantedBy=multi-user.target
Modified: comdev/nearby_people/installation.txt
URL: http://svn.apache.org/viewvc/comdev/nearby_people/installation.txt?rev=1807348&r1=1807347&r2=1807348&view=diff
==============================================================================
--- comdev/nearby_people/installation.txt (original)
+++ comdev/nearby_people/installation.txt Tue Sep 5 13:51:31 2017
@@ -44,6 +44,13 @@ General Setup Instructions
of the webapp
- Run "./manage runserver" and ensure it starts the test WSGI
server without issue
+ * Gunicorn
+ - Copy gunicorn-nearby.service.example to
+ /etc/systemd/system/gunicorn-nearby.service
+ - Edit paths to reflect the actual path of Django and of the webapp
+ - Run "systemctl start gunicorn-nearby" then
+ "systemctl enable gunicorn-nearby"
+ - Arrange for port 8080 to be proxied to
* HTTPD config file
- WSGIScriptAlias / /<path to checkout>/run_wsgi.py
- Alias /admin_media/ /<path to django>/django/contrib/admin/media/
Modified: comdev/nearby_people/run.cgi
URL: http://svn.apache.org/viewvc/comdev/nearby_people/run.cgi?rev=1807348&r1=1807347&r2=1807348&view=diff
==============================================================================
--- comdev/nearby_people/run.cgi (original)
+++ comdev/nearby_people/run.cgi Tue Sep 5 13:51:31 2017
@@ -92,7 +92,9 @@ def run_with_cgi(application):
result.close()
# Change this to the directory above your site code.
-sys.path.append("/home/mycode")
+sys.path.append("/var/www/apps/")
+sys.path.append("/var/www/apps/nearby_people/")
+sys.path.append("/var/www/apps/django-1.4/")
# Change mysite to the name of your site package
os.environ['DJANGO_SETTINGS_MODULE'] = 'nearby_people.settings'
run_with_cgi(django.core.handlers.wsgi.WSGIHandler())
Modified: comdev/nearby_people/run_wsgi.py
URL: http://svn.apache.org/viewvc/comdev/nearby_people/run_wsgi.py?rev=1807348&r1=1807347&r2=1807348&view=diff
==============================================================================
--- comdev/nearby_people/run_wsgi.py (original)
+++ comdev/nearby_people/run_wsgi.py Tue Sep 5 13:51:31 2017
@@ -18,7 +18,7 @@ import sys, os
# The path needs to contain the installed directory (i.e. the directory with
# this file in it), the parent of the installed directory, wherever your
# Django install is, plus the system path
-sys.path = [ '/var/python_apps/', '/var/python_apps/nearby_people/', '/var/python_apps/django-1.0', '/var/python/lib/python2.4' ] + sys.path
+sys.path = [ '/var/www/apps/', '/var/www/apps/nearby_people/', '/var/www/apps/django-1.4' ] + sys.path
# Tell the Django WSGI handler which settings file to bootstap from
os.environ["DJANGO_SETTINGS_MODULE"] = "nearby_people.settings"