Browse Source

Added configuration files for deployment.

Ian Adam Naval 7 years ago
parent
commit
46db2ec2d6
4 changed files with 72 additions and 0 deletions
  1. 40
    0
      conf/nginx.conf
  2. 24
    0
      conf/supervisord.conf
  3. 2
    0
      requirements.txt
  4. 6
    0
      src/ianonavy.fcgi

+ 40
- 0
conf/nginx.conf View File

@@ -0,0 +1,40 @@
1
+server {
2
+    listen 80;
3
+    listen 443 default_server ssl;
4
+
5
+    ssl_certificate /var/sites/ianonavy.com/ssl/unified.crt;
6
+    ssl_certificate_key /var/sites/ianonavy.com/ssl/ssl-decrypted.key;
7
+
8
+    server_name *.ianonavy.com ianonavy.com www.ianonavy.com;
9
+
10
+    access_log /var/log/nginx/ianonavy.access.log;
11
+    error_log /var/log/nginx/ianonavy.error.log;
12
+
13
+    if ($host != 'ianonavy.com') {
14
+         rewrite  ^/(.*)$  http://ianonavy.com/$1  permanent;
15
+    }
16
+
17
+    root /var/sites/ianonavy.com/www;
18
+
19
+    location = /robots.txt {
20
+        alias /var/www/robots/all/robots.txt;
21
+    }
22
+ 
23
+    location /static/ { # STATIC_URL
24
+        alias /var/sites/ianonavy.com/www/src/static/; # STATIC_ROOT
25
+        expires off;
26
+    }
27
+
28
+    location = /google9677fb7678857b96.html {
29
+        rewrite ^/(.*) $1;
30
+        return 200 "google-site-verification: google9677fb7678857b96.html";
31
+    }
32
+
33
+    location / { try_files $uri @ianonavy; }
34
+    location @ianonavy {
35
+        include fastcgi_params;
36
+        fastcgi_param PATH_INFO $fastcgi_script_name;
37
+        fastcgi_param SCRIPT_NAME "";
38
+        fastcgi_pass unix:/tmp/ianonavy-fcgi.sock;
39
+    }
40
+}

+ 24
- 0
conf/supervisord.conf View File

@@ -0,0 +1,24 @@
1
+[fcgi-program:ianonavy]
2
+command=/var/sites/ianonavy.com/www/src/ianonavy.fcgi
3
+socket=unix:///tmp/ianonavy-fcgi.sock
4
+process_name=%(program_name)s_%(process_num)02d
5
+directory=/var/sites/ianonavy.com/www/src
6
+environment=PATH="/var/sites/ianonavy.com/www/bin"
7
+numprocs=5
8
+priority=999
9
+autostart=true
10
+autorestart=true
11
+startsecs=1
12
+startretries=3
13
+exitcodes=0,2
14
+stopsignal=QUIT
15
+stopwaitsecs=10
16
+user=app
17
+redirect_stderr=true
18
+stdout_logfile=/tmp/ianonavy.log
19
+stdout_logfile_maxbytes=1MB
20
+stdout_logfile_backups=10
21
+stderr_logfile=/tmp/ianonavy_err.log
22
+stderr_logfile_maxbytes=1MB
23
+stderr_logfile_backups=10
24
+

+ 2
- 0
requirements.txt View File

@@ -0,0 +1,2 @@
1
+Flask
2
+flup

+ 6
- 0
src/ianonavy.fcgi View File

@@ -0,0 +1,6 @@
1
+#!/usr/bin/env python
2
+from flup.server.fcgi import WSGIServer
3
+from server import app
4
+
5
+if __name__ == '__main__':
6
+    WSGIServer(app, bindAddress='/tmp/ianonavy-fcgi.sock', umask=0002).run()

Loading…
Cancel
Save