Commits

Anonymous committed d7d20b3

Changes to conf

  • Participants
  • Parent commits 81b119e

Comments (0)

Files changed (5)

File conf/nginx.conf

-daemon off;
-#user  nobody;
-worker_processes  1;
-
-#error_log  logs/error.log;
-#error_log  logs/error.log  notice;
-#error_log  logs/error.log  info;
-
-#pid        logs/nginx.pid;
-
-
-events {
-    worker_connections  1024;
-}
-
-
-http {
-    include       mime.types;
-    default_type  application/octet-stream;
-
-    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
-    #                  '$status $body_bytes_sent "$http_referer" '
-    #                  '"$http_user_agent" "$http_x_forwarded_for"';
-
-    #access_log  logs/access.log  main;
-
-    sendfile        on;
-    #tcp_nopush     on;
-
-    #keepalive_timeout  0;
-    keepalive_timeout  65;
-
-    #gzip  on;
-
-    server {
-        listen       11826;
-        server_name  rentalerts.danjac354.webfactional.com;
-
-        #charset koi8-r;
-
-        #access_log  logs/host.access.log  main;
-
-
-        #location /static/ {
-        #    root /home/danjac354/webapps/static;
-        #}
-
-
-        location / {
-            root html;
-            index index.html index.htm;
-            auth_basic "Restricted";
-            auth_basic_user_file /home/danjac354/.htpasswd;
-            proxy_pass_header Server;
-            proxy_set_header Host $http_host;
-            proxy_redirect off;
-            proxy_set_header X-Real-IP $remote_addr;
-            proxy_set_header X-Scheme $scheme;
-            proxy_connect_timeout 10;
-            proxy_read_timeout 10;
-            proxy_pass http://127.0.0.1:53369;
-        }
-
-        #error_page  404              /404.html;
-
-        # redirect server error pages to the static page /50x.html
-        #
-        error_page   500 502 503 504  /50x.html;
-        location = /50x.html {
-        }
-
-        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
-        #
-        #location ~ \.php$ {
-        #    proxy_pass   http://127.0.0.1;
-        #}
-
-        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
-        #
-        #location ~ \.php$ {
-        #    root           html;
-        #    fastcgi_pass   127.0.0.1:9000;
-        #    fastcgi_index  index.php;
-        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
-        #    include        fastcgi_params;
-        #}
-
-        # deny access to .htaccess files, if Apache's document root
-        # concurs with nginx's one
-        #
-        #location ~ /\.ht {
-        #    deny  all;
-        #}
-    }
-
-
-    # another virtual host using mix of IP-, name-, and port-based configuration
-    #
-    #server {
-    #    listen       8000;
-    #    listen       somename:8080;
-    #    server_name  somename  alias  another.alias;
-
-    #    location / {
-    #        root   html;
-    #        index  index.html index.htm;
-    #    }
-    #}
-
-
-    # HTTPS server
-    #
-    #server {
-    #    listen       443;
-    #    server_name  localhost;
-
-    #    ssl                  on;
-    #    ssl_certificate      cert.pem;
-    #    ssl_certificate_key  cert.key;
-
-    #    ssl_session_timeout  5m;
-
-    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
-    #    ssl_ciphers  HIGH:!aNULL:!MD5;
-    #    ssl_prefer_server_ciphers   on;
-
-    #    location / {
-    #        root   html;
-    #        index  index.html index.htm;
-    #    }
-    #}
-
-}

File conf/production/nginx.conf

