# passenger\_apache2 problems

**URL:** <https://discourse.chef.io/t/passenger-apache2-problems/3998>\
**Category:** Chef Infra (archive)\
**Created:** [May 23, 2013, 8:43am UTC](https://discourse.chef.io/t/passenger-apache2-problems/3998 "2013-05-23T08:43:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeffrey\_Jones](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Jeffrey\_Jones](https://discourse.chef.io/u/Jeffrey_Jones)\
**Post date:** [May 23, 2013, 8:43am UTC](https://discourse.chef.io/t/passenger-apache2-problems/3998/1 "2013-05-23T08:43:27Z")

</div>

Hello all

I have just spent the afternoon trying to figure out why the  
passenger\_apache2 cookbook wasn’t working for me so my brain is a bit  
broken, apologies.

The setup:

I am using Vagrant (with berkshelf) and the  
[https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86\_64-minimal.box](https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86_64-minimal.box) box.

I am building ruby using the chef-ruby\_build cookbook and then  
symlinking to /usr/local/bin and /usr/bin.

I am then installing apache2 using the apache2 cookbook and attempting  
to install the passenger\_apache2 cookbook to install phusion passenger.

The passenger\_apache2 cookbook installs the gem and .so files correctly  
however the passenger.conf and passenger.load files always point to the  
embedded chef ruby locations.

After a bit of searching I found  
[http://tickets.opscode.com/browse/COOK-2293](http://tickets.opscode.com/browse/COOK-2293) which is the exact issue I  
am facing.

I have tried various methods and hacks to get it working (

> <https://gist.github.com/anonymous/3dc9e0d3413dfb973a1e>

  
) but nothing I have tried works (Including the fix from COOK-2293).

The comments on COOK-2293 don’t really seem to offer a solution either.

I have reached the end of my tether but prior to smashing something into  
little pieces, does anyone have a solution or workaround? (One that  
doesn’t involve setting default[‘passenger’][‘root\_path’] and  
default[‘passenger’][‘module\_path’] manually.)

Cheers

Jeff  
[http://tickets.opscode.com/browse/COOK-2293](http://tickets.opscode.com/browse/COOK-2293)

---

<div class="post-metadata">

**Author:** ![Cassiano\_Leal](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/cassiano_leal/32/86_2.png) [@Cassiano\_Leal](https://discourse.chef.io/u/Cassiano_Leal)\
**Post date:** [May 23, 2013, 4:03pm UTC](https://discourse.chef.io/t/passenger-apache2-problems/3998/2 "2013-05-23T16:03:43Z")

</div>

Hi Jeffrey,

I've asked a similar question [0] on this list a few weeks ago. I specifically mentioned the use of rbenv for installing and managing Rubies, but the problem is the same.

TL;DR -- There's apparently no solution for this, at least not a simple one.

After banging my head too much trying to get the module to work, I decided to go passenger standalone (with a few tips from Mathieu Martin) and use an apache vhost to reverse-proxy the requests to this standalone instance. I can give you pointers for that if it works for you.

- cassiano

[0] [chef - [chef] application\_ruby cookbook and rbenv](http://lists.opscode.com/sympa/arc/chef/2013-05/msg00204.html)

On Thursday, May 23, 2013 at 05:43, Jeffrey Jones wrote:

> Hello all
> 
> I have just spent the afternoon trying to figure out why the passenger\_apache2 cookbook wasn't working for me so my brain is a bit broken, apologies.
> 
> The setup:
> 
> I am using Vagrant (with berkshelf) and the [https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86\_64-minimal.box](https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86_64-minimal.box) box.
> 
> I am building ruby using the chef-ruby\_build cookbook and then symlinking to /usr/local/bin and /usr/bin.
> 
> I am then installing apache2 using the apache2 cookbook and attempting to install the passenger\_apache2 cookbook to install phusion passenger.
> 
> The passenger\_apache2 cookbook installs the gem and .so files correctly however the passenger.conf and passenger.load files always point to the embedded chef ruby locations.
> 
> After a bit of searching I found [http://tickets.opscode.com/browse/COOK-2293](http://tickets.opscode.com/browse/COOK-2293) which is the exact issue I am facing.
> 
> I have tried various methods and hacks to get it working ( [ruby.rb · GitHub](https://gist.github.com/anonymous/3dc9e0d3413dfb973a1e)  
> ) but nothing I have tried works (Including the fix from COOK-2293).
> 
> The comments on COOK-2293 don't really seem to offer a solution either.
> 
> I have reached the end of my tether but prior to smashing something into little pieces, does anyone have a solution or workaround? (One that doesn't involve setting default['passenger']['root\_path'] and default['passenger']['module\_path'] manually.)
> 
> Cheers
> 
> Jeff

---

<div class="post-metadata">

**Author:** ![Jeffrey\_Jones](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Jeffrey\_Jones](https://discourse.chef.io/u/Jeffrey_Jones)\
**Post date:** [May 24, 2013, 4:15am UTC](https://discourse.chef.io/t/passenger-apache2-problems/3998/3 "2013-05-24T04:15:16Z")

</div>

Ahoi Cassiano.

Thanks for that, I am trying to avoid using passenger standalone as much  
as possible. What I ended up doing was the following in my wrapper  
cookbook's attributes:

default['ruby']['version'] = '1.9.3'  
default['ruby']['patch\_level'] = 'p429'

# Hack to work around [http://tickets.opscode.com/browse/COOK-2293](http://tickets.opscode.com/browse/COOK-2293) for

the moment  
default['passenger']['root\_path'] =  
"#{node['ruby\_build']['default\_ruby\_base\_path']}/#{node['ruby']['version']}-#{node['ruby']['patch\_level']}/lib/ruby/gems/1.9.1/gems/passenger-#{passenger['version']}"

Basically constructing the passenger root path semi-dynamically. The  
gems/1.9.1/ bit is hardcoded but oh well.

cheers

Jeff

On 24/05/13 01:03, Cassiano Leal wrote:

> Hi Jeffrey,
> 
> I've asked a similar question [0] on this list a few weeks ago. I  
> specifically mentioned the use of rbenv for installing and managing  
> Rubies, but the problem is the same.
> 
> TL;DR -- There's apparently no solution for this, at least not a  
> simple one.
> 
> After banging my head too much trying to get the module to work, I  
> decided to go passenger standalone (with a few tips from Mathieu  
> Martin) and use an apache vhost to reverse-proxy the requests to this  
> standalone instance. I can give you pointers for that if it works for you.
> 
> - cassiano
> 
> [0] [http://lists.opscode.com/sympa/arc/chef/2013-05/msg00204.html](http://lists.opscode.com/sympa/arc/chef/2013-05/msg00204.html)
> 
> On Thursday, May 23, 2013 at 05:43, Jeffrey Jones wrote:
> 
> > Hello all
> > 
> > I have just spent the afternoon trying to figure out why the  
> > passenger\_apache2 cookbook wasn't working for me so my brain is a bit  
> > broken, apologies.
> > 
> > The setup:
> > 
> > I am using Vagrant (with berkshelf) and the  
> > [https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86\_64-minimal.box](https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86_64-minimal.box)  
> > box.
> > 
> > I am building ruby using the chef-ruby\_build cookbook and then  
> > symlinking to /usr/local/bin and /usr/bin.
> > 
> > I am then installing apache2 using the apache2 cookbook and  
> > attempting to install the passenger\_apache2 cookbook to install  
> > phusion passenger.
> > 
> > The passenger\_apache2 cookbook installs the gem and .so files  
> > correctly however the passenger.conf and passenger.load files always  
> > point to the embedded chef ruby locations.
> > 
> > After a bit of searching I found  
> > [http://tickets.opscode.com/browse/COOK-2293](http://tickets.opscode.com/browse/COOK-2293) which is the exact issue  
> > I am facing.
> > 
> > I have tried various methods and hacks to get it working (  
> > [ruby.rb · GitHub](https://gist.github.com/anonymous/3dc9e0d3413dfb973a1e)  
> > ) but nothing I have tried works (Including the fix from COOK-2293).
> > 
> > The comments on COOK-2293 don't really seem to offer a solution either.
> > 
> > I have reached the end of my tether but prior to smashing something  
> > into little pieces, does anyone have a solution or workaround? (One  
> > that doesn't involve setting default['passenger']['root\_path'] and  
> > default['passenger']['module\_path'] manually.)
> > 
> > Cheers
> > 
> > Jeff

---

<div class="post-metadata">

**Author:** ![Cassiano\_Leal](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/cassiano_leal/32/86_2.png) [@Cassiano\_Leal](https://discourse.chef.io/u/Cassiano_Leal)\
**Post date:** [May 24, 2013, 1:35pm UTC](https://discourse.chef.io/t/passenger-apache2-problems/3998/4 "2013-05-24T13:35:52Z")

</div>

I did something similar in the past, and I can't recall now but it proved to be more of a headache than it was worth it. Something made the process a bit less deterministic than what I would have liked.

That said, I was using Chef 10.x at the time, and as of now most of the cookbooks have been upgraded as well, so you might get luckier than I did. Please let us know if it works out. A blog post would certainly be a great source of reference for people who encounter this problem in the future. 🙂

Cheers!

- cassiano

On Friday, May 24, 2013 at 01:15, Jeffrey Jones wrote:

> Ahoi Cassiano.
> 
> Thanks for that, I am trying to avoid using passenger standalone as much as possible. What I ended up doing was the following in my wrapper cookbook's attributes:
> 
> default['ruby']['version'] = '1.9.3'  
> default['ruby']['patch\_level'] = 'p429'
> 
> # Hack to work around [http://tickets.opscode.com/browse/COOK-2293](http://tickets.opscode.com/browse/COOK-2293) for the moment
> 
> default['passenger']['root\_path'] = "#{node['ruby\_build']['default\_ruby\_base\_path']}/#{node['ruby']['version']}-#{node['ruby']['patch\_level']}/lib/ruby/gems/1.9.1/gems/passenger-#{passenger['version']}"
> 
> Basically constructing the passenger root path semi-dynamically. The gems/1.9.1/ bit is hardcoded but oh well.
> 
> cheers
> 
> Jeff
> 
> On 24/05/13 01:03, Cassiano Leal wrote:
> 
> > Hi Jeffrey,
> > 
> > I've asked a similar question [0] on this list a few weeks ago. I specifically mentioned the use of rbenv for installing and managing Rubies, but the problem is the same.
> > 
> > TL;DR -- There's apparently no solution for this, at least not a simple one.
> > 
> > After banging my head too much trying to get the module to work, I decided to go passenger standalone (with a few tips from Mathieu Martin) and use an apache vhost to reverse-proxy the requests to this standalone instance. I can give you pointers for that if it works for you.
> > 
> > - cassiano
> > 
> > [0] [chef - [chef] application\_ruby cookbook and rbenv](http://lists.opscode.com/sympa/arc/chef/2013-05/msg00204.html)
> > 
> > On Thursday, May 23, 2013 at 05:43, Jeffrey Jones wrote:
> > 
> > > Hello all
> > > 
> > > I have just spent the afternoon trying to figure out why the passenger\_apache2 cookbook wasn't working for me so my brain is a bit broken, apologies.
> > > 
> > > The setup:
> > > 
> > > I am using Vagrant (with berkshelf) and the [https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86\_64-minimal.box](https://dl.dropbox.com/u/31081437/Berkshelf-CentOS-6.3-x86_64-minimal.box) box.
> > > 
> > > I am building ruby using the chef-ruby\_build cookbook and then symlinking to /usr/local/bin and /usr/bin.
> > > 
> > > I am then installing apache2 using the apache2 cookbook and attempting to install the passenger\_apache2 cookbook to install phusion passenger.
> > > 
> > > The passenger\_apache2 cookbook installs the gem and .so files correctly however the passenger.conf and passenger.load files always point to the embedded chef ruby locations.
> > > 
> > > After a bit of searching I found [http://tickets.opscode.com/browse/COOK-2293](http://tickets.opscode.com/browse/COOK-2293) which is the exact issue I am facing.
> > > 
> > > I have tried various methods and hacks to get it working ( [ruby.rb · GitHub](https://gist.github.com/anonymous/3dc9e0d3413dfb973a1e)  
> > > ) but nothing I have tried works (Including the fix from COOK-2293).
> > > 
> > > The comments on COOK-2293 don't really seem to offer a solution either.
> > > 
> > > I have reached the end of my tether but prior to smashing something into little pieces, does anyone have a solution or workaround? (One that doesn't involve setting default['passenger']['root\_path'] and default['passenger']['module\_path'] manually.)
> > > 
> > > Cheers
> > > 
> > > Jeff
