Created
March 15, 2013 14:57
-
-
Save romaricpascal/5170424 to your computer and use it in GitHub Desktop.
A Puppet manifest snippet to configure a Apache httpd vhost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Apache configuration uses a fork of puppetlabs-apache module, available at | |
# https://github.com/rhumaric/puppetlabs-apache | |
# | |
# If you use the module from puppetlabs, be sure to remove | |
# - the `purge_vhosts_dir` parameter | |
# - the `setenv` parameter | |
# Makes sure apache is installed on the system. Leaves any vhost already | |
# deployed as it is. | |
class { 'apache': | |
purge_vhosts_dir => false | |
} | |
# Env module is needed to pass database configuration to Wordpress using | |
# environment variables | |
a2mod { 'env': | |
name => 'env', | |
ensure => 'present' | |
} | |
# Rewrite module is necessary to have custom permalinks in Wordpress | |
a2mod { 'rewrite': | |
name => 'rewrite', | |
ensure => 'present' | |
} | |
# Creates the vhost, passing along the necessary mysql information | |
apache::vhost{ 'awesome-project': | |
name => 'awesome-project.local', | |
port => 80, | |
docroot => '/var/vhosts/awesome-project', | |
configure_firewall => false, | |
servername => 'awesome-project.local', | |
ssl => false, | |
override => all, | |
setenv => { | |
'WORDPRESS_DB_USER' => 'awesome-project', | |
'WORDPRESS_DB_PASSWORD' => '@we5omE-pAs5w0rD', | |
'WORDPRESS_DB_HOST' => 'localhost', | |
'WORDPRESS_DB_NAME' => 'awesome-project.local' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment