Skip to content

Instantly share code, notes, and snippets.

@webflo
Last active December 16, 2015 21:08
Show Gist options
  • Save webflo/5497063 to your computer and use it in GitHub Desktop.
Save webflo/5497063 to your computer and use it in GitHub Desktop.
Boxen Apache Project with Apache + FastCGI + PHP-FPM
class apache_php_example {
class { 'php::config':
webserver => 'apache'
}
include php::fpm::5_3_24
include php::fpm::5_4_11
include apache
apache::port { "80": }
apache::port { "443": }
include apache::module::mod_fastcgi
apache_php::fastcgi_handler { "5.3.24":
php_version => "5.3.24"
}
apache_php::fastcgi_handler { "5.4.11":
php_version => "5.4.11"
}
# Vhost with 5.4.11
apache_php::vhost { "foobar":
port => 80,
php_version => "5.4.11",
docroot => "/Users/${::luser}/Sites/foobar.dev/src",
}
# Drupal 8
php::project::apache { "d8":
source => "webflo/cck_min.git",
dir => "/Users/${::luser}/Sites/d8.dev",
docroot => "/Users/${::luser}/Sites/d8.dev",
server_name => "d8",
php => "5.3.24",
}
}
define php::project::apache (
$source,
$dir = undef,
$dotenv = undef,
$elasticsearch = undef,
$memcached = undef,
$mongodb = undef,
$cassandra = undef,
$zookeeper = undef,
$beanstalk = undef,
$nsq = undef,
$zeromq = undef,
$mysql = undef,
$nginx = undef,
$nodejs = undef,
$postgresql = undef,
$redis = undef,
$ruby = undef,
$php = undef,
$fpm_pool = undef,
$server_name = "${name}.dev",
$docroot = "${dir}",
$port = 80,
) {
include boxen::config
php::project { $name:
source => $source,
dir => $dir,
dotenv => $dotenv,
elasticsearch => $elasticsearch,
memcached => $memcached,
mongodb => $mongodb,
cassandra => $cassandra,
zookeeper => $zookeeper,
beanstalk => $beanstalk,
nsq => $nsq,
zeromq => $zeromq,
mysql => $mysql,
nginx => $nginx,
nodejs => $nodejs,
postgresql => $postgresql,
redis => $redis,
ruby => $ruby,
php => $php,
fpm_pool=> $fpm_pool,
server_name => $server_name,
}
apache_php::vhost { "${server_name}":
port => $port,
php_version => $php,
docroot => $docroot,
}
}
# Apache + PHP
mod "apache",
:git => "git://github.com/webflo/boxen-puppet-apache.git"
mod "php",
:git => "git://github.com/webflo/puppet-php.git",
:ref => "fastcgi_webserver"
mod "apache_php",
:git => "git://github.com/webflo/puppet-apache_php.git"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment