Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update Apache documentation: recommend disabling MultiViews and addin…

…g 'AllowOverride all'. Fixes issue #243.
  • Loading branch information...
commit 0e2c98117445c6e0caf54043e94df1e5149db10c 1 parent e88697d
@FooBarWidget FooBarWidget authored
View
2  bin/passenger-install-apache2-module
@@ -85,7 +85,7 @@ class Installer < PhusionPassenger::AbstractInstaller
check_dependencies || exit(1)
check_whether_apache_uses_compatible_mpm
check_write_permission_to_passenger_root || exit(1)
- if install_apache2_module
+ if true || install_apache2_module
show_apache2_config_snippets
show_deployment_example
else
View
77 doc/Users guide Apache.txt
@@ -345,13 +345,23 @@ are run, is ``production''. You can change this by changing the
=== Deploying to a virtual host's root ===
-Add a virtual host entry to your Apache configuration file. The virtual host's
-document root must point to your Ruby on Rails application's 'public' folder.
+Add a virtual host entry to your Apache configuration file. Make sure that the
+following conditions are met:
+
+- The virtual host's document root must point to your Ruby on Rails application's
+ 'public' folder.
+- The Apache per-directory permissions must allow access to this folder.
+- MultiViews must be disabled for this folder.
+
For example:
-------------------------------------------
<VirtualHost *:80>
ServerName www.mycook.com
DocumentRoot /webapps/mycook/public
+ <Directory /webapps/mycook/public>
+ Allow from all
+ Options -MultiViews
+ </Directory>
</VirtualHost>
-------------------------------------------
@@ -373,6 +383,9 @@ Suppose that you already have a virtual host:
<VirtualHost *:80>
ServerName www.phusion.nl
DocumentRoot /websites/phusion
+ <Directory /websites/phusion>
+ Allow from all
+ </Directory>
</VirtualHost>
-------------------------------------------
@@ -385,12 +398,25 @@ folder to a directory in the document root. For example:
ln -s /webapps/mycook/public /websites/phusion/rails
-------------------------------------------
-Next, add a <<RailsBaseURI,RailsBaseURI>> option to the virtual host configuration:
+Next, add a <<RailsBaseURI,RailsBaseURI>> option to the virtual host configuration,
+and also make sure that:
+
+- The Apache per-directory permissions allow access to this folder.
+- MultiViews is disabled for this folder.
+
+For example:
-------------------------------------------
<VirtualHost *:80>
ServerName www.phusion.nl
DocumentRoot /websites/phusion
- RailsBaseURI /rails # This line has been added.
+ <Directory /websites/phusion>
+ Allow from all
+ </Directory>
+
+ RailsBaseURI /rails # <-- These lines have
+ <Directory /websites/phusion/rails> # <-- been added.
+ Options -MultiViews # <--
+ </Directory> # <--
</VirtualHost>
-------------------------------------------
Then restart Apache. The application has now been deployed.
@@ -515,6 +541,10 @@ the Apache configuration file:
<VirtualHost *:80>
ServerName www.rackexample.com
DocumentRoot /webapps/rack_example/public
+ <Directory /webapps/rack_example/public>
+ Allow from all
+ Options -MultiViews
+ </Directory>
</VirtualHost>
-------------------------------------------
@@ -523,13 +553,23 @@ under the URL 'http://www.rackexample.com/'.
=== Deploying to a virtual host's root ===
-Add a virtual host entry to your Apache configuration file. The virtual host's
-document root must point to your Rack application's 'public' folder.
+Add a virtual host entry to your Apache configuration file. Make sure that the
+following conditions are met:
+
+- The virtual host's document root must point to your Rack application's
+ 'public' folder.
+- The Apache per-directory permissions must allow access to this folder.
+- MultiViews must be disabled for this folder.
+
For example:
-------------------------------------------
<VirtualHost *:80>
ServerName www.rackapp.com
DocumentRoot /webapps/rackapp/public
+ <Directory /webapps/rackapp/public>
+ Allow from all
+ Options -MultiViews
+ </Directory>
</VirtualHost>
-------------------------------------------
@@ -551,6 +591,9 @@ Suppose that you already have a virtual host:
<VirtualHost *:80>
ServerName www.phusion.nl
DocumentRoot /websites/phusion
+ <Directory /websites/phusion>
+ Allow from all
+ </Directory>
</VirtualHost>
-------------------------------------------
@@ -563,12 +606,25 @@ folder to a directory in the document root. For example:
ln -s /webapps/rackapp/public /websites/phusion/rack
-------------------------------------------
-Next, add a <<RackBaseURI,RackBaseURI>> option to the virtual host configuration:
+Next, add a <<RackBaseURI,RackBaseURI>> option to the virtual host configuration,
+and also make sure that:
+
+- The Apache per-directory permissions allow access to this folder.
+- MultiViews is disabled for this folder.
+
+For example:
-------------------------------------------
<VirtualHost *:80>
ServerName www.phusion.nl
DocumentRoot /websites/phusion
- RackBaseURI /rack # This line has been added.
+ <Directory /websites/phusion>
+ Allow from all
+ </Directory>
+
+ RackBaseURI /rails # <-- These lines have
+ <Directory /websites/phusion/rails> # <-- been added.
+ Options -MultiViews # <--
+ </Directory> # <--
</VirtualHost>
-------------------------------------------
Then restart Apache. The application has now been deployed.
@@ -1660,6 +1716,11 @@ chcon -R -h -t httpd_sys_content_t /path/to/your/rails/app
'mod_userdir' is not compatible with Phusion Passenger at the moment.
+==== MultiViews (mod_negotiation) ====
+
+MultiViews is not compatible with Phusion Passenger. You should disable MultiViews
+for all Phusion Passenger hosts.
+
==== VirtualDocumentRoot ====
VirtualDocumentRoot is not compatible with Phusion Passenger at the moment.
View
11 lib/phusion_passenger/templates/apache2/deployment_example.txt.erb
@@ -1,16 +1,19 @@
<banner>Deploying a Ruby on Rails application: an example</banner>
-Suppose you have a Ruby on Rails application in <b>/somewhere</b>. Add a virtual host
-to your Apache configuration file, and set its DocumentRoot to
-<b>/somewhere/public</b>, like this:
+Suppose you have a Rails application in <b>/somewhere</b>. Add a virtual host to your
+Apache configuration file and set its DocumentRoot to <b>/somewhere/public</b>:
<b>
<VirtualHost *:80>
ServerName www.yourhost.com
DocumentRoot /somewhere/public # <-- be sure to point to 'public'!
+ <Directory /somewhere/public>
+ AllowOverride all # <-- relax Apache security settings
+ Options -MultiViews # <-- MultiViews must be turned off
+ </Directory>
</VirtualHost>
</b>
And that's it! You may also want to check the Users Guide for security and
-optimization tips and other useful information:
+optimization tips, troubleshooting and other useful information:
<yellow><%= @users_guide %></yellow>
Please sign in to comment.
Something went wrong with that request. Please try again.