Code Monkey home page Code Monkey logo

passenger_apache2's Introduction

passenger_apache2 Cookbook

Cookbook Version Build Status OpenCollective OpenCollective License

Installs Phusion Passenger Ruby application server for Apache 2.

Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If youโ€™d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.

Requirements

Platforms

  • Debian/Ubuntu
  • RHEL/CentOS/Scientific/Amazon/Oracle
  • Fedora
  • openSUSE/SLES

Chef

  • Chef 14+

Cookbooks

  • apache2 >= 2.0.0

Attributes

  • node['passenger']['version'] - Specify the version of passenger to install.

  • node['passenger']['max_pool_size'] - Sets PassengerMaxPoolSize in the Apache module config.

  • node['passenger']['root_path'] - The location of the passenger gem.

  • node['passenger']['ruby_bin'] - Sets PassengerRuby in the Apache module config and is used for passenger module configuration. Defaults to node['languages']['ruby']['ruby_bin'].

  • node['passenger']['module_path'] - The location of the compiled passenger apache module.

  • node['passenger']['install_method'] - Includes the "source" (gem install) or "package" recipe. Default "source."

  • node['passenger']['apache_mpm'] - Override with an "override_attribute" (in a role, environment or with node.override) to "worker" or "threaded" to use apache2-threaded-dev package. Otherwise this assumes prefork.

  • node['passenger']['package']['name'] - Name of the package for passenger, default is nil, so this must be set before using the "package" install method/recipe.

  • node['passenger']['install_module'] - Specify the boolean value which decides installing Passenger. Defaults to true, and setting to false skips the installation

  • node['passenger']['package']['version'] - Specify the version of the passenger package to install. Uses version attribute above by default. To install the version available by default (latest, usually), delete the attribute in a recipe with this line:

    node.normal['passenger']['package'].delete('version')

Recipes

default

Installs passenger from gem (source) or package depending on the value of the install_method attribute.

mod_rails

Installs the passenger gem and enables the module in Apache2.

source

Installs passenger as a RubyGem.

package

Installs passenger as a Package.

Set the install_method attribute to package, then set the package['name'] attribute to the correct package for your platform. The recipe does not yet handle adding yum repositories for RHEL platforms, so that should be done in another recipe until COOK-2414 is resolved.

Set the node['passenger']['package']['version'] attribute to the correct value for your system's available package repository if necessary. By default the value is nil which will install the latest package version from the distribution package manager.

Usage

For example, to run a Rails application on passenger:

include_recipe "rails"
include_recipe "passenger_apache2"

web_app "myproj" do
  docroot "/srv/myproj/public"
  server_name "myproj.#{node[:domain]}"
  server_aliases [ "myproj", node[:hostname] ]
  rails_env "production"
end

A sample config template is provided, web_app.conf.erb. If this is suitable for your application, add 'cookbook "passenger_apache2"' to the define above to use that template. Otherwise, copy the template to the cookbook where you're using web_app, and modify as needed. The cookbook parameter is optional, if omitted it will search the cookbook where the define is used.

Example:

web_app "myproj" do
  # ...
  cookbook "passenger_apache2"
  # ...
end

Known Issues

When run as a daemonized process under init on linux, using https://github.com/opscode-cookbooks/chef-client/blob/master/recipes/init_service.rb for example, the /sbin/service script scrubs the environment, including the HOME environment variable. In some versions, Passenger depends on the HOME environment variable to be present. This can be worked around by setting the necessary environment variables directly in your recipes.

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website

passenger_apache2's People

Contributors

alex-tan avatar cap10morgan avatar chrisroberts avatar chulkilee avatar damacus avatar dlanner avatar erniebrodeur avatar gravesb avatar iennae avatar jtimberman avatar kitchen-porter avatar kplimack avatar miketheman avatar nathenharvey avatar pho3nixf1re avatar plu avatar powerschill avatar ramereth avatar ranjib avatar renovate[bot] avatar sean-horn avatar sethvargo avatar shaundomingo avatar simonrobson avatar stevendanna avatar tas50 avatar tf avatar xorima avatar xorimabot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

passenger_apache2's Issues

Update builds to be parallel

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

