diff --git a/bin/run_sigi b/bin/run_sigi index fddd9eb..6ddfde4 100755 --- a/bin/run_sigi +++ b/bin/run_sigi @@ -1,7 +1,7 @@ #!/bin/bash - + NAME="sigi" -DJANGODIR=/var/aplicacoes/sigi +DJANGODIR=/srv/sigi SOCKFILE=/var/run/sigi/sigi.sock USER=sigi GROUP=sigi @@ -10,14 +10,14 @@ DJANGO_SETTINGS_MODULE=sigi.settings DJANGO_WSGI_MODULE=sigi.wsgi echo "Starting $NAME as `whoami`" - + cd $DJANGODIR export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE export PYTHONPATH=$DJANGODIR:$PYTHONPATH - + RUNDIR=$(dirname $SOCKFILE) test -d $RUNDIR || mkdir -p $RUNDIR - + exec gunicorn ${DJANGO_WSGI_MODULE}:application \ --name $NAME \ --workers $NUM_WORKERS \ diff --git a/etc/apache/sites-available/sigi.erb b/etc/apache/sites-available/sigi.erb index da725e5..acbc5f6 100644 --- a/etc/apache/sites-available/sigi.erb +++ b/etc/apache/sites-available/sigi.erb @@ -2,9 +2,9 @@ NameVirtualHost 10.1.2.126:80 ServerName sigi01h.interlegis.leg.br - WSGIScriptAlias /sigi /var/aplicacoes/sigi/sigi/wsgi.py - Alias /sigi/static /var/aplicacoes/sigi/static - Alias /sigi/sigiStatic /var/aplicacoes/sigi/sigiStatic + WSGIScriptAlias /sigi /srv/sigi/sigi/wsgi.py + Alias /sigi/static /srv/sigi/static + Alias /sigi/sigiStatic /srv/sigi/sigiStatic ErrorLog /var/log/apache2/sigi-error.log diff --git a/etc/cron.daily/sigi b/etc/cron.daily/sigi index 4548128..2770a84 100644 --- a/etc/cron.daily/sigi +++ b/etc/cron.daily/sigi @@ -1,4 +1,4 @@ #!/bin/bash -cd /var/aplicacoes/django/sigi/sigi/ +cd /srv/sigi/sigi/ python manage.py atualiza_uso_servico -v 0 python manage.py clearsessions -v 0 diff --git a/etc/cron.hourly/sigi b/etc/cron.hourly/sigi index 4dc7797..0017b2f 100644 --- a/etc/cron.hourly/sigi +++ b/etc/cron.hourly/sigi @@ -1,3 +1,3 @@ #!/bin/bash -cd /var/aplicacoes/django/sigi/sigi +cd /srv/sigi/sigi python manage.py gera_map_data diff --git a/etc/nginx/sites-available/sigi.vhost b/etc/nginx/sites-available/sigi.vhost index 822753d..e9bfc37 100644 --- a/etc/nginx/sites-available/sigi.vhost +++ b/etc/nginx/sites-available/sigi.vhost @@ -1,24 +1,24 @@ upstream sigi_app_server { server unix:/var/run/sigi/sigi.sock fail_timeout=0; } - + server { listen 80; server_name sigi01h.interlegis.leg.br; - + client_max_body_size 4G; - + access_log /var/log/sigi/sigi-access.log; error_log /var/log/sigi/sigi-error.log; location /static/ { - alias /var/aplicacoes/sigi/static/; + alias /srv/sigi/static/; } location /media/ { - alias /var/aplicacoes/sigi/media/; + alias /srv/sigi/media/; } - + location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; diff --git a/etc/supervisor/conf.d/sigi.conf b/etc/supervisor/conf.d/sigi.conf index 7a245ce..aa9387f 100644 --- a/etc/supervisor/conf.d/sigi.conf +++ b/etc/supervisor/conf.d/sigi.conf @@ -1,5 +1,5 @@ [program:sigi] -command = /var/aplicacoes/sigi/bin/run_sigi +command = /srv/sigi/bin/run_sigi user = sigi stdout_logfile = /var/log/sigi/sigi-supervisor.log redirect_stderr = true diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp index 2f8eb77..f2a371b 100644 --- a/puppet/manifests/site.pp +++ b/puppet/manifests/site.pp @@ -93,6 +93,8 @@ exec { 'collectstatic': # TODO local_settings.py ... + + ########################################################################### # NGINX