Skip to content
This repository has been archived by the owner on Apr 25, 2018. It is now read-only.

Commit

Permalink
Adding in nginx configuration, del.icio.us configuration, and Thin se…
Browse files Browse the repository at this point in the history
…ttings.
  • Loading branch information
mikewest committed Nov 1, 2008
1 parent cf2115b commit d0c34aa
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Rakefile
Expand Up @@ -6,6 +6,10 @@ ROOT_DIR = File.expand_path(File.dirname(__FILE__))
DATA_ROOT = ROOT_DIR + '/data' DATA_ROOT = ROOT_DIR + '/data'
ARTICLE_ROOT = DATA_ROOT + '/articles' ARTICLE_ROOT = DATA_ROOT + '/articles'
EXTERNALS_ROOT = DATA_ROOT + '/externals' EXTERNALS_ROOT = DATA_ROOT + '/externals'

THIN_INSTANCES = 3
THIN_SOCKETS = '/tmp/thin.sock'

# #
# Cache Tasks # Cache Tasks
# #
Expand Down Expand Up @@ -87,12 +91,12 @@ EXTERNALS_ROOT = DATA_ROOT + '/externals'
desc 'Reset Thin server' desc 'Reset Thin server'
task :restart_thin => [:remove_logs] do task :restart_thin => [:remove_logs] do
sh 'killall thin;' sh 'killall thin;'
sh "thin start -R #{ROOT_DIR}/rackup.ru -s1 --socket /tmp/thin.sock;" sh "thin start -R #{ROOT_DIR}/rackup.ru -s#{THIN_INSTANCES} --socket #{THIN_SOCKETS};"
end end


desc 'Remove Thin logs' desc 'Remove Thin logs'
task :remove_logs do task :remove_logs do
sh 'rm ./log/thin.0.log;' sh 'rm ./log/thin.*.log;'
end end


task :rethin => [:restart_thin, :remove_logs] task :rethin => [:restart_thin, :remove_logs]
Expand All @@ -102,7 +106,7 @@ EXTERNALS_ROOT = DATA_ROOT + '/externals'
# #
desc 'Dump the log' desc 'Dump the log'
task :log do task :log do
sh 'cat ./log/thin.0.log' sh 'cat ./log/thin.*.log'
end end


# #
Expand Down
9 changes: 9 additions & 0 deletions fallow.conf.example
@@ -0,0 +1,9 @@
##############################################################################
# Fallow Configuration
# ====================

module Fallow
class Bookmarks
@@auth = [ 'your_del.icio.us_username', 'your_del.icio.us_password']
end
end
91 changes: 91 additions & 0 deletions nginx.conf.example
@@ -0,0 +1,91 @@
user www-data www-data;
worker_processes 4;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile on;
keepalive_timeout 65;

# These are (apparently) good default values.
tcp_nopush on;
tcp_nodelay off;

# output compression saves bandwidth
gzip on;
gzip_static on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/png;

include /usr/local/nginx/sites-enabled/*;
}

upstream example-com {
server unix:/tmp/thin.0.sock;
}

#
# Who uses "www" anymore? No one, that's who.
#
server {
listen 80;
server_name www.example.com;
rewrite ^/(.*) http://example.com/$1 permanent;
}

#
# Static server: max expiration, your own (much slower, and not edge-cached) akamai.
#
server {
listen 80;
server_name static.example.com;

root /home/user/public_html/example.com/public/static/;

location / {
if (-f $request_filename) {
expires max;
break;
}
}
}

#
#
#
server {
listen 80;
server_name example.com;

access_log /home/user/public_html/example.com/log/access.log;
error_log /home/user/public_html/example.com/log/error.log;

root /home/user/public_html/example.com/public/;
index index.html;


location / {
rewrite ^/favicon.ico http://static.example.com/favicon.ico permanent;

if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}

if (!-f $request_filename) {
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 false;

proxy_pass http://example-com;
break;
}
}
}

0 comments on commit d0c34aa

Please sign in to comment.