Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown directive "passenger_root" in /etc/nginx/nginx.conf #427

Closed
trustarun opened this issue Sep 1, 2014 · 4 comments
Closed

unknown directive "passenger_root" in /etc/nginx/nginx.conf #427

trustarun opened this issue Sep 1, 2014 · 4 comments

Comments

@trustarun
Copy link

Below is my manifest which install nginx with precompiled passenger.

=> manifest for nginx
class thirdpillar::server(
$site_url = "www.melbourne.com",
$site_path = "/var/www/melbourne/public"
) inherits ruby::params {
class { 'nginx':
package_source => 'passenger',
http_cfg_append => {
'passenger_root' => "/usr/lib/ruby/gems/1.8/gems/passenger-3.0.21",
},
require => Class['passenger'],
}

  nginx::resource::vhost { "${site_url}":
    www_root => $site_path,
    vhost_cfg_append => {
      'passenger_enabled' => 'on',
      'passenger_ruby'    => '/usr/local/rvm/rubies/ruby-1.9.3-p547/bin/ruby',
    }
  }

}

=> manifest for passenger

class thirdpillar::build_passenger(
$passenger_version = '3.0.21',
){
node default {
class {'passenger':
passenger_version => $passenger_version,
passenger_provider => 'gem',
passenger_package => 'passenger',
gem_path => "/usr/lib/ruby/gems/1.8/gems",
gem_binary_path => "/usr/lib/ruby/gems/1.8/gems/bin",
passenger_root => "/usr/lib/ruby/gems/1.8/gems/passenger-3.0.21",
}
}
}

When I apply the manifest for nginx, It get installed but fail due to below error.

Error: Could not start Service[nginx]: Execution of '/sbin/service nginx start' returned 1:
Error: /Stage[main]/Nginx::Service/Service[nginx]/ensure: change from stopped to running failed: Could not start Service[nginx]: Execution of '/sbin/service nginx start' returned 1

when I try to execute the failed command manually to see what is the problem, I get below:

]# /sbin/service nginx start
Starting nginx: nginx: [emerg] unknown directive "passenger_root" in /etc/nginx/nginx.conf:35
[FAILED]

On viewing the nginx.conf, I find the passenger_root directive under http header

passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-3.0.21

Why nginx is not recognizing passenger_root directive....what Iam missing here..what I need to do ???

@3flex
Copy link
Contributor

3flex commented Sep 2, 2014

In your class declaration, can you add package_name => 'nginx-extras' and try again?

e.g.

class { 'nginx':
  package_source => 'passenger',
  package_name   => 'nginx-extras',
  ...
}

@trustarun
Copy link
Author

On adding package name as you have suggested, I get below error:

Skipping because of failed dependencies
Dependency Package[nginx-extras] has failures: true

So, it do not able to find the ngin-extras package. I added below in the manifest to add the dependent package

package {'nginx-extras':
     before => Class['nginx'],
}

But now, it give below error:

Error: Duplicate declaration: Package[nginx-extras] is already declared in file /etc/puppetlabs/puppet/modules/thirdpillar/manifests/server.pp:7; cannot redeclare at /etc/puppetlabs/puppet/modules/nginx/manifests/package/redhat.pp:69 on node learn.localdomain

@3flex
Copy link
Contributor

3flex commented Sep 2, 2014

Sorry I should have checked your OS. This module only automatically installs passenger on Debian family operating systems, so the package_source => 'passenger' line in your class declaration has no effect.

You will have to manually install passenger for your OS and set the package_name appropriately. See https://www.phusionpassenger.com/documentation/Users%20guide%20Nginx.html#_installing_or_upgrading_on_red_hat_fedora_centos_or_scientificlinux

@3flex
Copy link
Contributor

3flex commented Dec 8, 2014

Closing. If this is still an issue and you're using Debian or Ubuntu then please reopen and we can look further into the problem. Thanks!

@3flex 3flex closed this as completed Dec 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants