Browse Source

Alterado diretório de instalação para /srv/sigi

producao
Marcio Mazza 10 years ago
parent
commit
32f27f388c
  1. 10
      bin/run_sigi
  2. 6
      etc/apache/sites-available/sigi.erb
  3. 2
      etc/cron.daily/sigi
  4. 2
      etc/cron.hourly/sigi
  5. 12
      etc/nginx/sites-available/sigi.vhost
  6. 2
      etc/supervisor/conf.d/sigi.conf
  7. 2
      puppet/manifests/site.pp

10
bin/run_sigi

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
NAME="sigi" NAME="sigi"
DJANGODIR=/var/aplicacoes/sigi DJANGODIR=/srv/sigi
SOCKFILE=/var/run/sigi/sigi.sock SOCKFILE=/var/run/sigi/sigi.sock
USER=sigi USER=sigi
GROUP=sigi GROUP=sigi
@ -10,14 +10,14 @@ DJANGO_SETTINGS_MODULE=sigi.settings
DJANGO_WSGI_MODULE=sigi.wsgi DJANGO_WSGI_MODULE=sigi.wsgi
echo "Starting $NAME as `whoami`" echo "Starting $NAME as `whoami`"
cd $DJANGODIR cd $DJANGODIR
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DJANGODIR:$PYTHONPATH export PYTHONPATH=$DJANGODIR:$PYTHONPATH
RUNDIR=$(dirname $SOCKFILE) RUNDIR=$(dirname $SOCKFILE)
test -d $RUNDIR || mkdir -p $RUNDIR test -d $RUNDIR || mkdir -p $RUNDIR
exec gunicorn ${DJANGO_WSGI_MODULE}:application \ exec gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \ --name $NAME \
--workers $NUM_WORKERS \ --workers $NUM_WORKERS \

6
etc/apache/sites-available/sigi.erb

@ -2,9 +2,9 @@ NameVirtualHost 10.1.2.126:80
<VirtualHost 10.1.2.126:80> <VirtualHost 10.1.2.126:80>
ServerName sigi01h.interlegis.leg.br ServerName sigi01h.interlegis.leg.br
WSGIScriptAlias /sigi /var/aplicacoes/sigi/sigi/wsgi.py WSGIScriptAlias /sigi /srv/sigi/sigi/wsgi.py
Alias /sigi/static /var/aplicacoes/sigi/static Alias /sigi/static /srv/sigi/static
Alias /sigi/sigiStatic /var/aplicacoes/sigi/sigiStatic Alias /sigi/sigiStatic /srv/sigi/sigiStatic
ErrorLog /var/log/apache2/sigi-error.log ErrorLog /var/log/apache2/sigi-error.log

2
etc/cron.daily/sigi

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
cd /var/aplicacoes/django/sigi/sigi/ cd /srv/sigi/sigi/
python manage.py atualiza_uso_servico -v 0 python manage.py atualiza_uso_servico -v 0
python manage.py clearsessions -v 0 python manage.py clearsessions -v 0

2
etc/cron.hourly/sigi

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
cd /var/aplicacoes/django/sigi/sigi cd /srv/sigi/sigi
python manage.py gera_map_data python manage.py gera_map_data

12
etc/nginx/sites-available/sigi.vhost

@ -1,24 +1,24 @@
upstream sigi_app_server { upstream sigi_app_server {
server unix:/var/run/sigi/sigi.sock fail_timeout=0; server unix:/var/run/sigi/sigi.sock fail_timeout=0;
} }
server { server {
listen 80; listen 80;
server_name sigi01h.interlegis.leg.br; server_name sigi01h.interlegis.leg.br;
client_max_body_size 4G; client_max_body_size 4G;
access_log /var/log/sigi/sigi-access.log; access_log /var/log/sigi/sigi-access.log;
error_log /var/log/sigi/sigi-error.log; error_log /var/log/sigi/sigi-error.log;
location /static/ { location /static/ {
alias /var/aplicacoes/sigi/static/; alias /srv/sigi/static/;
} }
location /media/ { location /media/ {
alias /var/aplicacoes/sigi/media/; alias /srv/sigi/media/;
} }
location / { location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;

2
etc/supervisor/conf.d/sigi.conf

@ -1,5 +1,5 @@
[program:sigi] [program:sigi]
command = /var/aplicacoes/sigi/bin/run_sigi command = /srv/sigi/bin/run_sigi
user = sigi user = sigi
stdout_logfile = /var/log/sigi/sigi-supervisor.log stdout_logfile = /var/log/sigi/sigi-supervisor.log
redirect_stderr = true redirect_stderr = true

2
puppet/manifests/site.pp

@ -93,6 +93,8 @@ exec { 'collectstatic':
# TODO local_settings.py ... # TODO local_settings.py ...
########################################################################### ###########################################################################
# NGINX # NGINX

Loading…
Cancel
Save