Browse Source

Merge branch 'master' of /srv/git/h0v1n8-website

root 6 năm trước cách đây
mục cha
commit
c624c535ba
4 tập tin đã thay đổi với 72 bổ sung1 xóa
  1. 17 0
      uwsgi_params
  2. 2 1
      website/website/settings.py
  3. 32 0
      website_nginx.conf
  4. 21 0
      website_uwsgi.ini

+ 17 - 0
uwsgi_params

@@ -0,0 +1,17 @@
+
+uwsgi_param  QUERY_STRING       $query_string;
+uwsgi_param  REQUEST_METHOD     $request_method;
+uwsgi_param  CONTENT_TYPE       $content_type;
+uwsgi_param  CONTENT_LENGTH     $content_length;
+
+uwsgi_param  REQUEST_URI        $request_uri;
+uwsgi_param  PATH_INFO          $document_uri;
+uwsgi_param  DOCUMENT_ROOT      $document_root;
+uwsgi_param  SERVER_PROTOCOL    $server_protocol;
+uwsgi_param  REQUEST_SCHEME     $scheme;
+uwsgi_param  HTTPS              $https if_not_empty;
+
+uwsgi_param  REMOTE_ADDR        $remote_addr;
+uwsgi_param  REMOTE_PORT        $remote_port;
+uwsgi_param  SERVER_PORT        $server_port;
+uwsgi_param SERVER_NAME         $server_name;

+ 2 - 1
website/website/settings.py

@@ -24,7 +24,7 @@ SECRET_KEY = 'f_nxx)y&fw6*u#dd_du6y9&)1$q+a0!y38+6sk151+6)@1kxge'
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = False
 
-ALLOWED_HOSTS = []
+ALLOWED_HOSTS = ['*']
 
 
 # Application definition
@@ -131,6 +131,7 @@ USE_TZ = True
 # https://docs.djangoproject.com/en/2.2/howto/static-files/
 
 STATIC_URL = '/static/'
+STATIC_ROOT = '/srv/www/static/'
 STATICFILES_DIRS = [
     os.path.join(BASE_DIR, "semantic/dist"),
     os.path.join(BASE_DIR, "static"),

+ 32 - 0
website_nginx.conf

@@ -0,0 +1,32 @@
+# Upstream component nginx needs to connect to.
+upstream django {
+    server unix:///opt/h0v1n8-website-env/website/website/webgui.sock; # For production file socket
+    #server 127.0.0.1:8001; # Web port socket for use with uwsgi-hello-world-test.py
+}
+
+# Configuration of the server
+server {
+    # the port your site will be served on
+    listen      80;
+    # the domain name it will serve for
+    server_name _; # substitute your machine's IP address or FQDN
+    charset     utf-8;
+
+    # max upload size
+    client_max_body_size 75M;   # adjust to taste
+
+    # Django media
+    #location /media  {
+    #    alias /path/to/your/mysite/media;  # your Django project's media files - amend as required
+    #}
+
+    location /static {
+        alias /srv/www/static; # your Django project's static files - amend as required
+    }
+
+    # Finally, send all non-media requests to the Django server.
+    location / {
+        uwsgi_pass  django;
+        include     /opt/rotbot-env/uwsgi_params; # the uwsgi_params file you installed
+    }
+}

+ 21 - 0
website_uwsgi.ini

@@ -0,0 +1,21 @@
+[uwsgi]
+binary-path = /opt/h0v1n8-website-env/bin/uwsgi
+# Django-related settings
+# the base directory (full path)
+chdir           = /opt/h0v1n8-website-env/pyRot/webgui
+# Django's wsgi file
+module          = webgui.wsgi
+# the virtualenv (full path)
+home            = /opt/h0v1n8-website-env/
+
+# process-related settings
+# master
+master          = true
+# maximum number of worker processes
+processes       = 10
+# the socket (use the full path to be safe
+socket          = /opt/h0v1n8-env/website/website/webgui.sock
+# ... with appropriate permissions - may be needed
+chmod-socket    = 666
+# clear environment on exit
+vacuum          = true