Passenger 2.0.4 + Rails 2.2.2 + Centos 5.2 (Xen) = Help needed...

137 views
Skip to first unread message

dlepage

unread,
Dec 4, 2008, 2:42:08 PM12/4/08
to Phusion Passenger Discussions
Application does not start at all...

Centos 5.2 , 2.6.18-92.1.13.el5xen (Xen)
Apache Server version: Apache/2.2.3
Passenger 2.0.4
Rails 2.2.2

mod_rails.conf (apache)
...
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/
passenger-2.0.4/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.4
PassengerRuby /usr/bin/ruby
PassengerMaxPoolSize 1


Result :
...
[ pid=26527 file=Hooks.cpp:626 time=12/04/08 14:22:25.612 ]:
Cannot initialize Passenger in an Apache child process: Could not
connect to the ApplicationPool server: Broken pipe (32) (this warning
is harmless if you're currently restarting or shutting down Apache)

[ pid=26528 file=Hooks.cpp:626 time=12/04/08 14:22:25.618 ]:
Cannot initialize Passenger in an Apache child process: Could not
connect to the ApplicationPool server: Broken pipe (32) (this warning
is harmless if you're currently restarting or shutting down Apache)

dlepage

unread,
Dec 5, 2008, 4:11:10 PM12/5/08
to Phusion Passenger Discussions
now I've updated to Passenger 2.0.5, and it seems this is a permission
issue on dir /tmp. How to add permission ?

Here my error_log :

[Fri Dec 05 15:53:25 2008] [notice] mod_python: Creating 4 session
mutexes based on 256 max processes and 0 max threads.
[Fri Dec 05 15:53:25 2008] [notice] Apache/2.2.3 (CentOS) configured
-- resuming normal operations
[Fri Dec 05 16:08:05 2008] [notice] caught SIGTERM, shutting down
[Fri Dec 05 16:08:05 2008] [notice] SELinux policy enabled; httpd
running as context root:system_r:httpd_t:s0
[Fri Dec 05 16:08:05 2008] [notice] suEXEC mechanism enabled
(wrapper: /usr/sbin/suexec)
[ pid=3222 file=ApplicationPoolServer.h:535 time=12/05/08
16:08:05.241 ]:
*** WARNING: Could not create FIFO '/tmp/passenger_status.
3222.fifo': Permission denied (13)
Disabling Passenger ApplicationPool status reporting.

Lee Hambley

unread,
Dec 5, 2008, 4:17:36 PM12/5/08
to phusion-...@googlegroups.com
dlepage,

 Your Apache process doesn't have permission to write to /tmp - you are in trouble.... talk to your sysadmin, or show us the output of "ls -lah /tmp" (don't type that command before reviewing this) .. and come back to us.

- Lee

2008/12/5 dlepage <dan...@daniellepage.com>

vlod

unread,
Dec 5, 2008, 6:42:38 PM12/5/08
to Phusion Passenger Discussions
anybody getting anywhere with this? i'm also getting the same
problem.


[Sat Oct 25 04:45:34 2008] [notice] SELinux policy enabled; httpd
running as context root:system_r:httpd_t:s0
[Sat Oct 25 04:45:34 2008] [notice] suEXEC mechanism enabled
(wrapper: /usr/sbin/suexec)
[ pid=16712 file=ApplicationPoolServer.h:535 time=10/25/08
04:45:34.415 ]:
*** WARNING: Could not create FIFO '/tmp/passenger_status.
16712.fifo': Permission denied (13)
Disabling Passenger ApplicationPool status reporting.
*** Passenger ERROR: Cannot execute /usr/local/lib/ruby/gems/1.8/gems/
passenger-2.0.5/ext/apache2/ApplicationPoolServerExecutable:
Permission denied (13)

yes i have permissions in /tmp:

[root@centos logs]# touch /tmp/foo
[root@centos logs]# ls -al /tmp/foo
-rw-r--r-- 1 root root 0 Oct 25 05:24 /tmp/foo

httpd.conf entries:
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/
passenger-2.0.5/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.5
PassengerRuby /usr/local/bin/ruby

# which rails
/usr/local/bin/rails

# rails -v
Rails 2.2.2


# uname -a
Linux centos 2.6.18-92.1.13.el5 #1 SMP Wed Sep 24 19:33:52 EDT 2008
i686 i686 i386 GNU/Linux

any ideas?

/v

On Dec 5, 1:17 pm, "Lee Hambley" <lee.hamb...@gmail.com> wrote:
> dlepage,
>
>  Your Apache process doesn't have permission to write to /tmp - you are in
> trouble.... talk to your sysadmin, or show us the output of "ls -lah /tmp"
> (don't type that command before reviewing
> this<http://unixhelp.ed.ac.uk/CGI/man-cgi?ls>)

Lee Hambley

unread,
Dec 5, 2008, 6:47:00 PM12/5/08
to phusion-...@googlegroups.com
According to suexec, who is apache allowed to run as?

Can you temporarily disable suexec, and try it then?

- Lee

2008/12/5 vlod <vlod.k...@gmail.com>

vlod

unread,
Dec 5, 2008, 6:49:23 PM12/5/08
to Phusion Passenger Discussions
sorry i forget to mention ruby versions:

# which ruby
/usr/local/bin/ruby

# ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

vlod

unread,
Dec 5, 2008, 7:09:15 PM12/5/08
to Phusion Passenger Discussions
>According to suexec, who is apache allowed to run as?

Is this the way?
# /usr/sbin/suexec -V
-D AP_DOC_ROOT="/var/www"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="apache"
-D AP_LOG_EXEC="/var/log/httpd/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=500
-D AP_USERDIR_SUFFIX="public_html"

doing a:
mv /usr/sbin/suexec /usr/sbin/suexec.OLD

and restarting apache still fails:

[Fri Dec 05 08:07:42 2008] [notice] SELinux policy enabled; httpd
running as context root:system_r:httpd_t:s0
[ pid=2510 file=ApplicationPoolServer.h:535 time=12/05/08
08:07:42.122 ]:
*** WARNING: Could not create FIFO '/tmp/passenger_status.
2510.fifo': Permission denied (13)
Disabling Passenger ApplicationPool status reporting.
*** Passenger ERROR: Cannot execute /usr/local/lib/ruby/gems/1.8/gems/
passenger-2.0.5/ext/apache2/ApplicationPoolServerExecutable:
Permission denied (13)

although its not showing the:
suEXEC mechanism enabled

message.

thanks for your help

On Dec 5, 3:47 pm, "Lee Hambley" <lee.hamb...@gmail.com> wrote:
> According to suexec, who is apache allowed to run as?
>
> Can you temporarily disable
> suexec<http://httpd.apache.org/docs/2.2/suexec.html>,
> and try it then?
>
> - Lee
>
> 2008/12/5 vlod <vlod.kali...@gmail.com>

dlepage

unread,
Dec 5, 2008, 10:30:41 PM12/5/08
to Phusion Passenger Discussions
I found this is not suEXEC but SElinux that cause problem.

try to temporarily switch off enforcement :
(more info at : http://www.crypt.gen.nz/selinux/disable_selinux.html)

You can switch the system into permissive mode with the following
command

setenforce 0 (or echo 0 >/selinux/enforce) replace 0 by 1 to switch
back to enforcement)

then restart Apache
then type : passenger-status

----------- General information -----------
max = 6
count = 0
active = 0
inactive = 0
Using global queue: no
Waiting on global queue: 0

YES, Hourra, passenger is working.

By the way permissive means :

# permissive - SELinux prints warnings instead of enforcing.

Permanently Permissive

edit /etc/selinux/config

just change SELINUX=enforcing to SELINUX=permissive, and you're done.
Reboot if you want to prove it.


BUT this is not the way to solve this problem (SECURITY Concern)

I've tried this BUT without success (from Phusion Passenger users
guide - 6.3.5)

passenger-config --root
chcon -R -h -t httpd_sys_content_t /path-to-passenger-root
(where /path-to-passenger-root should be replaced with whatever
passenger-config —root printed.)

If

vlod

unread,
Dec 6, 2008, 2:08:50 AM12/6/08
to Phusion Passenger Discussions
works great! thanks for your help! :)

i'm a little confused why it doesn't fail for more people, but
whatever..

cheers.

-vlod
Reply all
Reply to author
Forward
0 new messages