From d551110806aa0f228324eb924d0cbe5cba3d04ab Mon Sep 17 00:00:00 2001 From: Slava Kyrachevsky Date: Thu, 19 Jan 2017 16:26:14 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/requirements.txt b/requirements.txt index 57b51d64..7ed7b70c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ awesome-slugify==1.6 BeautifulSoup==3.2.1 beautifulsoup4==4.4.0 +chainmap==1.0.2 chardet==2.3.0 contextlib2==0.5.4 DAWG-Python==0.7.2 @@ -17,6 +18,7 @@ django-modeltranslation==0.12 django-multiupload==0.5 django-redis==4.0.0 django-redis-cache==0.13.1 +django-rosetta==0.7.6 django-sortedm2m==1.2.0 django-tinymce==2.0.5 django-widget-tweaks==1.4.1 @@ -28,6 +30,7 @@ gnureadline==6.3.3 html2text==2015.6.21 ipython==2.2.0 lxml==3.5.0b1 +microsofttranslator==0.5 MySQL-python==1.2.5 nltk==3.2.2 numpy==1.12.0 @@ -35,6 +38,7 @@ oauthlib==0.6.1 pandas==0.19.2 phonenumbers==6.0.0 Pillow==2.5.3 +polib==1.0.8 pylibmc==1.2.3 pymorphy==0.5.6 pymorphy2==0.8 From c0b9b2c6943cbcb8c5893b70525de0378b026386 Mon Sep 17 00:00:00 2001 From: Slava Kyrachevsky Date: Thu, 19 Jan 2017 16:41:13 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B5=D0=B7=D0=B4?= =?UTF-8?q?=20=D0=BD=D0=B0=20uWSGI=20+=20=D0=BE=D1=82=D0=BA=D0=B0=D0=B7=20?= =?UTF-8?q?=D0=BE=D1=82=20apache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.wsgi | 13 ------------- requirements.txt | 1 + support/apache.conf | 32 -------------------------------- support/nginx.conf | 18 ++---------------- support/supervisor.conf | 7 +++++++ 5 files changed, 10 insertions(+), 61 deletions(-) delete mode 100644 project.wsgi delete mode 100644 support/apache.conf create mode 100644 support/supervisor.conf diff --git a/project.wsgi b/project.wsgi deleted file mode 100644 index f5d7735b..00000000 --- a/project.wsgi +++ /dev/null @@ -1,13 +0,0 @@ -import os, sys -sys.path.append('/home/www/proj') - - - -#sys.path.append("/home/www/proj/organiser") - -#os.environ['DJANGO_SETTINGS_MODULE'] = 'proj.settings' - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "proj.settings") - -import django.core.handlers.wsgi -application = django.core.handlers.wsgi.WSGIHandler() diff --git a/requirements.txt b/requirements.txt index 7ed7b70c..3cb5922b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -65,6 +65,7 @@ South==1.0.2 sqlparse==0.1.11 suds==0.4 Unidecode==0.4.16 +uWSGI==2.0.14 vobject==0.8.2 wstools==0.4.3 xlrd==0.9.2 diff --git a/support/apache.conf b/support/apache.conf deleted file mode 100644 index 80038b2a..00000000 --- a/support/apache.conf +++ /dev/null @@ -1,32 +0,0 @@ - - WSGIDaemonProcess www-data display-name=%{GROUP} processes=2 threads=2 - WSGIProcessGroup www-data - WSGIScriptAlias / "/home/www/proj/project.wsgi" - ServerName 176.121.11.165 - - Order allow,deny - Options Indexes FollowSymLinks - Allow from all - IndexOptions FancyIndexing - - - Alias /media "/home/www/proj/media/" - Alias /static "/home/www/proj/static/" - - - - Order allow,deny - Options Indexes FollowSymLinks - Allow from all - IndexOptions FancyIndexing - - - Order allow,deny - Options Indexes FollowSymLinks - Allow from all - IndexOptions FancyIndexing - - - ErrorLog /var/log/apache2/expo.error.log - CustomLog /var/log/apache2/expo.access.log combined - diff --git a/support/nginx.conf b/support/nginx.conf index 6bed0bd5..f700daff 100644 --- a/support/nginx.conf +++ b/support/nginx.conf @@ -20,22 +20,8 @@ server { client_header_timeout 360s; location / { - proxy_pass http://127.0.0.1:8080/; - proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $remote_addr; - include /etc/nginx/geoip_proxy.conf; - client_max_body_size 100m; - client_body_buffer_size 128k; - - proxy_connect_timeout 90; - proxy_send_timeout 90; - proxy_read_timeout 90; - proxy_buffer_size 16k; - proxy_buffers 256 8k; - proxy_busy_buffers_size 2000k; - proxy_temp_file_write_size 2048k; + include uwsgi_params; + uwsgi_pass 127.0.0.1:49000; } location /4885b11a73674eb6d54593c1d7efd758821e5ee79b8132feecaba10560f0123a.html { diff --git a/support/supervisor.conf b/support/supervisor.conf new file mode 100644 index 00000000..b0f2489a --- /dev/null +++ b/support/supervisor.conf @@ -0,0 +1,7 @@ +[program:expomap] +command=/usr/local/bin/uwsgi -s 127.0.0.1:49000 -M -L -R 5000 --env DJANGO_SETTINGS_MODULE=proj.settings -w "django.core.wsgi:get_wsgi_application()" --touch-reload /home/www/expomap/touch_reload --chdir /home/www/expomap +stopsignal=INT +stopwaitsecs=60 +autostart=true +redirect_stderr=true +user=www-data From eb72c1619dba05196939c356d0bf86611548a754 Mon Sep 17 00:00:00 2001 From: Slava Kyrachevsky Date: Fri, 20 Jan 2017 10:31:08 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=20nginx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- support/nginx.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/support/nginx.conf b/support/nginx.conf index f700daff..a3e287f3 100644 --- a/support/nginx.conf +++ b/support/nginx.conf @@ -18,6 +18,16 @@ server { add_header Strict-Transport-Security "max-age=31536000;"; add_header Content-Security-Policy-Report-Only "default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:"; + gzip on; + gzip_disable "msie6"; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_static on; + gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript; + client_header_timeout 360s; location / { include uwsgi_params;