mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
e8170805df
commit
3e73278020
5 changed files with 58 additions and 23 deletions
|
@ -70,7 +70,7 @@ module ActionController
|
|||
#
|
||||
# On shared hosts, Apache sometimes doesn't pass authentication headers to
|
||||
# FCGI instances. If your environment matches this description and you cannot
|
||||
# authenticate, try this rule in public/.htaccess (replace the plain one):
|
||||
# authenticate, try this rule in your Apache setup:
|
||||
#
|
||||
# RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]
|
||||
module Basic
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Removed the default .htaccess configuration as there are so many good deployment options now (kept it as an example in README) [DHH]
|
||||
|
||||
* config.time_zone accepts TZInfo::Timezone identifiers as well as Rails TimeZone identifiers [Geoff Buesing]
|
||||
|
||||
* 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,14 +1,14 @@
|
|||
== Welcome to Rails
|
||||
|
||||
Rails is a web-application and persistence framework that includes everything
|
||||
needed to create database-backed web-applications according to the
|
||||
Model-View-Control pattern of separation. This pattern splits the view (also
|
||||
called the presentation) into "dumb" templates that are primarily responsible
|
||||
for inserting pre-built data in between HTML tags. The model contains the
|
||||
"smart" domain objects (such as Account, Product, Person, Post) that holds all
|
||||
the business logic and knows how to persist themselves to a database. The
|
||||
controller handles the incoming requests (such as Save New Account, Update
|
||||
Product, Show Post) by manipulating the model and directing data to the view.
|
||||
Rails is a web-application framework that includes everything needed to create
|
||||
database-backed web applications according to the Model-View-Control pattern.
|
||||
|
||||
This pattern splits the view (also called the presentation) into "dumb" templates
|
||||
that are primarily responsible for inserting pre-built data in between HTML tags.
|
||||
The model contains the "smart" domain objects (such as Account, Product, Person,
|
||||
Post) that holds all the business logic and knows how to persist themselves to
|
||||
a database. The controller handles the incoming requests (such as Save New Account,
|
||||
Update Product, Show Post) by manipulating the model and directing data to the view.
|
||||
|
||||
In Rails, the model is handled by what's called an object-relational mapping
|
||||
layer entitled Active Record. This layer allows you to present the data from
|
||||
|
@ -29,7 +29,6 @@ link:files/vendor/rails/actionpack/README.html.
|
|||
|
||||
1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
|
||||
and your application name. Ex: rails myapp
|
||||
(If you've downloaded Rails in a complete tgz or zip, this step is already done)
|
||||
2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
|
||||
3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
|
||||
4. Follow the guidelines to start developing your application
|
||||
|
@ -62,6 +61,50 @@ Apache, LiteSpeed, IIS are just a few. For more information on FCGI,
|
|||
please visit: http://wiki.rubyonrails.com/rails/pages/FastCGI
|
||||
|
||||
|
||||
== Apache .htaccess example
|
||||
|
||||
# General Apache options
|
||||
AddHandler fastcgi-script .fcgi
|
||||
AddHandler cgi-script .cgi
|
||||
Options +FollowSymLinks +ExecCGI
|
||||
|
||||
# If you don't want Rails to look in certain directories,
|
||||
# use the following rewrite rules so that Apache won't rewrite certain requests
|
||||
#
|
||||
# Example:
|
||||
# RewriteCond %{REQUEST_URI} ^/notrails.*
|
||||
# RewriteRule .* - [L]
|
||||
|
||||
# Redirect all requests not available on the filesystem to Rails
|
||||
# By default the cgi dispatcher is used which is very slow
|
||||
#
|
||||
# For better performance replace the dispatcher with the fastcgi one
|
||||
#
|
||||
# Example:
|
||||
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
|
||||
RewriteEngine On
|
||||
|
||||
# If your Rails application is accessed via an Alias directive,
|
||||
# then you MUST also set the RewriteBase in this htaccess file.
|
||||
#
|
||||
# Example:
|
||||
# Alias /myrailsapp /path/to/myrailsapp/public
|
||||
# RewriteBase /myrailsapp
|
||||
|
||||
RewriteRule ^$ index.html [QSA]
|
||||
RewriteRule ^([^.]+)$ $1.html [QSA]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
|
||||
|
||||
# In case Rails experiences terminal errors
|
||||
# Instead of displaying this message you can supply a file here which will be rendered instead
|
||||
#
|
||||
# Example:
|
||||
# ErrorDocument 500 /500.html
|
||||
|
||||
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
|
||||
|
||||
|
||||
== Debugging Rails
|
||||
|
||||
Sometimes your application goes wrong. Fortunately there are a lot of tools that
|
||||
|
|
|
@ -160,7 +160,6 @@ end
|
|||
|
||||
# Copy Ties Content -----------------------------------------------------------------------
|
||||
|
||||
# :link_apache_config
|
||||
desc "Make copies of all the default content of ties"
|
||||
task :copy_ties_content => [
|
||||
:copy_rootfiles, :copy_dispatches, :copy_html_files, :copy_application,
|
||||
|
@ -197,8 +196,6 @@ task :copy_configs do
|
|||
|
||||
cp "configs/routes.rb", "#{PKG_DESTINATION}/config/routes.rb"
|
||||
|
||||
cp "configs/apache.conf", "#{PKG_DESTINATION}/public/.htaccess"
|
||||
|
||||
cp "configs/initializers/inflections.rb", "#{PKG_DESTINATION}/config/initializers/inflections.rb"
|
||||
cp "configs/initializers/mime_types.rb", "#{PKG_DESTINATION}/config/initializers/mime_types.rb"
|
||||
|
||||
|
@ -231,12 +228,6 @@ task :copy_app_doc_readme do
|
|||
cp "doc/README_FOR_APP", "#{PKG_DESTINATION}/doc/README_FOR_APP"
|
||||
end
|
||||
|
||||
task :link_apache_config do
|
||||
chdir(File.join(PKG_DESTINATION, 'config')) {
|
||||
ln_s "../public/.htaccess", "apache.conf"
|
||||
}
|
||||
end
|
||||
|
||||
def copy_with_rewritten_ruby_path(src_file, dest_file)
|
||||
ruby = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
|
||||
|
||||
|
|
|
@ -52,13 +52,12 @@ class AppGenerator < Rails::Generator::Base
|
|||
m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb"
|
||||
m.template "helpers/test_helper.rb", "test/test_helper.rb"
|
||||
|
||||
# database.yml and .htaccess
|
||||
# database.yml and routes.rb
|
||||
m.template "configs/databases/#{options[:db]}.yml", "config/database.yml", :assigns => {
|
||||
:app_name => @app_name,
|
||||
:socket => options[:db] == "mysql" ? mysql_socket_location : nil
|
||||
}
|
||||
m.template "configs/routes.rb", "config/routes.rb"
|
||||
m.template "configs/apache.conf", "public/.htaccess"
|
||||
m.template "configs/routes.rb", "config/routes.rb"
|
||||
|
||||
# Initializers
|
||||
m.template "configs/initializers/inflections.rb", "config/initializers/inflections.rb"
|
||||
|
|
Loading…
Reference in a new issue