apache

Puppet: Apache module

create module structure
mkdir -p /etc/puppet/modules/apache/manifests
mkdir -p /etc/puppet/modules/apache/files

download module definiction
<?php
$URL="https://raw.githubusercontent.com/panticz/puppet/master/modules/apache/init.pp";
echo "wget -q $URL -O /etc/puppet/modules/apache/manifests/init.pp";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

add include to your client in /etc/puppet/manifests/site.pp
node "client1.local" inherits default {
...
include apache
...
}

Example: index.html
echo "Hello puppet" > /etc/puppet/modules/apache/files/index.html

Links
http://www.panticz.de/install_webserver
http://github.com/example42/puppet-apache

Apache webserver

# list loaded modules
/usr/sbin/apache2ctl -M

# list avaiable modules
apachectl -t -D DUMP_MODULES

# check config
apache2ctl -S

a2dismod status - disable module

apachectl -V

# enable default SSL site
a2ensite default-ssl

# disable default SSL site
a2dissite default-ssl

htaccess
http://www.panticz.de/apache-htaccess

Enable mod_rewrite module
sudo a2enmod rewrite

cat < /etc/apache2/conf-available/allow-override.conf

AllowOverride all

EOF

a2enconf allow-override