As part of our build process we should build each possible operating system separately

  1. Ensure you have dokken setup and working:
  2. dokken: aliased to KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen
  3. run dokken list, you should see a list of builds with dokken as the provider
  4. download: https://github.com/sous-chefs/repo-management/blob/master/scripts/circleci_maker.rb and make this executable
  5. run: dokken list -j | ./circleci_maker.rb > .circleci/config.yml

Issue sprouted from sous-chefs/meta/issues/112. If not applicable then issue should be closed.

Determine what to do to support newer Ubuntu, Apache HTTPD

This cookbook is fairly tightly coupled with the apache2 cookbook. To be fair, this is named "passenger_apache" so that makes sense. However, it would be nice to have a more general passenger cookbook. Perhaps that would be a separate thing, or this one would otherwise be refactored to use a newer apache2 cookbook (or the httpd cookbook) to support Apache HTTPD 2.4.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/stale.yml
  • actions/stale v9

  • Check this box to trigger a request for Renovate to run again on this repository

gem_binary in source.rb

I ran into an issue when installing passenger from the chef omnibus installer where the gem_package in source.rb was being installed into /opt/chef/embedded/bin. I manually updated my recipe to include a new attribute called [:passenger][:gem_binary] and added this to the gem_package call at line 46 of source.rb gem_binary node[:passenger][:gem_binary] to fix the issue, but it might be useful to have this baked into your next update. default[:passenger][:gem_binary] = 'gem' is the default value I set. There could be a variety of reasons for using a separate binary though, and with the ability to specify the ruby_bin, it would make sense to be able to specify the gem_binary as well, to ensure that gems get installed in the proper gem folder.

Remove .rubocop.yml with Dangerfile

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

If the only thing in the .rubocop/yml is Dangerfile
Run the latest cookstyle
Remove .rubpopo.yml

Issue sprouted from sous-chefs/meta/issues/108. If not applicable then issue should be closed.

Recipe fails on SLES 11.3

In recipes/source.rb, there's no support for the "suse" platform family, so the recipe tries to install apache-prefork-dev (among others), which does not exist in Suse.

The following is the correct list of packages required for Suse:

  • apache2-devel
  • curl-devel
  • openssl-devel
  • zlib-devel

First Chef-Client fails on execute[passenger_module] action run

