Skip to content
Configures a web platform with Apache, PHP, and MariaDB or PostgreSQL
Ruby Other
  1. Ruby 98.9%
  2. Other 1.1%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
attributes
files/default
libraries
recipes
test
.gitignore
.rubocop.yml
Berksfile
CHANGELOG.md
CONTRIBUTING.md
LICENSE
README.md
TESTING.md
appveyor.yml
chefignore
kitchen.appveyor.yml
kitchen.yml
lint.sh
metadata.rb

README.md

LAMPP Platform Cookbook

License GitHub Tag Build status

Maintainer: OIT Systems Engineering (ua-oit-se@alaska.edu)

Purpose

This cookbook configures a stack consisting of Linux, Apache, MariaDB and PostgreSQL (LAMPP). Apache is configured using the http_platform cookbook. The databases are configured using the database_application cookbook.

A PHP application is deployed from an archive.

Requirements

Chef

This cookbook requires Chef 14+.

Platforms

Supported Platform Families:

  • Debian
    • Ubuntu, Mint
  • Red Hat Enterprise Linux
    • Amazon, CentOS, Oracle
  • Fedora

Platforms validated via Test Kitchen:

  • Ubuntu
  • Debian
  • CentOS
  • Fedora

Dependencies

This cookbook does not constrain its dependencies because it is intended as a utility library. It should ultimately be used within a wrapper cookbook.

Resources

This cookbook provides no custom resources.

Recipes

lampp_platform::default

This recipe configures a webserver and database.

lampp_platform::restore

If a both a local database is configured and backups are configured, this recipe will restore the database from the latest snapshot. Otherwise does nothing.

Attributes

default

  • node['lampp_platform']['database_host']. Defaults to 'localhost'. The host at which the database is located. If equal to 'localhost', servers and databases are installed per attributes of the database_application cookbook. Otherwise, only database clients are installed.

  • node['lampp_platform']['base_name']. Defaults to nil. The name used for scoping the application and name directories. Must be set or an exception is raised.

Note that node['http_platform']['apache']['mpm_module'] is set to 'prefork' to support PHP.

app

  • node['lampp_platform']['app']['archive']['download_base_url']. Defaults to nil. The URL of the directory from which to fetch the application archive. Must be set or an exception is raised.

  • node['lampp_platform']['app']['archive']['download_file_link']. Defaults to nil. The URL slug of the download. If nil, defaults to download_file_name.

  • node['lampp_platform']['app']['archive']['download_file_name']. Defaults to nil. The archive file to be downloaded. Must be set or an exception is raised.

  • node['lampp_platform']['app']['archive']['extract_root_directory']. Defaults to nil. The name of the directory created by extracting the archive. Must be set or an exception is raised.

  • node['lampp_platform']['app']['archive']['extract_creates_file']. Defaults to nil. The relative path to a file that is created by extraction. Used for idempotence. Must be set or an exception is raised.

  • node['lampp_platform']['app']['sync']['exclude_paths']. Defaults to []. Set of paths to exclude when the application code is synced from the download to the library location. Commonly used to avoid clobbering in-source configuration files.

  • node['lampp_platform']['app']['serve_path']. Defaults to nil. The path at which the application is served. For example, 'wiki' or 'app'. The URL of the application will then be 'https://host.domain/serve_path'. See the mediawiki_application cookbook for an example of configuring redirects, rewrites, and pretty URLs. Must be set or an exception is raised.

  • node['lampp_platform']['app_updated']. Defaults to false. Set to true in a recipe if the application repo changed. Can be used to gate non-idempotent configuration code.

install

For some operations, like installing mod_php, the version of PHP on the system must be known. This will be the version in the standard repos for Debian- and Fedora-based systems, and the version provided by EPEL+IUS on RHEL-based distros. The defaults match the latest repos when this cookbook was updated, but will need to be set for older or newer distros.

  • node['lampp_platform']['install']['debian_php_version']. Defaults to '7.2'. The version of PHP installed on Debian-based distros.

  • node['lampp_platform']['install']['rhel_php_version']. Defaults to '7.3'. The version of PHP to install on RHEL- or Fedora-based distros.

Examples

This is an application cookbook; no custom resources are provided. See recipes and attributes for details of what this cookbook does.

See test/cookbooks/test_harness for example usage of this cookbook. See the mediawiki_application cookbook for a more full-fledged example.

Development

See CONTRIBUTING.md and TESTING.md.

You can’t perform that action at this time.