+daemon off;
+#user  nobody;
+worker_processes  1;
+
+#error_log  logs/error.log;
+#error_log  logs/error.log  notice;
+#error_log  logs/error.log  info;
+
+#pid        logs/nginx.pid;
+
+
+events {
+    worker_connections  1024;
+}
+
+
+http {
+    include       mime.types;
+    default_type  application/octet-stream;
+
+    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+    #                  '$status $body_bytes_sent "$http_referer" '
+    #                  '"$http_user_agent" "$http_x_forwarded_for"';
+
+    #access_log  logs/access.log  main;
+
+    sendfile        on;
+    #tcp_nopush     on;
+
+    #keepalive_timeout  0;
+    keepalive_timeout  65;
+
+    #gzip  on;
+
+    server {
+        listen       11826;
+        server_name  rentalerts.danjac354.webfactional.com;
+
+        #charset koi8-r;
+
+        #access_log  logs/host.access.log  main;
+
+
+        #location /static/ {
+        #    root /home/danjac354/webapps/static;
+        #}
+
+
+        location / {
+            root html;
+            index index.html index.htm;
+            auth_basic "Restricted";
+            auth_basic_user_file /home/danjac354/.htpasswd;
+            proxy_pass_header Server;
+            proxy_set_header Host $http_host;
+            proxy_redirect off;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header X-Scheme $scheme;
+            proxy_connect_timeout 10;
+            proxy_read_timeout 10;
+            proxy_pass http://127.0.0.1:53369;
+        }
+
+        #error_page  404              /404.html;
+
+        # redirect server error pages to the static page /50x.html
+        #
+        error_page   500 502 503 504  /50x.html;
+        location = /50x.html {
+        }
+
+        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+        #
+        #location ~ \.php$ {
+        #    proxy_pass   http://127.0.0.1;
+        #}
+
+        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+        #
+        #location ~ \.php$ {
+        #    root           html;
+        #    fastcgi_pass   127.0.0.1:9000;
+        #    fastcgi_index  index.php;
+        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
+        #    include        fastcgi_params;
+        #}
+
+        # deny access to .htaccess files, if Apache's document root
+        # concurs with nginx's one
+        #
+        #location ~ /\.ht {
+        #    deny  all;
+        #}
+    }
+
+
+    # another virtual host using mix of IP-, name-, and port-based configuration
+    #
+    #server {
+    #    listen       8000;
+    #    listen       somename:8080;
+    #    server_name  somename  alias  another.alias;
+
+    #    location / {
+    #        root   html;
+    #        index  index.html index.htm;
+    #    }
+    #}
+
+
+    # HTTPS server
+    #
+    #server {
+    #    listen       443;
+    #    server_name  localhost;
+
+    #    ssl                  on;
+    #    ssl_certificate      cert.pem;
+    #    ssl_certificate_key  cert.key;
+
+    #    ssl_session_timeout  5m;
+
+    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
+    #    ssl_ciphers  HIGH:!aNULL:!MD5;
+    #    ssl_prefer_server_ciphers   on;
+
+    #    location / {
+    #        root   html;
+    #        index  index.html index.htm;
+    #    }
+    #}
+
+}

File conf/production/supervisord.conf

+; Webfaction supervisor config file.
+ 
+[inet_http_server]                         ; inet (TCP) server setings
+port=127.0.0.1:25863                    ; (ip_address:port specifier, *:port for all iface)
+username=danjac                        ; (default is no username (open server))
+password=m0nk3Y                           ; (default is no password (open server))
+
+[supervisord]
+logfile=/home/danjac354/logs/user/supervisor/supervisord.log       ; (main log file;default $CWD/supervisord.log)
+logfile_maxbytes=50MB                             ; (max main logfile bytes b4 rotation;default 50MB)
+logfile_backups=10                                ; (num of main logfile rotation backups;default 10)
+loglevel=debug                                    ; (log level;default info; others: debug,warn,trace)
+pidfile=/home/danjac354/supervisord.pid                                ; (supervisord pidfile;default supervisord.pid)
+nodaemon=false                                    ; (start in foreground if true;default false)
+minfds=1024                                       ; (min. avail startup file descriptors;default 1024)
+minprocs=200                                      ; (min. avail process descriptors;default 200)
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
+
+[supervisorctl]
+serverurl=http://127.0.0.1:25863
+username=danjac
+password=m0nk3Y
+
+[program:nginx]
+directory=/home/danjac354/webapps/nginx
+command=sbin/nginx 
+user=danjac354
+autostart=true
+autorestart=true
+logfile=/home/danjac354/logs/user/supervisor/nginx.log
+redirect_stderr=true
+
+[program:rentalerts]
+directory=/home/danjac354/webapps/rentalerts/rentalerts
+command=/home/danjac354/.virtualenvs/rentalerts/bin/python2.7 /home/danjac354/webapps/rentalerts/rentalerts/bin/production run_gunicorn -b 127.0.0.1:53369 -w 4
+user=danjac354
+autostart=true
+autorestart=true
+logfile=/home/danjac354/logs/user/supervisor/rentalerts.log
+redirect_stderr=true
+

