RS, IZ; A bunch of deploy stuff, including nginx, nginx_conf (maybe), and thin conf
This commit is contained in:
parent
560269ef87
commit
178085b984
8 changed files with 137 additions and 11 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,5 +1,6 @@
|
||||||
.idea
|
.idea
|
||||||
*.swp
|
*.swp
|
||||||
|
*.swo
|
||||||
.bundle
|
.bundle
|
||||||
db/*.sqlite3
|
db/*.sqlite3
|
||||||
log/*.log
|
log/*.log
|
||||||
|
|
|
||||||
39
config/diaspora.conf
Normal file
39
config/diaspora.conf
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
32
config/sprinkle/conf/nginx.conf
Normal file
32
config/sprinkle/conf/nginx.conf
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -7,3 +7,9 @@ package :build_essential do
|
||||||
pre :install, 'apt-get update'
|
pre :install, 'apt-get update'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
package :tools do
|
||||||
|
description 'Useful tools'
|
||||||
|
apt 'psmisc'
|
||||||
|
requires :build_essential
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -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
|
package :mongrel do
|
||||||
description 'Mongrel Application Server'
|
description 'Mongrel Application Server'
|
||||||
gem 'mongrel'
|
gem 'mongrel'
|
||||||
|
|
@ -27,3 +49,4 @@ package :apache_dependencies do
|
||||||
description 'Apache 2 HTTP Server Build Dependencies'
|
description 'Apache 2 HTTP Server Build Dependencies'
|
||||||
apt %w( openssl libtool mawk zlib1g-dev libssl-dev )
|
apt %w( openssl libtool mawk zlib1g-dev libssl-dev )
|
||||||
end
|
end
|
||||||
|
=end
|
||||||
|
|
|
||||||
9
config/sprinkle/packages/unfortunately_essential.rb
Normal file
9
config/sprinkle/packages/unfortunately_essential.rb
Normal file
|
|
@ -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
|
||||||
23
config/sprinkle/provision.rb
Executable file → Normal file
23
config/sprinkle/provision.rb
Executable file → Normal file
|
|
@ -17,11 +17,12 @@
|
||||||
# set of metadata including its installer type (eg. apt, source, gem, etc). Packages can have
|
# set of metadata including its installer type (eg. apt, source, gem, etc). Packages can have
|
||||||
# relationships to each other via dependencies.
|
# relationships to each other via dependencies.
|
||||||
|
|
||||||
require 'packages/essential'
|
require "#{File.dirname(__FILE__)}/packages/essential"
|
||||||
require 'packages/database'
|
require "#{File.dirname(__FILE__)}/packages/database"
|
||||||
require 'packages/server'
|
require "#{File.dirname(__FILE__)}/packages/server"
|
||||||
require 'packages/scm'
|
require "#{File.dirname(__FILE__)}/packages/scm"
|
||||||
require 'packages/rails'
|
require "#{File.dirname(__FILE__)}/packages/ruby"
|
||||||
|
#require "#{File.dirname(__FILE__)}/packages/unfortunately_essential"
|
||||||
|
|
||||||
# Policies
|
# Policies
|
||||||
#
|
#
|
||||||
|
|
@ -33,14 +34,14 @@ require 'packages/rails'
|
||||||
# the user is requested to select which one to use.
|
# the user is requested to select which one to use.
|
||||||
|
|
||||||
policy :diaspora, :roles => :app do
|
policy :diaspora, :roles => :app do
|
||||||
|
# requires :clean_dreamhost
|
||||||
|
# requires :tools
|
||||||
# requires :rubygems
|
# requires :rubygems
|
||||||
# requires :bundler
|
# requires :bundler
|
||||||
requires :diaspora_dependencies
|
# requires :diaspora_dependencies
|
||||||
# requires :diaspora
|
|
||||||
# requires :appserver
|
|
||||||
# requires :database
|
# requires :database
|
||||||
# requires :webserver
|
requires :webserver
|
||||||
# requires :scm
|
requires :scm
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -57,7 +58,7 @@ deployment do
|
||||||
|
|
||||||
# mechanism for deployment
|
# mechanism for deployment
|
||||||
delivery :capistrano do
|
delivery :capistrano do
|
||||||
recipes './../deploy'
|
recipes "#{File.dirname(__FILE__)}/../deploy"
|
||||||
end
|
end
|
||||||
|
|
||||||
# source based package installer defaults
|
# source based package installer defaults
|
||||||
|
|
|
||||||
15
config/thin.yml
Normal file
15
config/thin.yml
Normal file
|
|
@ -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
|
||||||
|
|
||||||
Loading…
Reference in a new issue