brendan-skynet 0.9.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/History.txt +152 -0
  2. data/License.txt +20 -0
  3. data/Manifest.txt +144 -0
  4. data/README.txt +178 -0
  5. data/Rakefile +4 -0
  6. data/app_generators/skynet_install/USAGE +5 -0
  7. data/app_generators/skynet_install/skynet_install_generator.rb +94 -0
  8. data/app_generators/skynet_install/templates/migration.rb +43 -0
  9. data/app_generators/skynet_install/templates/skynet_config.rb +54 -0
  10. data/app_generators/skynet_install/templates/skynet_initializer.rb +1 -0
  11. data/app_generators/skynet_install/templates/skynet_mysql_schema.sql +33 -0
  12. data/bin/skynet +71 -0
  13. data/bin/skynet_install +36 -0
  14. data/bin/skynet_tuplespace_server +74 -0
  15. data/config/hoe.rb +75 -0
  16. data/config/requirements.rb +17 -0
  17. data/examples/dgrep/README +70 -0
  18. data/examples/dgrep/config/skynet_config.rb +26 -0
  19. data/examples/dgrep/data/shakespeare/README +2 -0
  20. data/examples/dgrep/data/shakespeare/poetry/loverscomplaint +381 -0
  21. data/examples/dgrep/data/shakespeare/poetry/rapeoflucrece +2199 -0
  22. data/examples/dgrep/data/shakespeare/poetry/sonnets +2633 -0
  23. data/examples/dgrep/data/shakespeare/poetry/various +640 -0
  24. data/examples/dgrep/data/shakespeare/poetry/venusandadonis +1423 -0
  25. data/examples/dgrep/data/testfile1.txt +1 -0
  26. data/examples/dgrep/data/testfile2.txt +1 -0
  27. data/examples/dgrep/data/testfile3.txt +1 -0
  28. data/examples/dgrep/data/testfile4.txt +1 -0
  29. data/examples/dgrep/lib/dgrep.rb +59 -0
  30. data/examples/dgrep/lib/mapreduce_test.rb +32 -0
  31. data/examples/dgrep/lib/most_common_words.rb +45 -0
  32. data/examples/dgrep/script/dgrep +75 -0
  33. data/examples/rails_mysql_example/README +66 -0
  34. data/examples/rails_mysql_example/Rakefile +10 -0
  35. data/examples/rails_mysql_example/app/controllers/application.rb +10 -0
  36. data/examples/rails_mysql_example/app/helpers/application_helper.rb +3 -0
  37. data/examples/rails_mysql_example/app/models/user.rb +21 -0
  38. data/examples/rails_mysql_example/app/models/user_favorite.rb +5 -0
  39. data/examples/rails_mysql_example/app/models/user_mailer.rb +12 -0
  40. data/examples/rails_mysql_example/app/views/user_mailer/welcome.erb +5 -0
  41. data/examples/rails_mysql_example/config/boot.rb +109 -0
  42. data/examples/rails_mysql_example/config/database.yml +42 -0
  43. data/examples/rails_mysql_example/config/environment.rb +59 -0
  44. data/examples/rails_mysql_example/config/environments/development.rb +18 -0
  45. data/examples/rails_mysql_example/config/environments/production.rb +19 -0
  46. data/examples/rails_mysql_example/config/environments/test.rb +22 -0
  47. data/examples/rails_mysql_example/config/initializers/inflections.rb +10 -0
  48. data/examples/rails_mysql_example/config/initializers/mime_types.rb +5 -0
  49. data/examples/rails_mysql_example/config/initializers/skynet.rb +1 -0
  50. data/examples/rails_mysql_example/config/routes.rb +35 -0
  51. data/examples/rails_mysql_example/config/skynet_config.rb +36 -0
  52. data/examples/rails_mysql_example/db/migrate/001_create_skynet_tables.rb +43 -0
  53. data/examples/rails_mysql_example/db/migrate/002_create_users.rb +16 -0
  54. data/examples/rails_mysql_example/db/migrate/003_create_user_favorites.rb +14 -0
  55. data/examples/rails_mysql_example/db/schema.rb +85 -0
  56. data/examples/rails_mysql_example/db/skynet_mysql_schema.sql +33 -0
  57. data/examples/rails_mysql_example/doc/README_FOR_APP +2 -0
  58. data/examples/rails_mysql_example/lib/tasks/rails_mysql_example.rake +20 -0
  59. data/examples/rails_mysql_example/public/.htaccess +40 -0
  60. data/examples/rails_mysql_example/public/404.html +30 -0
  61. data/examples/rails_mysql_example/public/422.html +30 -0
  62. data/examples/rails_mysql_example/public/500.html +30 -0
  63. data/examples/rails_mysql_example/public/dispatch.cgi +10 -0
  64. data/examples/rails_mysql_example/public/dispatch.fcgi +24 -0
  65. data/examples/rails_mysql_example/public/dispatch.rb +10 -0
  66. data/examples/rails_mysql_example/public/favicon.ico +0 -0
  67. data/examples/rails_mysql_example/public/images/rails.png +0 -0
  68. data/examples/rails_mysql_example/public/index.html +277 -0
  69. data/examples/rails_mysql_example/public/javascripts/application.js +2 -0
  70. data/examples/rails_mysql_example/public/javascripts/controls.js +963 -0
  71. data/examples/rails_mysql_example/public/javascripts/dragdrop.js +972 -0
  72. data/examples/rails_mysql_example/public/javascripts/effects.js +1120 -0
  73. data/examples/rails_mysql_example/public/javascripts/prototype.js +4225 -0
  74. data/examples/rails_mysql_example/public/robots.txt +5 -0
  75. data/examples/rails_mysql_example/script/about +3 -0
  76. data/examples/rails_mysql_example/script/console +3 -0
  77. data/examples/rails_mysql_example/script/destroy +3 -0
  78. data/examples/rails_mysql_example/script/generate +3 -0
  79. data/examples/rails_mysql_example/script/performance/benchmarker +3 -0
  80. data/examples/rails_mysql_example/script/performance/profiler +3 -0
  81. data/examples/rails_mysql_example/script/performance/request +3 -0
  82. data/examples/rails_mysql_example/script/plugin +3 -0
  83. data/examples/rails_mysql_example/script/process/inspector +3 -0
  84. data/examples/rails_mysql_example/script/process/reaper +3 -0
  85. data/examples/rails_mysql_example/script/process/spawner +3 -0
  86. data/examples/rails_mysql_example/script/runner +3 -0
  87. data/examples/rails_mysql_example/script/server +3 -0
  88. data/examples/rails_mysql_example/test/fixtures/user_favorites.yml +9 -0
  89. data/examples/rails_mysql_example/test/fixtures/users.yml +11 -0
  90. data/examples/rails_mysql_example/test/test_helper.rb +38 -0
  91. data/examples/rails_mysql_example/test/unit/user_favorite_test.rb +8 -0
  92. data/examples/rails_mysql_example/test/unit/user_test.rb +8 -0
  93. data/extras/README +7 -0
  94. data/extras/init.d/skynet +87 -0
  95. data/extras/nagios/check_skynet.sh +121 -0
  96. data/extras/rails/controllers/skynet_controller.rb +43 -0
  97. data/extras/rails/views/skynet/index.rhtml +137 -0
  98. data/lib/skynet/mapreduce_helper.rb +74 -0
  99. data/lib/skynet/mapreduce_test.rb +56 -0
  100. data/lib/skynet/message_queue_adapters/message_queue_adapter.rb +70 -0
  101. data/lib/skynet/message_queue_adapters/mysql.rb +509 -0
  102. data/lib/skynet/message_queue_adapters/tuple_space.rb +316 -0
  103. data/lib/skynet/skynet_active_record_extensions.rb +293 -0
  104. data/lib/skynet/skynet_config.rb +232 -0
  105. data/lib/skynet/skynet_console.rb +50 -0
  106. data/lib/skynet/skynet_console_helper.rb +66 -0
  107. data/lib/skynet/skynet_debugger.rb +138 -0
  108. data/lib/skynet/skynet_guid_generator.rb +68 -0
  109. data/lib/skynet/skynet_job.rb +892 -0
  110. data/lib/skynet/skynet_launcher.rb +40 -0
  111. data/lib/skynet/skynet_logger.rb +62 -0
  112. data/lib/skynet/skynet_manager.rb +706 -0
  113. data/lib/skynet/skynet_message.rb +359 -0
  114. data/lib/skynet/skynet_message_queue.rb +136 -0
  115. data/lib/skynet/skynet_partitioners.rb +96 -0
  116. data/lib/skynet/skynet_ruby_extensions.rb +53 -0
  117. data/lib/skynet/skynet_task.rb +118 -0
  118. data/lib/skynet/skynet_tuplespace_server.rb +83 -0
  119. data/lib/skynet/skynet_worker.rb +451 -0
  120. data/lib/skynet/version.rb +9 -0
  121. data/lib/skynet.rb +83 -0
  122. data/script/destroy +14 -0
  123. data/script/generate +14 -0
  124. data/script/txt2html +74 -0
  125. data/setup.rb +1585 -0
  126. data/tasks/deployment.rake +34 -0
  127. data/tasks/environment.rake +7 -0
  128. data/tasks/website.rake +17 -0
  129. data/test/test_active_record_extensions.rb +138 -0
  130. data/test/test_generator_helper.rb +20 -0
  131. data/test/test_helper.rb +10 -0
  132. data/test/test_mysql_message_queue_adapter.rb +263 -0
  133. data/test/test_skynet.rb +19 -0
  134. data/test/test_skynet_install_generator.rb +49 -0
  135. data/test/test_skynet_job.rb +717 -0
  136. data/test/test_skynet_manager.rb +157 -0
  137. data/test/test_skynet_message.rb +229 -0
  138. data/test/test_skynet_task.rb +24 -0
  139. data/test/test_tuplespace_message_queue.rb +174 -0
  140. data/website/index.html +181 -0
  141. data/website/index.txt +98 -0
  142. data/website/javascripts/rounded_corners_lite.inc.js +285 -0
  143. data/website/stylesheets/screen.css +138 -0
  144. data/website/template.rhtml +48 -0
  145. metadata +236 -0