File conf/supervisord.conf

-; Webfaction supervisor config file.
- 
-[inet_http_server]                         ; inet (TCP) server setings
-port=127.0.0.1:25863                    ; (ip_address:port specifier, *:port for all iface)
-username=danjac                        ; (default is no username (open server))
-password=m0nk3Y                           ; (default is no password (open server))
-
-[supervisord]
-logfile=/home/danjac354/logs/user/supervisor/supervisord.log       ; (main log file;default $CWD/supervisord.log)
-logfile_maxbytes=50MB                             ; (max main logfile bytes b4 rotation;default 50MB)
-logfile_backups=10                                ; (num of main logfile rotation backups;default 10)
-loglevel=debug                                    ; (log level;default info; others: debug,warn,trace)
-pidfile=/home/danjac354/supervisord.pid                                ; (supervisord pidfile;default supervisord.pid)
-nodaemon=false                                    ; (start in foreground if true;default false)
-minfds=1024                                       ; (min. avail startup file descriptors;default 1024)
-minprocs=200                                      ; (min. avail process descriptors;default 200)
-
-[rpcinterface:supervisor]
-supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
-
-[supervisorctl]
-serverurl=http://127.0.0.1:25863
-username=danjac
-password=m0nk3Y
-
-[program:nginx]
-directory=/home/danjac354/webapps/nginx
-command=sbin/nginx 
-user=danjac354
-autostart=true
-autorestart=true
-logfile=/home/danjac354/logs/user/supervisor/nginx.log
-redirect_stderr=true
-
-[program:rentalerts]
-directory=/home/danjac354/webapps/rentalerts/rentalerts
-command=/home/danjac354/.virtualenvs/rentalerts/bin/python2.7 /home/danjac354/webapps/rentalerts/rentalerts/bin/production run_gunicorn -b 127.0.0.1:53369 -w 4
-user=danjac354
-autostart=true
-autorestart=true
-logfile=/home/danjac354/logs/user/supervisor/rentalerts.log
-redirect_stderr=true
-
     python_exec = "python"
     dir = None
     nginx_dir = None
+    conf_dir = "conf"
 
     def run(self, command):
         with api.cd(self.dir):
         self.run("pip install -r requirements.txt")
 
     def supervisor(self, app_name, action):
-        cmd = "supervisorctl -c conf/supervisord.conf %s %s"
-        self.run(cmd % (action, app_name))
+        cmd = "supervisorctl -c %s/supervisord.conf %s %s"
+        self.run(cmd % (action, self.conf_dir, app_name))
 
     def copy_nginx_conf(self):
         print "Copying nginx files..."
-        self.run("cp %s/conf/nginx.conf %s/conf/nginx.conf" % (
-            self.dir, self.nginx_dir))
+        self.run("cp %s/nginx.conf %s/conf/nginx.conf" % (
+            self.conf_dir,
+            self.dir, 
+            self.nginx_dir))
 
     def nginx_start(self):
         self.copy_nginx_conf()
     
     server.dir = "/home/danjac354/webapps/rentalerts/rentalerts"
     server.nginx_dir = "/home/danjac354/webapps/nginx"
+    server.conf_dir = "%s/conf/production" % server.dir
     server.python_exec = "/home/danjac354/.virtualenvs/rentalerts/bin/python2.7"
     server.manager = "%s ./bin/production" % server.python_exec