passenger 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data/LICENSE +3 -1
- data/Rakefile +17 -12
- data/bin/passenger-config +22 -0
- data/bin/passenger-install-apache2-module +2 -31
- data/bin/passenger-make-enterprisey +66 -0
- data/bin/passenger-memory-stats +192 -0
- data/doc/Users guide.html +150 -66
- data/doc/Users guide.txt +141 -51
- data/doc/cxxapi/ApplicationPoolClientServer_8h-source.html +1 -1
- data/doc/cxxapi/ApplicationPoolServer_8h-source.html +545 -0
- data/doc/cxxapi/ApplicationPool_8h-source.html +1 -1
- data/doc/cxxapi/Application_8h-source.html +1 -1
- data/doc/cxxapi/Configuration_8h-source.html +2 -2
- data/doc/cxxapi/DummySpawnManager_8h-source.html +1 -1
- data/doc/cxxapi/Exceptions_8h-source.html +1 -1
- data/doc/cxxapi/Hooks_8h-source.html +1 -1
- data/doc/cxxapi/Logging_8h-source.html +1 -1
- data/doc/cxxapi/MessageChannel_8h-source.html +210 -205
- data/doc/cxxapi/SpawnManager_8h-source.html +1 -1
- data/doc/cxxapi/StandardApplicationPool_8h-source.html +1 -1
- data/doc/cxxapi/Utils_8h-source.html +1 -1
- data/doc/cxxapi/annotated.html +1 -1
- data/doc/cxxapi/classClient-members.html +30 -0
- data/doc/cxxapi/classClient.html +112 -0
- data/doc/cxxapi/classPassenger_1_1Application-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +28 -0
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +41 -0
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnManager.html +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException.html +1 -1
- data/doc/cxxapi/definitions_8h-source.html +1 -1
- data/doc/cxxapi/files.html +1 -1
- data/doc/cxxapi/functions.html +1 -1
- data/doc/cxxapi/functions_func.html +1 -1
- data/doc/cxxapi/functions_type.html +1 -1
- data/doc/cxxapi/graph_legend.html +1 -1
- data/doc/cxxapi/graph_legend.png +0 -0
- data/doc/cxxapi/group__Configuration.html +3 -3
- data/doc/cxxapi/group__Configuration.png +0 -0
- data/doc/cxxapi/group__Core.html +1 -1
- data/doc/cxxapi/group__Core.png +0 -0
- data/doc/cxxapi/group__Exceptions.html +1 -1
- data/doc/cxxapi/group__Hooks.html +1 -1
- data/doc/cxxapi/group__Hooks.png +0 -0
- data/doc/cxxapi/group__Support.html +1 -1
- data/doc/cxxapi/hierarchy.html +1 -1
- data/doc/cxxapi/inherit__graph__0.png +0 -0
- data/doc/cxxapi/inherit__graph__1.png +0 -0
- data/doc/cxxapi/inherit__graph__10.map +1 -0
- data/doc/cxxapi/inherit__graph__10.md5 +1 -0
- data/doc/cxxapi/inherit__graph__10.png +0 -0
- data/doc/cxxapi/inherit__graph__2.png +0 -0
- data/doc/cxxapi/inherit__graph__3.png +0 -0
- data/doc/cxxapi/inherit__graph__4.png +0 -0
- data/doc/cxxapi/inherit__graph__5.png +0 -0
- data/doc/cxxapi/inherit__graph__6.png +0 -0
- data/doc/cxxapi/inherit__graph__7.png +0 -0
- data/doc/cxxapi/inherit__graph__8.png +0 -0
- data/doc/cxxapi/inherit__graph__9.png +0 -0
- data/doc/cxxapi/inherits.html +1 -1
- data/doc/cxxapi/main.html +1 -1
- data/doc/cxxapi/modules.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +1 -1
- data/doc/rdoc/classes/Passenger/RequestHandler.html +84 -74
- data/doc/rdoc/classes/Passenger/SpawnManager.html +54 -49
- data/doc/rdoc/classes/PlatformInfo.html +25 -12
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +1 -1
- data/doc/rdoc/files/ext/passenger/native_support_c.html +1 -1
- data/doc/rdoc/files/lib/passenger/abstract_server_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/application_spawner_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/dependencies_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/framework_spawner_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/platform_info_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/request_handler_rb.html +1 -1
- data/doc/rdoc/files/lib/passenger/spawn_manager_rb.html +1 -1
- data/ext/apache2/Configuration.h +1 -1
- data/ext/apache2/Hooks.cpp +68 -16
- data/ext/apache2/Logging.cpp +1 -1
- data/ext/apache2/MessageChannel.h +48 -43
- data/ext/passenger/native_support.c +46 -43
- data/lib/passenger/application_spawner.rb +37 -4
- data/lib/passenger/dependencies.rb +5 -1
- data/lib/passenger/framework_spawner.rb +2 -0
- data/lib/passenger/platform_info.rb +32 -17
- data/lib/passenger/request_handler.rb +10 -1
- data/lib/passenger/spawn_manager.rb +14 -8
- data/lib/passenger/templates/error_layout.html.erb +2 -2
- data/test/CxxTestMain.cpp +1 -0
- data/test/MessageChannelTest.cpp +3 -1
- data/test/application_spawner_spec.rb +2 -0
- data/test/framework_spawner_spec.rb +2 -0
- data/test/integration_tests.rb +1 -0
- data/test/spawn_manager_spec.rb +2 -0
- data/test/spawner_privilege_lowering_spec.rb +1 -0
- data/test/stub/minimal-railsapp/vendor/rails/actionpack/lib/action_controller.rb +4 -0
- data/test/stub/minimal-railsapp/vendor/rails/activerecord/lib/active_record.rb +7 -0
- data/test/stub/rails_apps/foobar/config/environments/test.rb +22 -0
- metadata +28 -22
- data/lib/passenger/templates/osx_broken_apache_warning.txt.erb +0 -23
data/doc/Users guide.html
CHANGED
@@ -422,9 +422,8 @@ How to solve common problems.
|
|
422
422
|
using the commandline.</p></div>
|
423
423
|
</div>
|
424
424
|
</div>
|
425
|
-
<h2 id="
|
425
|
+
<h2 id="_supported_operating_systems">1. Supported operating systems</h2>
|
426
426
|
<div class="sectionbody">
|
427
|
-
<h3 id="_supported_operating_systems">1.1. Supported operating systems</h3><div style="clear:left"></div>
|
428
427
|
<div class="para"><p>Passenger works on any POSIX-compliant operating system. In other words:
|
429
428
|
practically any operating system on earth, except Microsoft Windows.</p></div>
|
430
429
|
<div class="para"><p>Passenger has been tested on:</p></div>
|
@@ -491,7 +490,11 @@ fine on them. Please
|
|
491
490
|
or
|
492
491
|
<a href="http://groups.google.com/group/phusion-passenger">join our discussion list</a>
|
493
492
|
if it doesn't.</p></div>
|
494
|
-
|
493
|
+
</div>
|
494
|
+
<h2 id="_installing_passenger">2. Installing Passenger</h2>
|
495
|
+
<div class="sectionbody">
|
496
|
+
<h3 id="_generic_installation_instructions">2.1. Generic installation instructions</h3><div style="clear:left"></div>
|
497
|
+
<h4 id="install_passenger">2.1.1. Overview of download and installation methods</h4>
|
495
498
|
<div class="para"><p>There are two ways to install Passenger:</p></div>
|
496
499
|
<div class="olist"><ol>
|
497
500
|
<li>
|
@@ -520,7 +523,7 @@ as <em>root</em>. If the installer fails because of permission errors, it will t
|
|
520
523
|
you.</td>
|
521
524
|
</tr></table>
|
522
525
|
</div>
|
523
|
-
<
|
526
|
+
<h4 id="specifying_correct_apache_install">2.1.2. Specifying the correct Apache installation</h4>
|
524
527
|
<div class="para"><p>If your system has multiple Apache installations (this is likely the case on
|
525
528
|
MacOS X), then you will need to tell the Passenger installer which one to use.
|
526
529
|
If you only have one Apache installation (the case on most Linux systems), then
|
@@ -543,7 +546,7 @@ variable. Suppose that you want to use the Apache installation in
|
|
543
546
|
be located in the <tt>sbin</tt> folder instead of the <tt>bin</tt> folder.</td>
|
544
547
|
</tr></table>
|
545
548
|
</div>
|
546
|
-
<
|
549
|
+
<h4 id="specifying_ruby_installation">2.1.3. Specifying the correct Ruby installation</h4>
|
547
550
|
<div class="para"><p>If your system has multiple Ruby installations (this is likely the case on
|
548
551
|
MacOS X), then you will need to tell the Passenger installer which one to use.
|
549
552
|
If you only have one Ruby installation (the case on most Linux systems), then
|
@@ -568,7 +571,7 @@ following Ruby installations:</p></div>
|
|
568
571
|
<div class="content">
|
569
572
|
<pre><tt>export PATH=/opt/myruby/bin:$PATH</tt></pre>
|
570
573
|
</div></div>
|
571
|
-
<
|
574
|
+
<h4 id="_installing_via_the_gem">2.1.4. Installing via the gem</h4>
|
572
575
|
<div class="para"><p>Please install the gem and then run the Passenger installer, by typing the
|
573
576
|
following commands:</p></div>
|
574
577
|
<div class="listingblock">
|
@@ -577,7 +580,7 @@ following commands:</p></div>
|
|
577
580
|
passenger-install-apache2-module</tt></pre>
|
578
581
|
</div></div>
|
579
582
|
<div class="para"><p>Please follow the instructions given by the installer.</p></div>
|
580
|
-
<
|
583
|
+
<h4 id="_installing_via_the_source_tarball">2.1.5. Installing via the source tarball</h4>
|
581
584
|
<div class="para"><p>Extract the tarball to whatever location you prefer. The Passenger files
|
582
585
|
are to reside in that location permanently. For example, if you would like
|
583
586
|
Passenger to reside in <tt>/opt/passenger-x.x.x</tt>:</p></div>
|
@@ -601,8 +604,15 @@ tar xzvf ~/YourDownloadsFolder/passenger-x.x.x.tar.gz</tt></pre>
|
|
601
604
|
installation. Furthermore, the <em>passenger-x.x.x</em> folder must be accessible by Apache.</td>
|
602
605
|
</tr></table>
|
603
606
|
</div>
|
607
|
+
<h3 id="_operating_system_specific_instructions_and_information">2.2. Operating system-specific instructions and information</h3><div style="clear:left"></div>
|
608
|
+
<h4 id="_macos_x">2.2.1. MacOS X</h4>
|
609
|
+
<div class="para"><p>Ben Ruebenstein has written an excellent
|
610
|
+
<a href="http://benr75.com/articles/2008/04/12/setup-mod_rails-phusion-mac-os-x-leopard">tutorial
|
611
|
+
on installing Phusion Passenger on OS X</a>.</p></div>
|
612
|
+
<h4 id="_ubuntu_linux">2.2.2. Ubuntu Linux</h4>
|
613
|
+
<div class="para"><p>Ben Hughes has written an <a href="http://www.railsgarden.com/2008/04/12/configurating-passenger-mod_rails-on-slicehost-with-ubuntu-710/">article on installing Passenger on Ubuntu</a>.</p></div>
|
604
614
|
</div>
|
605
|
-
<h2 id="_deploying_a_ruby_on_rails_application">
|
615
|
+
<h2 id="_deploying_a_ruby_on_rails_application">3. Deploying a Ruby on Rails application</h2>
|
606
616
|
<div class="sectionbody">
|
607
617
|
<div class="para"><p>Suppose you have a Ruby on Rails application in <em>/webapps/mycook</em>, and you own
|
608
618
|
the domain <em>www.mycook.com</em>. You can either deploy your application in the
|
@@ -619,7 +629,7 @@ are run, is “production”. You can change this by changing the
|
|
619
629
|
<a href="#rails_env"><em>RailsEnv</em></a> configuration option.</td>
|
620
630
|
</tr></table>
|
621
631
|
</div>
|
622
|
-
<h3 id="_deploying_to_a_virtual_host_s_root">
|
632
|
+
<h3 id="_deploying_to_a_virtual_host_s_root">3.1. Deploying to a virtual host's root</h3><div style="clear:left"></div>
|
623
633
|
<div class="para"><p>Add a virtual host entry to your Apache configuration file. The virtual host's
|
624
634
|
document root must point to your Ruby on Rails application's <em>public</em> folder.
|
625
635
|
For example:</p></div>
|
@@ -631,7 +641,7 @@ For example:</p></div>
|
|
631
641
|
</VirtualHost></tt></pre>
|
632
642
|
</div></div>
|
633
643
|
<div class="para"><p>Then restart Apache. The application has now been deployed.</p></div>
|
634
|
-
<h3 id="deploying_to_sub_uri">
|
644
|
+
<h3 id="deploying_to_sub_uri">3.2. Deploying to a sub URI</h3><div style="clear:left"></div>
|
635
645
|
<div class="para"><p>Suppose that you already have a virtual host:</p></div>
|
636
646
|
<div class="listingblock">
|
637
647
|
<div class="content">
|
@@ -658,7 +668,7 @@ folder to a directory in the document root. For example:</p></div>
|
|
658
668
|
</VirtualHost></tt></pre>
|
659
669
|
</div></div>
|
660
670
|
<div class="para"><p>Then restart Apache. The application has now been deployed.</p></div>
|
661
|
-
<h3 id="_redeploying_restarting_the_ruby_on_rails_application">
|
671
|
+
<h3 id="_redeploying_restarting_the_ruby_on_rails_application">3.3. Redeploying (restarting the Ruby on Rails application)</h3><div style="clear:left"></div>
|
662
672
|
<div class="para"><p>Deploying a new version of a Ruby on Rails application is as simple as
|
663
673
|
re-uploading the application files, and restarting the application.</p></div>
|
664
674
|
<div class="para"><p>There are two ways to restart the application:</p></div>
|
@@ -683,7 +693,7 @@ command line:</p></div>
|
|
683
693
|
<pre><tt>touch /webapps/mycook/tmp/restart.txt</tt></pre>
|
684
694
|
</div></div>
|
685
695
|
</div>
|
686
|
-
<h2 id="_configuring_passenger">
|
696
|
+
<h2 id="_configuring_passenger">4. Configuring Passenger</h2>
|
687
697
|
<div class="sectionbody">
|
688
698
|
<div class="para"><p>After installation, Passenger does not need any further configurations.
|
689
699
|
Nevertheless, the system administrator may be interested in changing
|
@@ -874,10 +884,27 @@ The default value is <em>nobody</em>.</p></div>
|
|
874
884
|
</dd>
|
875
885
|
</dl></div>
|
876
886
|
</div>
|
877
|
-
<h2 id="_troubleshooting">
|
887
|
+
<h2 id="_troubleshooting">5. Troubleshooting</h2>
|
878
888
|
<div class="sectionbody">
|
879
|
-
<h3 id="
|
880
|
-
<h4 id="
|
889
|
+
<h3 id="_operating_system_specific_problems">5.1. Operating system-specific problems</h3><div style="clear:left"></div>
|
890
|
+
<h4 id="_macos_x_the_installer_cannot_locate_mamp_s_apache">5.1.1. MacOS X: The installer cannot locate MAMP's Apache</h4>
|
891
|
+
<div class="sidebarblock">
|
892
|
+
<div class="sidebar-content">
|
893
|
+
<div class="sidebar-title">Symptoms</div>
|
894
|
+
<div class="para"><p>The installer finds Apache 2 development headers at <tt>/Applications/MAMP/Library/bin/apxs</tt>.
|
895
|
+
However, Apache cannot be found. The installer also outputs the following error:</p></div>
|
896
|
+
<div class="listingblock">
|
897
|
+
<div class="content">
|
898
|
+
<pre><tt>cannot open /Applications/MAMP/Library/build/config_vars.mk:
|
899
|
+
No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.</tt></pre>
|
900
|
+
</div></div>
|
901
|
+
</div></div>
|
902
|
+
<div class="para"><p>Your MAMP installation seems to be broken. In particular, <em>config_vars.mk</em> is missing.
|
903
|
+
Please read <a href="http://forum.mamp.info/viewtopic.php?t=1866">this forum topic</a> to learn how
|
904
|
+
to fix this problem.</p></div>
|
905
|
+
<div class="para"><p>See also <a href="http://code.google.com/p/phusion-passenger/issues/detail?id=12">this bug report</a>.</p></div>
|
906
|
+
<h3 id="_problems_during_installation">5.2. Problems during installation</h3><div style="clear:left"></div>
|
907
|
+
<h4 id="installing_ruby_dev">5.2.1. Ruby development headers aren't installed</h4>
|
881
908
|
<div class="sidebarblock">
|
882
909
|
<div class="sidebar-content">
|
883
910
|
<div class="sidebar-title">Symptoms</div>
|
@@ -970,7 +997,7 @@ installation you want to use. Please read
|
|
970
997
|
<a href="#specifying_ruby_installation">Specifying the correct Ruby installation</a>.</td>
|
971
998
|
</tr></table>
|
972
999
|
</div>
|
973
|
-
<h4 id="_apache_development_headers_aren_t_installed">
|
1000
|
+
<h4 id="_apache_development_headers_aren_t_installed">5.2.2. Apache development headers aren't installed</h4>
|
974
1001
|
<div class="sidebarblock">
|
975
1002
|
<div class="sidebar-content">
|
976
1003
|
<div class="sidebar-title">Symptoms</div>
|
@@ -1055,7 +1082,7 @@ Other operating systems
|
|
1055
1082
|
</p>
|
1056
1083
|
</dd>
|
1057
1084
|
</dl></div>
|
1058
|
-
<h4 id="_apr_development_headers_aren_t_installed">
|
1085
|
+
<h4 id="_apr_development_headers_aren_t_installed">5.2.3. APR development headers aren't installed</h4>
|
1059
1086
|
<div class="sidebarblock">
|
1060
1087
|
<div class="sidebar-content">
|
1061
1088
|
<div class="sidebar-title">Symptoms</div>
|
@@ -1135,11 +1162,11 @@ Other operating systems
|
|
1135
1162
|
</p>
|
1136
1163
|
</dd>
|
1137
1164
|
</dl></div>
|
1138
|
-
<h4 id="_passenger_is_using_the_wrong_apache_during_installation">
|
1165
|
+
<h4 id="_passenger_is_using_the_wrong_apache_during_installation">5.2.4. Passenger is using the wrong Apache during installation</h4>
|
1139
1166
|
<div class="para"><p>Please <a href="#specifying_correct_apache_install">Specifying the correct Apache installation</a>, and re-run the Passenger installer.</p></div>
|
1140
|
-
<h4 id="_passenger_is_using_the_wrong_ruby_during_installation">
|
1167
|
+
<h4 id="_passenger_is_using_the_wrong_ruby_during_installation">5.2.5. Passenger is using the wrong Ruby during installation</h4>
|
1141
1168
|
<div class="para"><p>Please <a href="#specifying_ruby_installation">Specifying the correct Ruby installation</a>, and re-run the Passenger installer.</p></div>
|
1142
|
-
<h3 id="_problems_after_installation">
|
1169
|
+
<h3 id="_problems_after_installation">5.3. Problems after installation</h3><div style="clear:left"></div>
|
1143
1170
|
<div class="admonitionblock">
|
1144
1171
|
<table><tr>
|
1145
1172
|
<td class="icon">
|
@@ -1153,7 +1180,7 @@ inside the Apache error logs. It will tell you what exactly went wrong.</p></div
|
|
1153
1180
|
</td>
|
1154
1181
|
</tr></table>
|
1155
1182
|
</div>
|
1156
|
-
<h4 id="_passenger_has_been_compiled_against_the_wrong_apache_installation">
|
1183
|
+
<h4 id="_passenger_has_been_compiled_against_the_wrong_apache_installation">5.3.1. Passenger has been compiled against the wrong Apache installation</h4>
|
1157
1184
|
<div class="sidebarblock">
|
1158
1185
|
<div class="sidebar-content">
|
1159
1186
|
<div class="sidebar-title">Symptoms</div>
|
@@ -1163,7 +1190,39 @@ says “<em>seg fault or similar nasty error detected in the parent process&
|
|
1163
1190
|
<div class="para"><p>This problem is most likely to occur on MacOS X. Most OS X users have multiple
|
1164
1191
|
Apache installations on their system.</p></div>
|
1165
1192
|
<div class="para"><p>To solve this problem, please <a href="#specifying_correct_apache_install">specify the correct Apache installation</a>, and <a href="#install_passenger">reinstall Passenger</a>.</p></div>
|
1166
|
-
<h4 id="
|
1193
|
+
<h4 id="_i_get_a_304_forbidden_error">5.3.2. I get a "304 Forbidden" error</h4>
|
1194
|
+
<div class="para"><p>See next subsection.</p></div>
|
1195
|
+
<h4 id="_static_assets_such_as_images_and_stylesheets_aren_t_being_displayed">5.3.3. Static assets such as images and stylesheets aren't being displayed</h4>
|
1196
|
+
<div class="para"><p>Static assets are accelerated, i.e. they are served directly by Apache and do not
|
1197
|
+
go through the Rails stack. There are two reasons why Apache doesn't serve static
|
1198
|
+
assets correctly:</p></div>
|
1199
|
+
<div class="olist"><ol>
|
1200
|
+
<li>
|
1201
|
+
<p>
|
1202
|
+
Your Apache configuration is too strict, and does not allow HTTP clients to
|
1203
|
+
access static assets. This can be achieved with an <tt>Allow from all</tt> directive
|
1204
|
+
in the correct place. For example:
|
1205
|
+
</p>
|
1206
|
+
<div class="listingblock">
|
1207
|
+
<div class="content">
|
1208
|
+
<pre><tt><Directory "/webapps/mycook/public">
|
1209
|
+
Options FollowSymLinks
|
1210
|
+
AllowOverride None
|
1211
|
+
Order allow,deny
|
1212
|
+
Allow from all
|
1213
|
+
</Directory></tt></pre>
|
1214
|
+
</div></div>
|
1215
|
+
<div class="para"><p>See also <a href="http://groups.google.com/group/phusion-passenger/browse_thread/thread/9699a639a87f85f4/b9d71a03bf2670a5">this discussion</a>.</p></div>
|
1216
|
+
</li>
|
1217
|
+
<li>
|
1218
|
+
<p>
|
1219
|
+
The Apache process doesn't have permission to access your Rails application's folder.
|
1220
|
+
Please make sure that the Rails application's folder, as well as all of its parent folders,
|
1221
|
+
have the correct permissions and/or ownerships.
|
1222
|
+
</p>
|
1223
|
+
</li>
|
1224
|
+
</ol></div>
|
1225
|
+
<h4 id="_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it">5.3.4. The Apache error log says that the spawn manager script does not exist, or that it does not have permission to execute it</h4>
|
1167
1226
|
<div class="para"><p>If you are sure that the RailsSpawnServer configuration option is set correctly,
|
1168
1227
|
then this problem is most likely caused by the fact that you're running Apache
|
1169
1228
|
with SELinux. On Fedora, CentOS and RedHat Enterprise Linux, Apache is locked
|
@@ -1173,26 +1232,20 @@ folders, so that Apache can access them.</p></div>
|
|
1173
1232
|
<div class="ilist"><ul>
|
1174
1233
|
<li>
|
1175
1234
|
<p>
|
1176
|
-
If you've installed Passenger via a gem, then
|
1177
|
-
|
1235
|
+
If you've installed Passenger via a gem, then run this command to determine
|
1236
|
+
Passenger's root folder:
|
1178
1237
|
</p>
|
1179
1238
|
<div class="listingblock">
|
1180
1239
|
<div class="content">
|
1181
|
-
<pre><tt>
|
1182
|
-
</div></div>
|
1183
|
-
<div class="para"><p>It should show something along the lines of:</p></div>
|
1184
|
-
<div class="listingblock">
|
1185
|
-
<div class="content">
|
1186
|
-
<pre><tt> - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8</tt></pre>
|
1240
|
+
<pre><tt>passenger-config --root</tt></pre>
|
1187
1241
|
</div></div>
|
1188
|
-
<div class="para"><p>
|
1189
|
-
Next, we'll fix the Passenger folder permissions as follows:</p></div>
|
1242
|
+
<div class="para"><p>Next, run the following command:</p></div>
|
1190
1243
|
<div class="listingblock">
|
1191
1244
|
<div class="content">
|
1192
|
-
<pre><tt>
|
1193
|
-
cd gems
|
1194
|
-
chcon -R -h -t httpd_sys_content_t passenger-*</tt></pre>
|
1245
|
+
<pre><tt>chcon -R -h -t httpd_sys_content_t /path-to-passenger-root</tt></pre>
|
1195
1246
|
</div></div>
|
1247
|
+
<div class="para"><p>where <em>/path-to-passenger-root</em> should be replaced with whatever
|
1248
|
+
<tt>passenger-config —root</tt> printed.</p></div>
|
1196
1249
|
</li>
|
1197
1250
|
<li>
|
1198
1251
|
<p>
|
@@ -1206,7 +1259,7 @@ If you've installed Passenger via the source tarball, then run the following
|
|
1206
1259
|
</li>
|
1207
1260
|
</ul></div>
|
1208
1261
|
<div class="para"><p>Once the permissions are fixed, restart Apache.</p></div>
|
1209
|
-
<
|
1262
|
+
<h4 id="_the_rails_application_reports_that_it_s_unable_to_start_because_of_a_permission_error">5.3.5. The Rails application reports that it's unable to start because of a permission error</h4>
|
1210
1263
|
<div class="para"><p>Please check whether your Rails application's folder has the correct
|
1211
1264
|
permissions. By default, Rails applications are started as the owner of the
|
1212
1265
|
file <em>config/environment.rb</em>, except if the file is owned by root. If the
|
@@ -1214,10 +1267,63 @@ file is owned by root, then the Rails application will be started as <em>nobody<
|
|
1214
1267
|
(or as the user specify by <a href="#RailsDefaultUser">RailsDefaultUser</a>, if that's
|
1215
1268
|
specified).</p></div>
|
1216
1269
|
<div class="para"><p>Please read <a href="#user_switching">User switching (security)</a> for details.</p></div>
|
1270
|
+
<h4 id="_my_rails_application_s_log_file_is_not_being_written_to">5.3.6. My Rails application's log file is not being written to</h4>
|
1271
|
+
<div class="para"><p>There are a couple things that you should be aware of:</p></div>
|
1272
|
+
<div class="ilist"><ul>
|
1273
|
+
<li>
|
1274
|
+
<p>
|
1275
|
+
By default, Passenger runs Rails applications in <em>production</em> mode, so please
|
1276
|
+
be sure to check <em>production.log</em> instead of <em>development.log</em>. See
|
1277
|
+
<a href="#RailsEnv">RailsEnv</a> for configuration.
|
1278
|
+
</p>
|
1279
|
+
</li>
|
1280
|
+
<li>
|
1281
|
+
<p>
|
1282
|
+
By default, Passenger runs Rails applications as the owner of <em>environment.rb</em>.
|
1283
|
+
So the log file can only be written to if that user has write permission to the
|
1284
|
+
log file. Please <em>chmod</em> or <em>chown</em> your log file accordingly.
|
1285
|
+
</p>
|
1286
|
+
<div class="para"><p>See <a href="#User_switching">User switching (security)</a> for details.</p></div>
|
1287
|
+
</li>
|
1288
|
+
</ul></div>
|
1289
|
+
<div class="para"><p>If you're using a RedHat-derived Linux distribution (such as Fedora or CentOS)
|
1290
|
+
then it is <a href="http://code.google.com/p/phusion-passenger/issues/detail?id=4">possible
|
1291
|
+
that SELinux is interfering</a>. RedHat's SELinux policy only allows Apache to read/write
|
1292
|
+
directories that have the <em>httpd_sys_content_t</em> security context. Please run the
|
1293
|
+
following command to give your Rails application folder that context:</p></div>
|
1294
|
+
<div class="listingblock">
|
1295
|
+
<div class="content">
|
1296
|
+
<pre><tt>chcon -R -h -t httpd_sys_content_t /path/to/your/rails/app</tt></pre>
|
1297
|
+
</div></div>
|
1298
|
+
<h3 id="conflicting_apache_modules">5.4. Conflicting Apache modules</h3><div style="clear:left"></div>
|
1299
|
+
<h4 id="_mod_rewrite_and_mod_alias">5.4.1. mod_rewrite and mod_alias</h4>
|
1300
|
+
<div class="para"><p>Passenger conflicts with <em>mod_rewrite</em> and <em>mod_alias</em>. Those modules may be
|
1301
|
+
installed and loaded together with <em>mod_passenger</em>, and they will work fine
|
1302
|
+
outside virtual hosts that contain a Rails application, but we recommend you
|
1303
|
+
not to use their features inside virtual hosts that contain a Rails
|
1304
|
+
application.</p></div>
|
1305
|
+
<div class="para"><p>By default, Passenger will override mod_rewrite rules on Rails hosts. This is
|
1306
|
+
because the default .htaccess, as provided by Ruby on Rails, redirects all
|
1307
|
+
requests to `dispatch.cgi' using mod_rewrite. This is a CGI application which
|
1308
|
+
loads the entire Ruby on Rails framework for every request, and thus is very
|
1309
|
+
slow. If we do not override mod_rewrite, then Ruby on Rails apps will be slow
|
1310
|
+
on Passenger by default — but we want a good out-of-the-box experience.</p></div>
|
1311
|
+
<div class="para"><p>Furthermore, the primary reason why people use mod_rewrite with Rails
|
1312
|
+
applications, is to accelerate page caching. Passenger supports page caching
|
1313
|
+
out-of-the-box, without mod_rewrite.</p></div>
|
1314
|
+
<div class="para"><p>It is not fully understood how mod_alias conflicts with Passenger, but we
|
1315
|
+
recommend you not to use it on Rails virtual hosts. mod_alias rules can result
|
1316
|
+
in surprising problems.</p></div>
|
1317
|
+
<div class="para"><p>If you really want to use mod_rewrite on Rails virtual hosts, then please set
|
1318
|
+
the <a href="#RailsAllowModRewrite">RailsAllowModRewrite</a> configuration option. But
|
1319
|
+
please note that you will have to delete Rails applications' default .htaccess
|
1320
|
+
file, or add rewrite rules to negate its effects.</p></div>
|
1321
|
+
<h4 id="_mod_userdir">5.4.2. mod_userdir</h4>
|
1322
|
+
<div class="para"><p><em>mod_userdir</em> is not compatible with Phusion Passenger at the moment.</p></div>
|
1217
1323
|
</div>
|
1218
|
-
<h2 id="_tips_and_notes">
|
1324
|
+
<h2 id="_tips_and_notes">6. Tips and notes</h2>
|
1219
1325
|
<div class="sectionbody">
|
1220
|
-
<h3 id="user_switching">
|
1326
|
+
<h3 id="user_switching">6.1. User switching (security)</h3><div style="clear:left"></div>
|
1221
1327
|
<div class="para"><p>There is a problem that plagues most PHP web host, namely the fact that all PHP
|
1222
1328
|
applications are run in the same user context as the web server. So for
|
1223
1329
|
example, Joe's PHP application will be able to read Jane's PHP application's
|
@@ -1252,11 +1358,11 @@ Under no circumstances will Rails applications be run as <em>root</em>. If
|
|
1252
1358
|
</ul></div>
|
1253
1359
|
<div class="para"><p>User switching can be disabled with the
|
1254
1360
|
<a href="#RailsUserSwitching">RailsUserSwitching</a> option.</p></div>
|
1255
|
-
<h3 id="reducing_memory_usage">
|
1361
|
+
<h3 id="reducing_memory_usage">6.2. Reducing memory consumption of Ruby on Rails apps by 33%</h3><div style="clear:left"></div>
|
1256
1362
|
<div class="para"><p>Is it possible to reduce memory consumption of your Rails apps by 33% on average,
|
1257
1363
|
by using <a href="http://www.rubyenterpriseedition.com/">Ruby Enterprise Edition</a>.
|
1258
1364
|
Please visit the website for details.</p></div>
|
1259
|
-
<h3 id="_moving_passenger_to_a_different_directory">
|
1365
|
+
<h3 id="_moving_passenger_to_a_different_directory">6.3. Moving Passenger to a different directory</h3><div style="clear:left"></div>
|
1260
1366
|
<div class="para"><p>It is possible to relocate the Passenger files to a different directory. It
|
1261
1367
|
involves two steps:</p></div>
|
1262
1368
|
<div class="olist"><ol>
|
@@ -1293,7 +1399,7 @@ Edit your Apache configuration file, and set:
|
|
1293
1399
|
</div></div>
|
1294
1400
|
</li>
|
1295
1401
|
</ol></div>
|
1296
|
-
<h3 id="_installing_multiple_ruby_on_rails_versions">
|
1402
|
+
<h3 id="_installing_multiple_ruby_on_rails_versions">6.4. Installing multiple Ruby on Rails versions</h3><div style="clear:left"></div>
|
1297
1403
|
<div class="para"><p>Each Ruby on Rails applications that are going to be deployed may require a
|
1298
1404
|
specific Ruby on Rails version. You can install a specific version with
|
1299
1405
|
this command:</p></div>
|
@@ -1304,33 +1410,11 @@ this command:</p></div>
|
|
1304
1410
|
<div class="para"><p>where <em>X.X.X</em> is the version number of Ruby on Rails.</p></div>
|
1305
1411
|
<div class="para"><p>All of these versions will exist in parallel, and will not conflict with each
|
1306
1412
|
other. Passenger will automatically make use of the correct version.</p></div>
|
1307
|
-
<h3 id="_x_sendfile_support">
|
1413
|
+
<h3 id="_x_sendfile_support">6.5. X-Sendfile support</h3><div style="clear:left"></div>
|
1308
1414
|
<div class="para"><p>Passenger does not provide X-Sendfile support by itself. Please install
|
1309
1415
|
<a href="http://tn123.ath.cx/mod_xsendfile/">mod_xsendfile</a> for X-Sendfile support.</p></div>
|
1310
|
-
<h3 id="conflicting_apache_modules">5.6. Conflicting Apache modules</h3><div style="clear:left"></div>
|
1311
|
-
<div class="para"><p>Passenger conflicts with <em>mod_rewrite</em> and <em>mod_alias</em>. Those modules may be
|
1312
|
-
installed and loaded together with <em>mod_passenger</em>, and they will work fine
|
1313
|
-
outside virtual hosts that contain a Rails application, but we recommend you
|
1314
|
-
not to use their features inside virtual hosts that contain a Rails
|
1315
|
-
application.</p></div>
|
1316
|
-
<div class="para"><p>By default, Passenger will override mod_rewrite rules on Rails hosts. This is
|
1317
|
-
because the default .htaccess, as provided by Ruby on Rails, redirects all
|
1318
|
-
requests to `dispatch.cgi' using mod_rewrite. This is a CGI application which
|
1319
|
-
loads the entire Ruby on Rails framework for every request, and thus is very
|
1320
|
-
slow. If we do not override mod_rewrite, then Ruby on Rails apps will be slow
|
1321
|
-
on Passenger by default — but we want a good out-of-the-box experience.</p></div>
|
1322
|
-
<div class="para"><p>Furthermore, the primary reason why people use mod_rewrite with Rails
|
1323
|
-
applications, is to accelerate page caching. Passenger supports page caching
|
1324
|
-
out-of-the-box, without mod_rewrite.</p></div>
|
1325
|
-
<div class="para"><p>It is not fully understood how mod_alias conflicts with Passenger, but we
|
1326
|
-
recommend you not to use it on Rails virtual hosts. mod_alias rules can result
|
1327
|
-
in surprising problems.</p></div>
|
1328
|
-
<div class="para"><p>If you really want to use mod_rewrite on Rails virtual hosts, then please set
|
1329
|
-
the <a href="#RailsAllowModRewrite">RailsAllowModRewrite</a> configuration option. But
|
1330
|
-
please note that you will have to delete Rails applications' default .htaccess
|
1331
|
-
file, or add rewrite rules to negate its effects.</p></div>
|
1332
1416
|
</div>
|
1333
|
-
<h2 id="_appendix_a_about_this_document">
|
1417
|
+
<h2 id="_appendix_a_about_this_document">7. Appendix A: About this document</h2>
|
1334
1418
|
<div class="sectionbody">
|
1335
1419
|
<div class="para"><p>The text of this document is licensed under the
|
1336
1420
|
<a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons
|
@@ -1349,7 +1433,7 @@ Attribution-Share Alike 3.0 Unported License</a>.</p></div>
|
|
1349
1433
|
</div>
|
1350
1434
|
<div id="footer">
|
1351
1435
|
<div id="footer-text">
|
1352
|
-
Last updated 2008-04-
|
1436
|
+
Last updated 2008-04-29 15:25:34 CEST
|
1353
1437
|
</div>
|
1354
1438
|
</div>
|
1355
1439
|
</body>
|
data/doc/Users guide.txt
CHANGED
@@ -17,9 +17,7 @@ This guide assumes that the reader is somewhat familiar with Apache and with
|
|
17
17
|
using the commandline.
|
18
18
|
|
19
19
|
|
20
|
-
==
|
21
|
-
|
22
|
-
=== Supported operating systems ===
|
20
|
+
== Supported operating systems ==
|
23
21
|
|
24
22
|
Passenger works on any POSIX-compliant operating system. In other words:
|
25
23
|
practically any operating system on earth, except Microsoft Windows.
|
@@ -45,8 +43,13 @@ or
|
|
45
43
|
link:http://groups.google.com/group/phusion-passenger[join our discussion list]
|
46
44
|
if it doesn't.
|
47
45
|
|
46
|
+
|
47
|
+
== Installing Passenger ==
|
48
|
+
|
49
|
+
=== Generic installation instructions ===
|
50
|
+
|
48
51
|
[[install_passenger]]
|
49
|
-
|
52
|
+
==== Overview of download and installation methods ====
|
50
53
|
|
51
54
|
There are two ways to install Passenger:
|
52
55
|
|
@@ -65,7 +68,7 @@ as 'root'. If the installer fails because of permission errors, it will tell
|
|
65
68
|
you.
|
66
69
|
|
67
70
|
[[specifying_correct_apache_install]]
|
68
|
-
|
71
|
+
==== Specifying the correct Apache installation ====
|
69
72
|
|
70
73
|
If your system has multiple Apache installations (this is likely the case on
|
71
74
|
MacOS X), then you will need to tell the Passenger installer which one to use.
|
@@ -85,7 +88,7 @@ NOTE: On some systems, the `apxs` program might be called `apxs2`, and it might
|
|
85
88
|
be located in the `sbin` folder instead of the `bin` folder.
|
86
89
|
|
87
90
|
[[specifying_ruby_installation]]
|
88
|
-
|
91
|
+
==== Specifying the correct Ruby installation ====
|
89
92
|
|
90
93
|
If your system has multiple Ruby installations (this is likely the case on
|
91
94
|
MacOS X), then you will need to tell the Passenger installer which one to use.
|
@@ -106,7 +109,7 @@ export PATH=/opt/myruby/bin:$PATH
|
|
106
109
|
----------------------------------
|
107
110
|
|
108
111
|
|
109
|
-
|
112
|
+
==== Installing via the gem ====
|
110
113
|
|
111
114
|
Please install the gem and then run the Passenger installer, by typing the
|
112
115
|
following commands:
|
@@ -116,7 +119,7 @@ passenger-install-apache2-module
|
|
116
119
|
------------------------------------------------------
|
117
120
|
Please follow the instructions given by the installer.
|
118
121
|
|
119
|
-
|
122
|
+
==== Installing via the source tarball ====
|
120
123
|
|
121
124
|
Extract the tarball to whatever location you prefer. The Passenger files
|
122
125
|
are to reside in that location permanently. For example, if you would like
|
@@ -136,6 +139,19 @@ IMPORTANT: Please do not remove the 'passenger-x.x.x' folder after
|
|
136
139
|
installation. Furthermore, the 'passenger-x.x.x' folder must be accessible by Apache.
|
137
140
|
|
138
141
|
|
142
|
+
=== Operating system-specific instructions and information ===
|
143
|
+
|
144
|
+
==== MacOS X ====
|
145
|
+
|
146
|
+
Ben Ruebenstein has written an excellent
|
147
|
+
link:http://benr75.com/articles/2008/04/12/setup-mod_rails-phusion-mac-os-x-leopard[tutorial
|
148
|
+
on installing Phusion Passenger on OS X].
|
149
|
+
|
150
|
+
==== Ubuntu Linux ====
|
151
|
+
|
152
|
+
Ben Hughes has written an link:http://www.railsgarden.com/2008/04/12/configurating-passenger-mod_rails-on-slicehost-with-ubuntu-710/[article on installing Passenger on Ubuntu].
|
153
|
+
|
154
|
+
|
139
155
|
== Deploying a Ruby on Rails application ==
|
140
156
|
|
141
157
|
Suppose you have a Ruby on Rails application in '/webapps/mycook', and you own
|
@@ -355,6 +371,27 @@ The default value is 'nobody'.
|
|
355
371
|
|
356
372
|
== Troubleshooting ==
|
357
373
|
|
374
|
+
=== Operating system-specific problems ===
|
375
|
+
|
376
|
+
==== MacOS X: The installer cannot locate MAMP's Apache ====
|
377
|
+
|
378
|
+
.Symptoms
|
379
|
+
*******************************************************************************
|
380
|
+
The installer finds Apache 2 development headers at `/Applications/MAMP/Library/bin/apxs`.
|
381
|
+
However, Apache cannot be found. The installer also outputs the following error:
|
382
|
+
------------------------------------
|
383
|
+
cannot open /Applications/MAMP/Library/build/config_vars.mk:
|
384
|
+
No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.
|
385
|
+
------------------------------------
|
386
|
+
*******************************************************************************
|
387
|
+
|
388
|
+
Your MAMP installation seems to be broken. In particular, 'config_vars.mk' is missing.
|
389
|
+
Please read link:http://forum.mamp.info/viewtopic.php?t=1866[this forum topic] to learn how
|
390
|
+
to fix this problem.
|
391
|
+
|
392
|
+
See also link:http://code.google.com/p/phusion-passenger/issues/detail?id=12[this bug report].
|
393
|
+
|
394
|
+
|
358
395
|
=== Problems during installation ===
|
359
396
|
|
360
397
|
[[installing_ruby_dev]]
|
@@ -533,6 +570,35 @@ Apache installations on their system.
|
|
533
570
|
To solve this problem, please <<specifying_correct_apache_install,specify the
|
534
571
|
correct Apache installation>>, and <<install_passenger,reinstall Passenger>>.
|
535
572
|
|
573
|
+
==== I get a "304 Forbidden" error ====
|
574
|
+
|
575
|
+
See next subsection.
|
576
|
+
|
577
|
+
==== Static assets such as images and stylesheets aren't being displayed ====
|
578
|
+
|
579
|
+
Static assets are accelerated, i.e. they are served directly by Apache and do not
|
580
|
+
go through the Rails stack. There are two reasons why Apache doesn't serve static
|
581
|
+
assets correctly:
|
582
|
+
|
583
|
+
1. Your Apache configuration is too strict, and does not allow HTTP clients to
|
584
|
+
access static assets. This can be achieved with an `Allow from all` directive
|
585
|
+
in the correct place. For example:
|
586
|
+
+
|
587
|
+
-----------------------------------------
|
588
|
+
<Directory "/webapps/mycook/public">
|
589
|
+
Options FollowSymLinks
|
590
|
+
AllowOverride None
|
591
|
+
Order allow,deny
|
592
|
+
Allow from all
|
593
|
+
</Directory>
|
594
|
+
-----------------------------------------
|
595
|
+
+
|
596
|
+
See also link:http://groups.google.com/group/phusion-passenger/browse_thread/thread/9699a639a87f85f4/b9d71a03bf2670a5[this discussion].
|
597
|
+
|
598
|
+
2. The Apache process doesn't have permission to access your Rails application's folder.
|
599
|
+
Please make sure that the Rails application's folder, as well as all of its parent folders,
|
600
|
+
have the correct permissions and/or ownerships.
|
601
|
+
|
536
602
|
==== The Apache error log says that the spawn manager script does not exist, or that it does not have permission to execute it ====
|
537
603
|
|
538
604
|
If you are sure that the RailsSpawnServer configuration option is set correctly,
|
@@ -543,27 +609,22 @@ down by SELinux policies.
|
|
543
609
|
To solve this problem, you must set some permissions on the Passenger files and
|
544
610
|
folders, so that Apache can access them.
|
545
611
|
|
546
|
-
- If you've installed Passenger via a gem, then
|
547
|
-
|
612
|
+
- If you've installed Passenger via a gem, then run this command to determine
|
613
|
+
Passenger's root folder:
|
548
614
|
+
|
549
615
|
------------------------------------------------------------------
|
550
|
-
|
616
|
+
passenger-config --root
|
551
617
|
------------------------------------------------------------------
|
552
618
|
+
|
553
|
-
|
619
|
+
Next, run the following command:
|
554
620
|
+
|
555
621
|
------------------------------------------------------------------
|
556
|
-
|
622
|
+
chcon -R -h -t httpd_sys_content_t /path-to-passenger-root
|
557
623
|
------------------------------------------------------------------
|
558
624
|
+
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
------------------------------------------------------------------
|
563
|
-
cd /usr/lib/ruby/gems/1.8 # Replace this with whatever your gem folder is.
|
564
|
-
cd gems
|
565
|
-
chcon -R -h -t httpd_sys_content_t passenger-*
|
566
|
-
------------------------------------------------------------------
|
625
|
+
where '/path-to-passenger-root' should be replaced with whatever
|
626
|
+
`passenger-config --root` printed.
|
627
|
+
|
567
628
|
- If you've installed Passenger via the source tarball, then run the following
|
568
629
|
command:
|
569
630
|
+
|
@@ -573,7 +634,7 @@ chcon -R -h -t httpd_sys_content_t /path/to/passenger/folder
|
|
573
634
|
|
574
635
|
Once the permissions are fixed, restart Apache.
|
575
636
|
|
576
|
-
|
637
|
+
==== The Rails application reports that it's unable to start because of a permission error ====
|
577
638
|
|
578
639
|
Please check whether your Rails application's folder has the correct
|
579
640
|
permissions. By default, Rails applications are started as the owner of the
|
@@ -584,6 +645,64 @@ specified).
|
|
584
645
|
|
585
646
|
Please read <<user_switching,User switching (security)>> for details.
|
586
647
|
|
648
|
+
==== My Rails application's log file is not being written to ====
|
649
|
+
|
650
|
+
There are a couple things that you should be aware of:
|
651
|
+
|
652
|
+
- By default, Passenger runs Rails applications in 'production' mode, so please
|
653
|
+
be sure to check 'production.log' instead of 'development.log'. See
|
654
|
+
<<RailsEnv,RailsEnv>> for configuration.
|
655
|
+
- By default, Passenger runs Rails applications as the owner of 'environment.rb'.
|
656
|
+
So the log file can only be written to if that user has write permission to the
|
657
|
+
log file. Please 'chmod' or 'chown' your log file accordingly.
|
658
|
+
+
|
659
|
+
See <<User_switching,User switching (security)>> for details.
|
660
|
+
|
661
|
+
If you're using a RedHat-derived Linux distribution (such as Fedora or CentOS)
|
662
|
+
then it is link:http://code.google.com/p/phusion-passenger/issues/detail?id=4[possible
|
663
|
+
that SELinux is interfering]. RedHat's SELinux policy only allows Apache to read/write
|
664
|
+
directories that have the 'httpd_sys_content_t' security context. Please run the
|
665
|
+
following command to give your Rails application folder that context:
|
666
|
+
|
667
|
+
-----------------------------------------------------------
|
668
|
+
chcon -R -h -t httpd_sys_content_t /path/to/your/rails/app
|
669
|
+
-----------------------------------------------------------
|
670
|
+
|
671
|
+
[[conflicting_apache_modules]]
|
672
|
+
=== Conflicting Apache modules ===
|
673
|
+
|
674
|
+
==== mod_rewrite and mod_alias ====
|
675
|
+
|
676
|
+
Passenger conflicts with 'mod_rewrite' and 'mod_alias'. Those modules may be
|
677
|
+
installed and loaded together with 'mod_passenger', and they will work fine
|
678
|
+
outside virtual hosts that contain a Rails application, but we recommend you
|
679
|
+
not to use their features inside virtual hosts that contain a Rails
|
680
|
+
application.
|
681
|
+
|
682
|
+
By default, Passenger will override mod_rewrite rules on Rails hosts. This is
|
683
|
+
because the default .htaccess, as provided by Ruby on Rails, redirects all
|
684
|
+
requests to `dispatch.cgi' using mod_rewrite. This is a CGI application which
|
685
|
+
loads the entire Ruby on Rails framework for every request, and thus is very
|
686
|
+
slow. If we do not override mod_rewrite, then Ruby on Rails apps will be slow
|
687
|
+
on Passenger by default -- but we want a good out-of-the-box experience.
|
688
|
+
|
689
|
+
Furthermore, the primary reason why people use mod_rewrite with Rails
|
690
|
+
applications, is to accelerate page caching. Passenger supports page caching
|
691
|
+
out-of-the-box, without mod_rewrite.
|
692
|
+
|
693
|
+
It is not fully understood how mod_alias conflicts with Passenger, but we
|
694
|
+
recommend you not to use it on Rails virtual hosts. mod_alias rules can result
|
695
|
+
in surprising problems.
|
696
|
+
|
697
|
+
If you really want to use mod_rewrite on Rails virtual hosts, then please set
|
698
|
+
the <<RailsAllowModRewrite,RailsAllowModRewrite>> configuration option. But
|
699
|
+
please note that you will have to delete Rails applications' default .htaccess
|
700
|
+
file, or add rewrite rules to negate its effects.
|
701
|
+
|
702
|
+
==== mod_userdir ====
|
703
|
+
|
704
|
+
'mod_userdir' is not compatible with Phusion Passenger at the moment.
|
705
|
+
|
587
706
|
|
588
707
|
== Tips and notes ==
|
589
708
|
|
@@ -663,35 +782,6 @@ other. Passenger will automatically make use of the correct version.
|
|
663
782
|
Passenger does not provide X-Sendfile support by itself. Please install
|
664
783
|
link:http://tn123.ath.cx/mod_xsendfile/[mod_xsendfile] for X-Sendfile support.
|
665
784
|
|
666
|
-
[[conflicting_apache_modules]]
|
667
|
-
=== Conflicting Apache modules ===
|
668
|
-
|
669
|
-
Passenger conflicts with 'mod_rewrite' and 'mod_alias'. Those modules may be
|
670
|
-
installed and loaded together with 'mod_passenger', and they will work fine
|
671
|
-
outside virtual hosts that contain a Rails application, but we recommend you
|
672
|
-
not to use their features inside virtual hosts that contain a Rails
|
673
|
-
application.
|
674
|
-
|
675
|
-
By default, Passenger will override mod_rewrite rules on Rails hosts. This is
|
676
|
-
because the default .htaccess, as provided by Ruby on Rails, redirects all
|
677
|
-
requests to `dispatch.cgi' using mod_rewrite. This is a CGI application which
|
678
|
-
loads the entire Ruby on Rails framework for every request, and thus is very
|
679
|
-
slow. If we do not override mod_rewrite, then Ruby on Rails apps will be slow
|
680
|
-
on Passenger by default -- but we want a good out-of-the-box experience.
|
681
|
-
|
682
|
-
Furthermore, the primary reason why people use mod_rewrite with Rails
|
683
|
-
applications, is to accelerate page caching. Passenger supports page caching
|
684
|
-
out-of-the-box, without mod_rewrite.
|
685
|
-
|
686
|
-
It is not fully understood how mod_alias conflicts with Passenger, but we
|
687
|
-
recommend you not to use it on Rails virtual hosts. mod_alias rules can result
|
688
|
-
in surprising problems.
|
689
|
-
|
690
|
-
If you really want to use mod_rewrite on Rails virtual hosts, then please set
|
691
|
-
the <<RailsAllowModRewrite,RailsAllowModRewrite>> configuration option. But
|
692
|
-
please note that you will have to delete Rails applications' default .htaccess
|
693
|
-
file, or add rewrite rules to negate its effects.
|
694
|
-
|
695
785
|
|
696
786
|
== Appendix A: About this document ==
|
697
787
|
|