Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RS, IZ; A bunch of deploy stuff, including nginx, nginx_conf (maybe),…

… and thin conf
  • Loading branch information...
commit 178085b984b54b29df8b2453ec8dfdc71ba4e248 1 parent 560269e
Raphael Sofaer authored
View
1  .gitignore
@@ -1,5 +1,6 @@
.idea
*.swp
+*.swo
.bundle
db/*.sqlite3
log/*.log
View
39 config/diaspora.conf
@@ -0,0 +1,39 @@
+upstream thin_cluster {
+ server unix:/tmp/thin.0.sock;
+ server unix:/tmp/thin.1.sock;
+ server unix:/tmp/thin.2.sock;
+ server unix:/tmp/thin.3.sock;
+}
+
+server {
+
+ listen 80;
+ server_name localhash.com www.localhash.com;
+ root /opt/applications/example;
+
+ location / {
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $http_host;
+ proxy_redirect off;
+ proxy_buffering off;
+
+ if (-f $request_filename/index.html) {
+ rewrite (.*) $1/index.html break;
+ }
+ if (-f $request_filename.html) {
+ rewrite (.*) $1.html break;
+ }
+ if (!-f $request_filename) {
+ proxy_pass http://thin_cluster;
+ break;
+ }
+ }
+
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+ root html;
+ }
+
+}
+
View
32 config/sprinkle/conf/nginx.conf
@@ -0,0 +1,32 @@
+
+worker_processes 4;
+pid /opt/nginx/sbin/nginx.pid;
+
+events {
+ worker_connections 8192;
+}
+
+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"';
+
+ sendfile on;
+
+ keepalive_timeout 65;
+
+ gzip on;
+ gzip_http_version 1.0;
+ gzip_comp_level 2;
+ gzip_proxied any;
+ gzip_buffers 16 8k;
+ #gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
+ # gzip_disable "MSIE [1-6]\.(?!.*SV1)";
+
+ include /usr/local/sbin/conf/servers/*.conf;
+}
+
View
6 config/sprinkle/packages/essential.rb
@@ -7,3 +7,9 @@
pre :install, 'apt-get update'
end
end
+
+package :tools do
+ description 'Useful tools'
+ apt 'psmisc'
+ requires :build_essential
+end
View
23 config/sprinkle/packages/server.rb
@@ -1,3 +1,25 @@
+package :nginx do
+ description 'Nginx HTTP server'
+ version '0.7.67'
+ source "http://nginx.org/download/nginx-#{version}.tar.gz"
+ requires :nginx_dependencies
+end
+
+package :nginx_conf, :provides=> :webserver do
+ description 'Nginx conf file'
+ transfer "#{File.dirname(__FILE__)}/../conf/nginx.conf", '/usr/local/sbin/conf/nginx.conf', :render => true do
+ pre :install, "mkdir -p /usr/local/sbin/conf/"
+ end
+ requires :nginx
+end
+
+package :nginx_dependencies do
+ description 'Nginx build dependencies'
+ apt %w( libc6 libpcre3 libpcre3-dev libssl0.9.8)
+ source "http://zlib.net/zlib-1.2.5.tar.gz"
+end
+
+=begin
package :mongrel do
description 'Mongrel Application Server'
gem 'mongrel'
@@ -27,3 +49,4 @@
description 'Apache 2 HTTP Server Build Dependencies'
apt %w( openssl libtool mawk zlib1g-dev libssl-dev )
end
+=end
View
9 config/sprinkle/packages/unfortunately_essential.rb
@@ -0,0 +1,9 @@
+#Fix dreamhost
+#
+
+package :clean_dreamhost do
+ description 'removes roadblocks in the standard DH PS image'
+ run 'apt-get -fy install'
+ run 'apt-get -y remove ruby'
+ run 'apt-get -y remove ruby1.8 --purge'
+end
View
23 config/sprinkle/provision.rb 100755 → 100644
@@ -17,11 +17,12 @@
# set of metadata including its installer type (eg. apt, source, gem, etc). Packages can have
# relationships to each other via dependencies.
-require 'packages/essential'
-require 'packages/database'
-require 'packages/server'
-require 'packages/scm'
-require 'packages/rails'
+require "#{File.dirname(__FILE__)}/packages/essential"
+require "#{File.dirname(__FILE__)}/packages/database"
+require "#{File.dirname(__FILE__)}/packages/server"
+require "#{File.dirname(__FILE__)}/packages/scm"
+require "#{File.dirname(__FILE__)}/packages/ruby"
+#require "#{File.dirname(__FILE__)}/packages/unfortunately_essential"
# Policies
#
@@ -33,14 +34,14 @@
# the user is requested to select which one to use.
policy :diaspora, :roles => :app do
+# requires :clean_dreamhost
+# requires :tools
# requires :rubygems
# requires :bundler
- requires :diaspora_dependencies
-# requires :diaspora
-# requires :appserver
+# requires :diaspora_dependencies
# requires :database
-# requires :webserver
-# requires :scm
+ requires :webserver
+ requires :scm
end
@@ -57,7 +58,7 @@
# mechanism for deployment
delivery :capistrano do
- recipes './../deploy'
+ recipes "#{File.dirname(__FILE__)}/../deploy"
end
# source based package installer defaults
View
15 config/thin.yml
@@ -0,0 +1,15 @@
+#rackup: /opt/applications/localhash/current/config.ru
+#pid: /tmp/pids/thin.pid
+wait: 30
+timeout: 600
+#log: /var/log/thin
+#max_conns: 1024
+#require: []
+
+#max_persistent_conns: 512
+environment: production
+#servers: 4
+daemonize: true
+#chdir: /usr/applications/localhash/current
+socket: /tmp/thin.sock
+
Please sign in to comment.
Something went wrong with that request. Please try again.