@@ -0,0 +1,35 @@
1
+ ActionController::Routing::Routes.draw do |map|
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+
4
+ # Sample of regular route:
5
+ # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
6
+ # Keep in mind you can assign values other than :controller and :action
7
+
8
+ # Sample of named route:
9
+ # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
10
+ # This route can be invoked with purchase_url(:id => product.id)
11
+
12
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
13
+ # map.resources :products
14
+
15
+ # Sample resource route with options:
16
+ # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
17
+
18
+ # Sample resource route with sub-resources:
19
+ # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
20
+
21
+ # Sample resource route within a namespace:
22
+ # map.namespace :admin do |admin|
23
+ # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
24
+ # admin.resources :products
25
+ # end
26
+
27
+ # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
28
+ # map.root :controller => "welcome"
29
+
30
+ # See how all your routes lay out with "rake routes"
31
+
32
+ # Install the default routes as the lowest priority.
33
+ map.connect ':controller/:action/:id'
34
+ map.connect ':controller/:action/:id.:format'
35
+ end
@@ -0,0 +1,36 @@
1
+ # Skynet Configuration File. Should be in APP_ROOT/config/skynet_config.rb
2
+ # Start skynet from within your app root with
3
+ # > skynet start
4
+
5
+ require 'rubygems'
6
+ require 'skynet'
7
+
8
+ # Load your rails app
9
+ if not defined?(RAILS_GEM_VERSION)
10
+ require File.expand_path(File.dirname(__FILE__)) + '/../config/environment'
11
+ end
12
+
13
+ Skynet::CONFIG[:SKYNET_LOG_LEVEL] = Logger::ERROR
14
+ Skynet::CONFIG[:APP_ROOT] = RAILS_ROOT
15
+ Skynet::CONFIG[:SKYNET_LOG_DIR] = File.expand_path(Skynet::CONFIG[:APP_ROOT]+ "/log")
16
+ Skynet::CONFIG[:SKYNET_PID_DIR] = File.expand_path(Skynet::CONFIG[:APP_ROOT] + "/log")
17
+ Skynet::CONFIG[:SKYNET_LOG_FILE] = "skynet_#{RAILS_ENV}.log"
18
+ Skynet::CONFIG[:SKYNET_PID_FILE] = "skynet_#{RAILS_ENV}.pid"
19
+
20
+
21
+ # Use the mysql message queue adapter
22
+ Skynet::CONFIG[:MESSAGE_QUEUE_ADAPTER] = "Skynet::MessageQueueAdapter::Mysql"
23
+
24
+ # ==================================================================
25
+ # = Require any other libraries you want skynet to know about here =
26
+ # ==================================================================
27
+
28
+
29
+ # ===========================================
30
+ # = Set your own configuration options here =
31
+ # ===========================================
32
+ # You can also configure skynet with
33
+ # Skynet.configure(:SOME_CONFIG_OPTION => true, :SOME_OTHER_CONFIG => 3)
34
+
35
+ Skynet::CONFIG[:SKYNET_LOG_LEVEL] = Logger::INFO
36
+ Skynet::CONFIG[:TS_USE_RINGSERVER] = false
@@ -0,0 +1,43 @@
1
+ class CreateSkynetTables < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :skynet_message_queues do |t|
4
+ t.column :id, "bigint unsigned primary key"
5
+ t.column :queue_id, :integer, :default => 0
6
+ t.column :tran_id, "bigint unsigned"
7
+ t.column :created_on, :timestamp
8
+ t.column :updated_on, :timestamp
9
+ t.column :tasktype, :string
10
+ t.column :task_id, 'bigint unsigned'
11
+ t.column :job_id, 'bigint unsigned'
12
+ t.column :raw_payload, "longtext"
13
+ t.column :payload_type, :string
14
+ t.column :name, :string
15
+ t.column :expiry, :integer
16
+ t.column :expire_time, "decimal(16,4)"
17
+ t.column :iteration, :integer
18
+ t.column :version, :integer
19
+ t.column :timeout, "decimal(16,4)"
20
+ t.column :retry, :integer, :default => 0
21
+ end
22
+ create_table :skynet_queue_temperature do |t|
23
+ t.column :id, "bigint unsigned primary key"
24
+ t.column :queue_id, :integer, :default => 0
25
+ t.column :updated_on, :timestamp
26
+ t.column :count, :integer, :default => 0
27
+ t.column :temperature, "decimal(6,4) default 1"
28
+ t.column :type, :string
29
+ end
30
+ add_index :skynet_message_queues, :job_id
31
+ add_index :skynet_message_queues, :task_id
32
+ add_index :skynet_message_queues, :tran_id, :unique => true
33
+ add_index :skynet_message_queues, [:queue_id,:tasktype,:payload_type,:expire_time], :name => "index_skynet_mqueue_for_take"
34
+ execute "insert into skynet_queue_temperature (queue_id,type) values (0,'master')"
35
+ execute "insert into skynet_queue_temperature (queue_id,type) values (0,'any')"
36
+ execute "insert into skynet_queue_temperature (queue_id,type) values (0,'task')"
37
+ end
38
+
39
+ def self.down
40
+ drop_table :skynet_queue_temperature
41
+ drop_table :skynet_message_queues
42
+ end
43
+ end
@@ -0,0 +1,16 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :users do |t|
4
+ t.string :name
5
+ t.string :password
6
+ t.string :favorites
7
+ t.string :email
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :users
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ class CreateUserFavorites < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :user_favorites do |t|
4
+ t.integer :user_id
5
+ t.string :favorite
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+
11
+ def self.down
12
+ drop_table :user_favorites
13
+ end
14
+ end
@@ -0,0 +1,85 @@
1
+ # This file is auto-generated from the current state of the database. Instead of editing this file,
2
+ # please use the migrations feature of ActiveRecord to incrementally modify your database, and
3
+ # then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your database schema. If you need
6
+ # to create the application database on another system, you should be using db:schema:load, not running
7
+ # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
8
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
9
+ #
10
+ # It's strongly recommended to check this file into your version control system.
11
+
12
+ ActiveRecord::Schema.define(:version => 3) do
13
+
14
+ create_table "skynet_message_queues", :force => true do |t|
15
+ t.integer "queue_id", :default => 0
16
+ t.integer "tran_id", :limit => 20
17
+ t.datetime "created_on"
18
+ t.datetime "updated_on"
19
+ t.string "tasktype"
20
+ t.integer "task_id", :limit => 20
21
+ t.integer "job_id", :limit => 20
22
+ t.text "raw_payload"
23
+ t.string "payload_type"
24
+ t.string "name"
25
+ t.integer "expiry"
26
+ t.decimal "expire_time", :precision => 16, :scale => 4
27
+ t.integer "iteration"
28
+ t.integer "version"
29
+ t.decimal "timeout", :precision => 16, :scale => 4
30
+ t.integer "retry", :default => 0
31
+ end
32
+
33
+ add_index "skynet_message_queues", ["tran_id"], :name => "index_skynet_message_queues_on_tran_id", :unique => true
34
+ add_index "skynet_message_queues", ["job_id"], :name => "index_skynet_message_queues_on_job_id"
35
+ add_index "skynet_message_queues", ["task_id"], :name => "index_skynet_message_queues_on_task_id"
36
+ add_index "skynet_message_queues", ["queue_id", "tasktype", "payload_type", "expire_time"], :name => "index_skynet_mqueue_for_take"
37
+
38
+ create_table "skynet_queue_temperature", :force => true do |t|
39
+ t.integer "queue_id", :default => 0
40
+ t.datetime "updated_on"
41
+ t.integer "count", :default => 0
42
+ t.decimal "temperature", :precision => 6, :scale => 4
43
+ t.string "type"
44
+ end
45
+
46
+ create_table "skynet_worker_queues", :force => true do |t|
47
+ t.integer "queue_id", :default => 0
48
+ t.datetime "created_on"
49
+ t.datetime "updated_on"
50
+ t.string "tasktype"
51
+ t.string "tasksubtype"
52
+ t.integer "worker_id", :limit => 20
53
+ t.string "hostname"
54
+ t.integer "process_id"
55
+ t.integer "job_id", :limit => 20
56
+ t.integer "task_id", :limit => 20
57
+ t.integer "iteration"
58
+ t.string "name"
59
+ t.string "map_or_reduce"
60
+ t.decimal "started_at", :precision => 16, :scale => 4
61
+ t.integer "version"
62
+ t.integer "processed"
63
+ t.decimal "timeout", :precision => 16, :scale => 4
64
+ end
65
+
66
+ add_index "skynet_worker_queues", ["worker_id"], :name => "index_skynet_worker_queues_on_worker_id", :unique => true
67
+ add_index "skynet_worker_queues", ["hostname", "process_id"], :name => "index_skynet_worker_queues_on_hostname_and_process_id"
68
+
69
+ create_table "user_favorites", :force => true do |t|
70
+ t.integer "user_id"
71
+ t.string "favorite"
72
+ t.datetime "created_at"
73
+ t.datetime "updated_at"
74
+ end
75
+
76
+ create_table "users", :force => true do |t|
77
+ t.string "name"
78
+ t.string "password"
79
+ t.string "favorites"
80
+ t.string "email"
81
+ t.datetime "created_at"
82
+ t.datetime "updated_at"
83
+ end
84
+
85
+ end
@@ -0,0 +1,33 @@
1
+ CREATE TABLE skynet_message_queues (
2
+ id int(11) NOT NULL auto_increment,
3
+ queue_id int(11) default '0',
4
+ tran_id bigint(20) unsigned default NULL,
5
+ created_on datetime default NULL,
6
+ updated_on datetime default NULL,
7
+ tasktype varchar(255) default NULL,
8
+ task_id bigint(20) unsigned default NULL,
9
+ job_id bigint(20) unsigned default NULL,
10
+ raw_payload longtext,
11
+ payload_type varchar(255) default NULL,
12
+ name varchar(255) default NULL,
13
+ expiry int(11) default NULL,
14
+ expire_time decimal(16,4) default NULL,
15
+ iteration int(11) default NULL,
16
+ version int(11) default NULL,
17
+ timeout decimal(16,4) default NULL,
18
+ retry int(11) default '0',
19
+ PRIMARY KEY (id),
20
+ UNIQUE KEY index_skynet_message_queues_on_tran_id (tran_id),
21
+ KEY index_skynet_message_queues_on_job_id (job_id),
22
+ KEY index_skynet_message_queues_on_task_id (task_id),
23
+ KEY index_skynet_mqueue_for_take (queue_id,tasktype,payload_type,expire_time)
24
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
25
+ CREATE TABLE skynet_queue_temperature (
26
+ id int(11) NOT NULL auto_increment,
27
+ queue_id int(11) default '0',
28
+ updated_on datetime default NULL,
29
+ count int(11) default '0',
30
+ temperature decimal(6,4) default NULL,
31
+ type varchar(255) default NULL,
32
+ PRIMARY KEY (id)
33
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@@ -0,0 +1,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
@@ -0,0 +1,20 @@
1
+ namespace :db do
2
+ desc "Initialize Defaults"
3
+ task :initialize_defaults => :environment do
4
+ puts "Clearing User and UserFavorite tables"
5
+ User.destroy_all
6
+ puts "Creating Someguy"
7
+ User.create(:name => "Someguy", :favorites => "boats,fishing,boat-fishing", :email => 'skynet@mailinator.com')
8
+ puts "Creating AnotherGuy"
9
+ User.create(:name => "AnotherGuy", :favorites => "eating,sleeping,sleep-walking", :email => 'skynet@mailinator.com')
10
+ puts "Creating YoMamma"
11
+ User.create(:name => "YoMomma", :favorites => "kidding,joking,pining", :email => 'skynet@mailinator.com')
12
+ puts "finished"
13
+ end
14
+
15
+ desc "Migrate Favorites"
16
+ task :migrate_favorites => :environment do
17
+ User.distributed_find(:all).map(:migrate_favorites)
18
+ end
19
+
20
+ end
@@ -0,0 +1,40 @@
1
+ # General Apache options
2
+ AddHandler fastcgi-script .fcgi
3
+ AddHandler cgi-script .cgi
4
+ Options +FollowSymLinks +ExecCGI
5
+
6
+ # If you don't want Rails to look in certain directories,
7
+ # use the following rewrite rules so that Apache won't rewrite certain requests
8
+ #
9
+ # Example:
10
+ # RewriteCond %{REQUEST_URI} ^/notrails.*
11
+ # RewriteRule .* - [L]
12
+
13
+ # Redirect all requests not available on the filesystem to Rails
14
+ # By default the cgi dispatcher is used which is very slow
15
+ #
16
+ # For better performance replace the dispatcher with the fastcgi one
17
+ #
18
+ # Example:
19
+ # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
20
+ RewriteEngine On
21
+
22
+ # If your Rails application is accessed via an Alias directive,
23
+ # then you MUST also set the RewriteBase in this htaccess file.
24
+ #
25
+ # Example:
26
+ # Alias /myrailsapp /path/to/myrailsapp/public
27
+ # RewriteBase /myrailsapp
28
+
29
+ RewriteRule ^$ index.html [QSA]
30
+ RewriteRule ^([^.]+)$ $1.html [QSA]
31
+ RewriteCond %{REQUEST_FILENAME} !-f
32
+ RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
33
+
34
+ # In case Rails experiences terminal errors
35
+ # Instead of displaying this message you can supply a file here which will be rendered instead
36
+ #
37
+ # Example:
38
+ # ErrorDocument 500 /500.html
39
+
40
+ ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+
6
+ <head>
7
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
+ <title>The page you were looking for doesn't exist (404)</title>
9
+ <style type="text/css">
10
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
11
+ div.dialog {
12
+ width: 25em;
13
+ padding: 0 4em;
14
+ margin: 4em auto 0 auto;
15
+ border: 1px solid #ccc;
16
+ border-right-color: #999;
17
+ border-bottom-color: #999;
18
+ }
19
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
20
+ </style>
21
+ </head>
22
+
23
+ <body>
24
+ <!-- This file lives in public/404.html -->
25
+ <div class="dialog">
26
+ <h1>The page you were looking for doesn't exist.</h1>
27
+ <p>You may have mistyped the address or the page may have moved.</p>
28
+ </div>
29
+ </body>
30
+ </html>
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+
6
+ <head>
7
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
+ <title>The change you wanted was rejected (422)</title>
9
+ <style type="text/css">
10
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
11
+ div.dialog {
12
+ width: 25em;
13
+ padding: 0 4em;
14
+ margin: 4em auto 0 auto;
15
+ border: 1px solid #ccc;
16
+ border-right-color: #999;
17
+ border-bottom-color: #999;
18
+ }
19
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
20
+ </style>
21
+ </head>
22
+
23
+ <body>
24
+ <!-- This file lives in public/422.html -->
25
+ <div class="dialog">
26
+ <h1>The change you wanted was rejected.</h1>
27
+ <p>Maybe you tried to change something you didn't have access to.</p>
28
+ </div>
29
+ </body>
30
+ </html>
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+
6
+ <head>
7
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
+ <title>We're sorry, but something went wrong (500)</title>
9
+ <style type="text/css">
10
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
11
+ div.dialog {
12
+ width: 25em;
13
+ padding: 0 4em;
14
+ margin: 4em auto 0 auto;
15
+ border: 1px solid #ccc;
16
+ border-right-color: #999;
17
+ border-bottom-color: #999;
18
+ }
19
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
20
+ </style>
21
+ </head>
22
+
23
+ <body>
24
+ <!-- This file lives in public/500.html -->
25
+ <div class="dialog">
26
+ <h1>We're sorry, but something went wrong.</h1>
27
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
28
+ </div>
29
+ </body>
30
+ </html>
@@ -0,0 +1,10 @@
1
+ #!/opt/local/bin/ruby
2
+
3
+ require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
4
+
5
+ # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
6
+ # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
7
+ require "dispatcher"
8
+
9
+ ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
10
+ Dispatcher.dispatch
@@ -0,0 +1,24 @@
1
+ #!/opt/local/bin/ruby
2
+ #
3
+ # You may specify the path to the FastCGI crash log (a log of unhandled
4
+ # exceptions which forced the FastCGI instance to exit, great for debugging)
5
+ # and the number of requests to process before running garbage collection.
6
+ #
7
+ # By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
8
+ # and the GC period is nil (turned off). A reasonable number of requests
9
+ # could range from 10-100 depending on the memory footprint of your app.
10
+ #
11
+ # Example:
12
+ # # Default log path, normal GC behavior.
13
+ # RailsFCGIHandler.process!
14
+ #
15
+ # # Default log path, 50 requests between GC.
16
+ # RailsFCGIHandler.process! nil, 50
17
+ #
18
+ # # Custom log path, normal GC behavior.
19
+ # RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
20
+ #
21
+ require File.dirname(__FILE__) + "/../config/environment"
22
+ require 'fcgi_handler'
23
+
24
+ RailsFCGIHandler.process!
@@ -0,0 +1,10 @@
1
+ #!/opt/local/bin/ruby
2
+
3
+ require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
4
+
5
+ # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
6
+ # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
7
+ require "dispatcher"
8
+
9
+ ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
10
+ Dispatcher.dispatch
File without changes