소스 검색

Added server config for sandbox site

master
David Winterbottom 14 년 전
부모
커밋
8a71bb4013
5개의 변경된 파일83개의 추가작업 그리고 0개의 파일을 삭제
  1. 18
    0
      sandbox/deploy/apache2/sandbox.conf
  2. 21
    0
      sandbox/deploy/nginx/sandbox.conf
  3. 21
    0
      sandbox/deploy/wsgi/sandbox.wsgi
  4. 5
    0
      sandbox/settings.py
  5. 18
    0
      sandbox/update_build.sh

+ 18
- 0
sandbox/deploy/apache2/sandbox.conf 파일 보기

@@ -0,0 +1,18 @@
1
+<VirtualHost *>
2
+    ServerName sandbox.oscar.tangentlabs.co.uk
3
+    DocumentRoot /var/www/nginx-default
4
+    CustomLog /var/log/apache2/access.sandbox.oscar.log combined
5
+    ErrorLog /var/log/apache2/error.sandbox.oscar.log
6
+
7
+    WSGIDaemonProcess oscar processes=2 threads=5 display-name=oscar maximum-requests=10000
8
+    WSGIProcessGroup oscar
9
+    WSGIApplicationGroup %{GLOBAL}
10
+    WSGIScriptAlias / /var/www/oscar/django-oscar/sandbox/deploy/wsgi/prod.wsgi
11
+    WSGIPassAuthorization On
12
+    
13
+    <Directory /var/www/oscar/django-oscar/sandbox/sandbox/deploy/wsgi>
14
+        Order deny,allow
15
+        Allow from all
16
+    </Directory>
17
+    
18
+</Virtualhost>

+ 21
- 0
sandbox/deploy/nginx/sandbox.conf 파일 보기

@@ -0,0 +1,21 @@
1
+server {
2
+    listen 80;
3
+    server_name sandbox.oscar.tangentlabs.co.uk;
4
+
5
+    access_log /var/log/nginx/sandbox.oscar.log;
6
+    error_log /var/log/nginx/sandbox.oscar.log;
7
+
8
+    gzip on;
9
+    gzip_proxied any;
10
+    gzip_types text/plain application/json;
11
+
12
+    proxy_pass_request_headers on;
13
+    proxy_set_header Host $host;
14
+    proxy_set_header X-Real-IP $remote_addr;
15
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
16
+    proxy_read_timeout 120;
17
+
18
+    location / {
19
+        proxy_pass http://localhost:81/;
20
+    }
21
+}

+ 21
- 0
sandbox/deploy/wsgi/sandbox.wsgi 파일 보기

@@ -0,0 +1,21 @@
1
+import os
2
+import sys
3
+import site
4
+
5
+sys.stdout = sys.stderr
6
+
7
+# Project root
8
+root = '/var/www/oscar/django-oscar/sandbox/'
9
+sys.path.insert(0, root)
10
+
11
+# Packages from virtualenv
12
+activate_this = '/var/www/oscar/env/bin/activate_this.py'
13
+execfile(activate_this, dict(__file__=activate_this))
14
+
15
+# Set environmental variable for Django and fire WSGI handler 
16
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
17
+import django.core.handlers.wsgi
18
+_application = django.core.handlers.wsgi.WSGIHandler()
19
+
20
+def application(environ, start_response):
21
+    return _application(environ, start_response)

+ 5
- 0
sandbox/settings.py 파일 보기

@@ -245,3 +245,8 @@ OSCAR_ORDER_STATUS_PIPELINE = {
245 245
     'Being processed': ('Processed', 'Cancelled',),
246 246
     'Cancelled': (),
247 247
 }
248
+
249
+try:
250
+    from settings_local import *
251
+except ImportError:
252
+    pass

+ 18
- 0
sandbox/update_build.sh 파일 보기

@@ -0,0 +1,18 @@
1
+#!/usr/bin/env
2
+
3
+cd /var/www/oscar/django-oscar
4
+git pull
5
+
6
+# Update any dependencies
7
+source ../env/bin/activate
8
+python setup.py develop
9
+pip install -r testing-reqs.txt
10
+
11
+# Run any new migrations
12
+cd sandbox
13
+./manage.py syncdb --noinput
14
+./manage.py migrate
15
+./manage.py collectstatic
16
+
17
+# Re-compile python code
18
+touch deploy/wsgi/sandbox.wsgi

Loading…
취소
저장