public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Removed the default .htaccess configuration as there are so many good 
deployment options now (kept it as an example in README) [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9134 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
dhh (author)
Sat Mar 29 11:45:39 -0700 2008
commit  3e73278020107ea7282c45001d82e90d23a708b4
tree    a725371edff1f1eac33259370495a8f76aeb2480
parent  e8170805df1a32119db9d328daee1239b338ac71
...
70
71
72
73
 
74
75
76
...
70
71
72
 
73
74
75
76
0
@@ -70,7 +70,7 @@ module ActionController
0
     #
0
     # On shared hosts, Apache sometimes doesn't pass authentication headers to
0
     # FCGI instances. If your environment matches this description and you cannot
0
- # authenticate, try this rule in public/.htaccess (replace the plain one):
0
+ # authenticate, try this rule in your Apache setup:
0
     #
0
     # RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]
0
     module Basic
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Removed the default .htaccess configuration as there are so many good deployment options now (kept it as an example in README) [DHH]
0
+
0
 * config.time_zone accepts TZInfo::Timezone identifiers as well as Rails TimeZone identifiers [Geoff Buesing]
0
 
0
 * Rails::Initializer#initialize_time_zone raises an error if value assigned to config.time_zone is not recognized. Rake time zone tasks only require ActiveSupport instead of entire environment [Geoff Buesing]
...
1
2
3
4
5
6
7
8
9
10
11
 
 
 
 
 
 
 
 
 
12
13
14
...
29
30
31
32
33
34
35
...
62
63
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
66
67
...
1
2
 
 
 
 
 
 
 
 
 
3
4
5
6
7
8
9
10
11
12
13
14
...
29
30
31
 
32
33
34
...
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
0
@@ -1,14 +1,14 @@
0
 == Welcome to Rails
0
 
0
-Rails is a web-application and persistence framework that includes everything
0
-needed to create database-backed web-applications according to the
0
-Model-View-Control pattern of separation. This pattern splits the view (also
0
-called the presentation) into "dumb" templates that are primarily responsible
0
-for inserting pre-built data in between HTML tags. The model contains the
0
-"smart" domain objects (such as Account, Product, Person, Post) that holds all
0
-the business logic and knows how to persist themselves to a database. The
0
-controller handles the incoming requests (such as Save New Account, Update
0
-Product, Show Post) by manipulating the model and directing data to the view.
0
+Rails is a web-application framework that includes everything needed to create
0
+database-backed web applications according to the Model-View-Control pattern.
0
+
0
+This pattern splits the view (also called the presentation) into "dumb" templates
0
+that are primarily responsible for inserting pre-built data in between HTML tags.
0
+The model contains the "smart" domain objects (such as Account, Product, Person,
0
+Post) that holds all the business logic and knows how to persist themselves to
0
+a database. The controller handles the incoming requests (such as Save New Account,
0
+Update Product, Show Post) by manipulating the model and directing data to the view.
0
 
0
 In Rails, the model is handled by what's called an object-relational mapping
0
 layer entitled Active Record. This layer allows you to present the data from
0
@@ -29,7 +29,6 @@ link:files/vendor/rails/actionpack/README.html.
0
 
0
 1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
0
    and your application name. Ex: rails myapp
0
- (If you've downloaded Rails in a complete tgz or zip, this step is already done)
0
 2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
0
 3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
0
 4. Follow the guidelines to start developing your application
0
@@ -62,6 +61,50 @@ Apache, LiteSpeed, IIS are just a few. For more information on FCGI,
0
 please visit: http://wiki.rubyonrails.com/rails/pages/FastCGI
0
 
0
 
0
+== Apache .htaccess example
0
+
0
+# General Apache options
0
+AddHandler fastcgi-script .fcgi
0
+AddHandler cgi-script .cgi
0
+Options +FollowSymLinks +ExecCGI
0
+
0
+# If you don't want Rails to look in certain directories,
0
+# use the following rewrite rules so that Apache won't rewrite certain requests
0
+#
0
+# Example:
0
+# RewriteCond %{REQUEST_URI} ^/notrails.*
0
+# RewriteRule .* - [L]
0
+
0
+# Redirect all requests not available on the filesystem to Rails
0
+# By default the cgi dispatcher is used which is very slow
0
+#
0
+# For better performance replace the dispatcher with the fastcgi one
0
+#
0
+# Example:
0
+# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
0
+RewriteEngine On
0
+
0
+# If your Rails application is accessed via an Alias directive,
0
+# then you MUST also set the RewriteBase in this htaccess file.
0
+#
0
+# Example:
0
+# Alias /myrailsapp /path/to/myrailsapp/public
0
+# RewriteBase /myrailsapp
0
+
0
+RewriteRule ^$ index.html [QSA]
0
+RewriteRule ^([^.]+)$ $1.html [QSA]
0
+RewriteCond %{REQUEST_FILENAME} !-f
0
+RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
0
+
0
+# In case Rails experiences terminal errors
0
+# Instead of displaying this message you can supply a file here which will be rendered instead
0
+#
0
+# Example:
0
+# ErrorDocument 500 /500.html
0
+
0
+ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
0
+
0
+
0
 == Debugging Rails
0
 
0
 Sometimes your application goes wrong. Fortunately there are a lot of tools that
...
160
161
162
163
164
165
166
...
197
198
199
200
201
202
203
204
...
231
232
233
234
235
236
237
238
239
240
241
242
...
160
161
162
 
163
164
165
...
196
197
198
 
 
199
200
201
...
228
229
230
 
 
 
 
 
 
231
232
233
0
@@ -160,7 +160,6 @@ end
0
 
0
 # Copy Ties Content -----------------------------------------------------------------------
0
 
0
-# :link_apache_config
0
 desc "Make copies of all the default content of ties"
0
 task :copy_ties_content => [
0
   :copy_rootfiles, :copy_dispatches, :copy_html_files, :copy_application,
0
@@ -197,8 +196,6 @@ task :copy_configs do
0
   
0
   cp "configs/routes.rb", "#{PKG_DESTINATION}/config/routes.rb"
0
 
0
- cp "configs/apache.conf", "#{PKG_DESTINATION}/public/.htaccess"
0
-
0
   cp "configs/initializers/inflections.rb", "#{PKG_DESTINATION}/config/initializers/inflections.rb"
0
   cp "configs/initializers/mime_types.rb", "#{PKG_DESTINATION}/config/initializers/mime_types.rb"
0
 
0
@@ -231,12 +228,6 @@ task :copy_app_doc_readme do
0
   cp "doc/README_FOR_APP", "#{PKG_DESTINATION}/doc/README_FOR_APP"
0
 end
0
 
0
-task :link_apache_config do
0
- chdir(File.join(PKG_DESTINATION, 'config')) {
0
- ln_s "../public/.htaccess", "apache.conf"
0
- }
0
-end
0
-
0
 def copy_with_rewritten_ruby_path(src_file, dest_file)
0
   ruby = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
0
 
...
52
53
54
55
 
56
57
58
59
60
61
 
62
63
64
...
52
53
54
 
55
56
57
58
59
 
 
60
61
62
63
0
@@ -52,13 +52,12 @@ class AppGenerator < Rails::Generator::Base
0
       m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb"
0
       m.template "helpers/test_helper.rb", "test/test_helper.rb"
0
 
0
- # database.yml and .htaccess
0
+ # database.yml and routes.rb
0
       m.template "configs/databases/#{options[:db]}.yml", "config/database.yml", :assigns => {
0
         :app_name => @app_name,
0
         :socket => options[:db] == "mysql" ? mysql_socket_location : nil
0
       }
0
- m.template "configs/routes.rb", "config/routes.rb"
0
- m.template "configs/apache.conf", "public/.htaccess"
0
+ m.template "configs/routes.rb", "config/routes.rb"
0
 
0
       # Initializers
0
       m.template "configs/initializers/inflections.rb", "config/initializers/inflections.rb"

Comments

    No one has commented yet.