Changes between Version 1 and Version 2 of InitdScriptForDebian
- Timestamp:
- Aug 5, 2008, 10:50:19 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
InitdScriptForDebian
v1 v2 1 = Init script for Debian = 2 3 This is an init script for Debian. Save as {{{/etc/init.d/django}}} and run the following command: 4 {{{ 5 update-rc.d django defaults 6 }}} 7 8 By default the script expects Django sites in {{{/var/lib/django/<project>}}}. It will store PID files in {{{/var/run/django}}}. These directories must already exist. 9 10 The settings may be overridden in a settings file located at {{{/etc/defaults/django}}}. You must at least set the {{{DJANGO_SITES}}} variable. An example is included below. 11 12 == {{{/etc/init.d/django}}} == 13 1 14 {{{ 2 15 #! /bin/sh … … 10 23 # Description: Django, in order to operate with FastCGI, must be started 11 24 # in a very specific way with manage.py. This must be done 12 # for each D Jango web server that has to run.25 # for each Django web server that has to run. 13 26 ### END INIT INFO 14 27 # … … 18 31 # Changed: Jannis Leidel 19 32 # <jannis AT leidel.info> 33 # Joost Cassee 34 # <joost@cassee.net> 20 35 # 21 # Version: @(#)fastcgi 0. 2 13-Jun-2007 jannis AT leidel.info36 # Version: @(#)fastcgi 0.3 05-Aug-2008 joost AT cassee.net 22 37 # 23 38 24 #### SERVER SPECIFIC CONFIGURATION 39 set -e 40 41 #### CONFIGURATION (override in /etc/default/django) 25 42 26 43 # django project names/directories 27 DJANGO_SITES=" myapp myapp2 myapp3"44 DJANGO_SITES="" 28 45 29 46 # path to the directory with your django projects 30 SITES_PATH=/ path/to/django/projects47 SITES_PATH=/var/lib/django 31 48 32 49 # path to the directory for socket and pid files 33 RUNFILES_PATH= $SITES_PATH/run50 RUNFILES_PATH=/var/run/django 34 51 35 52 # please make sure this is NOT root … … 41 58 MAXREQUESTS=1000 42 59 43 #### DO NOT CHANGE ANYTHING AFTER THIS LINE! 44 set -e 60 #### END CONFIGURATION 61 62 # Include defaults if available 63 if [ -f /etc/default/django ] ; then 64 . /etc/default/django 65 fi 45 66 46 67 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 47 DESC=" FastCGI servers"68 DESC="Django FastCGI servers" 48 69 NAME=$0 49 70 SCRIPTNAME=/etc/init.d/$NAME … … 125 146 126 147 }}} 148 149 == {{{/etc/default/django}}} == 150 151 This is an example settings file. Most settings (apart from {{{DJANGO_SITES}}}) are not required, sane defaults are included in the script. 152 153 {{{ 154 # django project names/directories 155 DJANGO_SITES="myapp myapp2 myapp3" 156 157 # path to the directory with your django projects 158 #SITES_PATH=/home/django/projects 159 160 # path to the directory for socket and pid files 161 RUNFILES_PATH=$SITES_PATH/run 162 163 # please make sure this is NOT root 164 # local user prefered, www-data accepted 165 RUN_AS=django 166 167 # maximum requests before fast-cgi process respawns 168 # (a.k.a. get killed and let live) 169 MAXREQUESTS=100 170 }}}