I'm running into an issue with version 2.2.3 where the first chef-client run fails on:

  • execute[passenger_module] action run

    ================================================================================
    Error executing action run on resource 'execute[passenger_module]'

    Mixlib::ShellOut::ShellCommandFailed

    Expected process to exit with [0], but received '1'
    ---- Begin output of /opt/chef/embedded/bin/ruby /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.53/bin/passenger-install-apache2-module 4.0.53 --auto ----
    STDOUT:
    STDERR: /opt/chef/embedded/bin/ruby: No such file or directory -- /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.53/bin/passenger-install-apache2-module (LoadError)
    ---- End output of /opt/chef/embedded/bin/ruby /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.53/bin/passenger-install-apache2-module 4.0.53 --auto ----
    Ran /opt/chef/embedded/bin/ruby /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.53/bin/passenger-install-apache2-module 4.0.53 --auto returned 1

    Resource Declaration:

    In /var/chef/cache/cookbooks/passenger_apache2/recipes/source.rb

    50: execute "passenger_module" do
    51: command "#{node['passenger']['ruby_bin']} #{node['passenger']['root_path']}/bin/passenger-install-apache2-module #{node['passenger']['version']} --auto"
    52: only_if { node['passenger']['install_module'] }
    53: # this is late eval'd when Chef converges this resource, and the
    54: # attribute may have been modified by the mod_rails recipe.
    55: not_if { ::File.exist?(node['passenger']['module_path']) }
    56: end

    Compiled Resource:

    Declared in /var/chef/cache/cookbooks/passenger_apache2/recipes/source.rb:50:in `from_file'

    execute("passenger_module") do
    action "run"
    retries 0
    retry_delay 2
    guard_interpreter :default
    command "/opt/chef/embedded/bin/ruby /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.53/bin/passenger-install-apache2-module 4.0.53 --auto"
    backup 5
    returns 0
    cookbook_name "passenger_apache2"
    recipe_name "source"
    not_if { #code block }
    only_if { #code block }
    end

    Recipe: chef-client::init_service

    • service[chef-client] action restart
      • restart service service[chef-client]
        Recipe: apache2::default
    • service[apache2] action reload
      • reload service service[apache2]

    Running handlers:
    [2015-04-07T10:05:12+00:00] ERROR: Running exception handlers
    Running handlers complete
    [2015-04-07T10:05:12+00:00] ERROR: Exception handlers complete
    [2015-04-07T10:05:12+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out

The second chef-client run however finishes successfully.
On Ubuntu 12.04, and using cookbook ruby to install ruby 1.9.1

Update apache dependency

Hi,

Can you update apache2 dependency in metadata.rb, the version actually released is 3.0.1 and include many fixes and updates.
I can't use passenger_apache2 on Ubuntu14.04 and Wheezy.

# in the current metadata.rb
depends 'apache2', '~> 1.0'

Regards

Migrate testing to circleci

Cookbook version

master

Scenario:

Automatically run tests on new PRs

Steps to Reproduce:

Submit a PR introducing random characters to every file.

Expected Result:

ROBOTS YELLING AT ME.

Actual Result:

robotic silence

Update Changelog

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Update all CHANGELOGs to follow standard defined at https://keepachangelog.com/

Issue sprouted from sous-chefs/meta/issues/101. If not applicable then issue should be closed.

Run latest cookstyle

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Chef have released updated cookstyle rules, we should therefore run the auto fix against the cookbook

  1. Ensure you are on the latest stable chef-workstation
  2. Run cookstyle -a

Issue sprouted from sous-chefs/meta/issues/111. If not applicable then issue should be closed.

passenger_apache2::source always recompiles the module

Hi!

Is there any way for avoid the source recipe to rebuild the module again and again? I've included the mod_rails recipe (which includes the source recipe) in my runlist, and it recompiles everything every 5 minutes (my chef-client run interval), increasing unnecessarily my system load.

Any idea? Thanks!

Passenger Depends on Shell $HOME

Passenger depends on shell $HOME variable being set.

While chef-client is running in daemonized mode, the children spawned by chef-client do not include $HOME as part of the available shell environment.

As a customer, I would like a workaround for this issue chef-boneyard/chef-client#226 to be made in passenger_apache2 if it can be done sooner than in the chef-client cookbook.

apache2 cookbook dependency is too old

Current dependency is too restrictive: depends 'apache2', '~> 1.0'. It prevents anyone using this cookbook to have anything newer.

https://github.com/chef-cookbooks/passenger_apache2/blob/master/metadata.rb#L11

Chef Supermarket has 3.1.0 available: https://supermarket.chef.io/cookbooks/apache2.

This breaks our environment with berkshelf.

Generated at 2015-09-23 11:56:56 -0700
Net::HTTPServerException: 412 "Precondition Failed"
/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2633:in `error!'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/http.rb:145:in `request'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/http.rb:126:in `post'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/policy_builder/expand_node_object.rb:168:in `sync_cookbooks'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/policy_builder/expand_node_object.rb:66:in `setup_run_context'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/client.rb:265:in `setup_run_context'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/client.rb:429:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/client.rb:213:in `block in run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/client.rb:207:in `fork'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/client.rb:207:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/application.rb:236:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/application/client.rb:338:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/application/client.rb:327:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/application/client.rb:327:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/lib/chef/application.rb:55:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.18.6/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:23:in `load'
/usr/bin/chef-client:23:in `<main>'

Support apache2 cookbook v7

Cookbook version

3.1.0

Chef-client version

14.10

Platform Details

Ubuntu 16.04/18.04

Scenario:

Use apache2 cookbook v7

Steps to Reproduce:

Create wrapper cookbook that depends on apache2 cookbook v7 and passenger_apache2 cookbook v3.1.0.

Expected Result:

Functioning apache2 & passenger

Actual Result:

Chef::Exceptions::RecipeNotFound
--------------------------------
could not find recipe default for cookbook apache2

https://github.com/sous-chefs/passenger_apache2/blob/master/recipes/default.rb#L25

Patch for ubuntu14.04

I was going to submit a pull request for ubuntu 14.04 support but I noticed that this cookbook does not seem to have a .kitchen.yml file. Should I include this in may pull request?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.