Permalink
Browse files

Lighttpd goes NextGen

  • Loading branch information...
1 parent a85c312 commit bd91554df2e4763ebf2ab65f575a03f64b93b074 @alvagante alvagante committed Nov 30, 2012
View
@@ -187,3 +187,6 @@
[submodule "proftpd"]
path = proftpd
url = https://github.com/example42/puppet-proftpd
+[submodule "lighttpd"]
+ path = lighttpd
+ url = https://github.com/example42/puppet-lighttpd
Submodule lighttpd added at 1f93ee
View
@@ -1,7 +0,0 @@
-name 'lab42-lighttpd'
-version '0.1.5'
-
-# dependency 'lab42/common', '>= 0.1.0'
-# dependency 'lab42/monitor', '>= 0.1.0'
-# dependency 'lab42/backup', '>= 0.1.0'
-# dependency 'lab42/firewall', '>= 0.1.0'
View
@@ -1,93 +0,0 @@
-Puppet module: lighttpd
-
-# Written by Lab42 #
-# http://www.Example42.com
-
-Licence: Apache2
-
-DESCRIPTION:
-This module installs and manages lighttpd.
-It's based on Example42's module structure and features standard and
-extended classes for automatic monitoring, backup and firewalling.
-
-All the variables used in this module are defined in the lighttpd::params class
-(File: $MODULEPATH/lighttpd/manifests/params.pp). Here you can:
-- Set default settings and filtering module's specific Users variables
-- Add selectors for internal variables to adapt the module to different OSes
-- Review and eventually change default settings for variables that affect the
- Example42 extended classes.
-
-Customizations for different projects and logic on how to populate configuration
-files should be placed in the $my_project classes.
-
-
-MODULE'S SPECIFIC USER VARIABLES:
-
-
-USAGE:
-# Standard Classes
-include lighttpd # Install and run lighttpd
-
-include lighttpd::disable # Disable lighttpd service.
-include lighttpd::disableboot # Disable lighttpd service at boot time, but don't stop if is running.
-include lighttpd::absent # Remove lighttpd package.
-include lighttpd::debug # Used for debugging purposes (not resource hungry)
- # Automatically included if $debug=yes
- # Requires Example42's puppet::params and puppet::debug
-
-# Extended Classes (generally require storeconfigs)
-include lighttpd::monitor # Monitor lighttpd
- # Automatically included if $monitor=yes
- # Requires Example42's monitor module
-include lighttpd::backup # Backup lighttpd data
- # Automatically included if $backup=yes
- # Requires Example42's backup module
-include lighttpd::firewall # Manages firewall rules for lighttpd service
- # Automatically included if $firewall=yes
- # Requires Example42's firewall module
-
-# Generic define to set parameters in the main configuration file. EXPERIMENTAL.
-lighttpd::conf { "ParameterName": value="YourValue"} # Generic
-
-# Module specific classes
-
-# Module specific defines
-lighttpd::dotconf # Define to add custom .conf files to lighttpd conf.d dir
-
-EXAMPLE42 GENERAL VARIABLES:
-Example42 modules collection uses some general variables that can influence the
-behaviour of this module. You can happily live without considering or setting them,
-but they can be useful to get many useful features out of the box.
-$my_project - If set, permits you to alter and customize the module behaviour
- and files's deploy logic in custom project classes than can be placed in a separated module.
-$base_source - Lets you define an alternative source for static files:
- - $base_source not set -> Files are looked in puppet://$servername/ (the PuppetMaster)
- - $base_source set -> Files are in $base_source ( Ex: puppet://$servername/$my_module )
- Note that the module automatically manages the different paths for Puppet pre 0.25
-$debug - If set to yes writes in /var/lib/puppet/debug/ useful debugging info
-
-VARIABLES FOR EXTENDED MODULES:
-$monitor - Set to "yes" to enable auto monitoring classes
-$monitor_tool - Defines the monitor tools to activate (At leat one, can be an array)
-Check lighttpd/manifests/monitor.pp for more info on lighttpd monitoring related variables.
-
-$backup - Set to "yes" to enable auto backuping classes
-$backup_tool - Defines the backup tools to activate (At leat one, can be an array)
-Check lighttpd/manifests/backup.pp for more info on lighttpd backuping related variables.
-
-
-DEPENDENCIES:
-Standard classes generally don't need external modules.
-Extended classes need the relevant external modules and the Example42 "common" module.
-lighttpd::conf generic infile configuration define needs the Example42 "common" module
-
-
-OPERATING SYSTEMS SUPPORT (Planned, Development, Testing, Production):
-RedHat/Centos 5 : Testing
-RedHat/Centos 6 : Testing
-Debian 5 : Testing
-Debian 6 : Planned
-Ubuntu 8.04 : Testing
-Ubuntu 10.04 : Testing
-SLES 10 : Planned
-SLES 11 : Planned
@@ -1,173 +0,0 @@
-# File Managed by Puppet
-
-# Debian lighttpd configuration file
-#
-
-############ Options you really have to take care of ####################
-
-## modules to load
-# mod_access, mod_accesslog and mod_alias are loaded by default
-# all other module should only be loaded if neccesary
-# - saves some time
-# - saves memory
-
-server.modules = (
- "mod_access",
- "mod_alias",
- "mod_accesslog",
- "mod_compress",
- "mod_status",
-# "mod_rewrite",
-# "mod_redirect",
-# "mod_evhost",
-# "mod_usertrack",
-# "mod_rrdtool",
-# "mod_webdav",
-# "mod_expire",
-# "mod_flv_streaming",
-# "mod_evasive"
-)
-
-## a static document-root, for virtual-hosting take look at the
-## server.virtual-* options
-server.document-root = "/var/www/"
-
-## where to upload files to, purged daily.
-server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
-
-## where to send error-messages to
-server.errorlog = "/var/log/lighttpd/error.log"
-
-## files to check for if .../ is requested
-index-file.names = ( "index.php", "index.html",
- "index.htm", "default.htm",
- "index.lighttpd.html" )
-
-
-## Use the "Content-Type" extended attribute to obtain mime type if possible
-# mimetype.use-xattr = "enable"
-
-#### accesslog module
-accesslog.filename = "/var/log/lighttpd/access.log"
-
-## deny access the file-extensions
-#
-# ~ is for backupfiles from vi, emacs, joe, ...
-# .inc is often used for code includes which should in general not be part
-# of the document-root
-url.access-deny = ( "~", ".inc" )
-
-##
-# which extensions should not be handle via static-file transfer
-#
-# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
-static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
-
-
-######### Options that are good to be but not neccesary to be changed #######
-
-## Use ipv6 only if available. (disabled for while, check #560837)
-#include_shell "/usr/share/lighttpd/use-ipv6.pl"
-
-## bind to port (default: 80)
-# server.port = 81
-
-## bind to localhost only (default: all interfaces)
-## server.bind = "localhost"
-
-## error-handler for status 404
-#server.error-handler-404 = "/error-handler.html"
-#server.error-handler-404 = "/error-handler.php"
-
-## to help the rc.scripts
-server.pid-file = "/var/run/lighttpd.pid"
-
-##
-## Format: <errorfile-prefix><status>.html
-## -> ..../status-404.html for 'File not found'
-#server.errorfile-prefix = "/var/www/"
-
-## virtual directory listings
-dir-listing.encoding = "utf-8"
-server.dir-listing = "enable"
-
-## send unhandled HTTP-header headers to error-log
-#debug.dump-unknown-headers = "enable"
-
-### only root can use these options
-#
-# chroot() to directory (default: no chroot() )
-#server.chroot = "/"
-
-## change uid to <uid> (default: don't care)
-server.username = "www-data"
-
-## change uid to <uid> (default: don't care)
-server.groupname = "www-data"
-
-#### compress module
-compress.cache-dir = "/var/cache/lighttpd/compress/"
-compress.filetype = ("text/plain", "text/html", "application/x-javascript", "text/css")
-
-
-#### url handling modules (rewrite, redirect, access)
-# url.rewrite = ( "^/$" => "/server-status" )
-# url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
-
-#### Server status
-status.status-url = "/server-status"
-
-#
-# define a pattern for the host url finding
-# %% => % sign
-# %0 => domain name + tld
-# %1 => tld
-# %2 => domain name without tld
-# %3 => subdomain 1 name
-# %4 => subdomain 2 name
-#
-# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
-
-#### expire module
-# expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
-
-#### rrdtool
-# rrdtool.binary = "/usr/bin/rrdtool"
-# rrdtool.db-name = "/var/www/lighttpd.rrd"
-
-#### variable usage:
-## variable name without "." is auto prefixed by "var." and becomes "var.bar"
-#bar = 1
-#var.mystring = "foo"
-
-## integer add
-#bar += 1
-## string concat, with integer cast as string, result: "www.foo1.com"
-#server.name = "www." + mystring + var.bar + ".com"
-## array merge
-#index-file.names = (foo + ".php") + index-file.names
-#index-file.names += (foo + ".php")
-
-
-#### external configuration files
-## mimetype mapping
-include_shell "/usr/share/lighttpd/create-mime.assign.pl"
-
-## load enabled configuration files,
-## read /etc/lighttpd/conf-available/README first
-include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
-
-#### handle Debian Policy Manual, Section 11.5. urls
-## by default allow them only from localhost
-## (This must come last due to #445459)
-## Note: =~ "127.0.0.1" works with ipv6 enabled, whereas == "127.0.0.1" doesn't
-$HTTP["remoteip"] =~ "127.0.0.1" {
- alias.url += (
- "/doc/" => "/usr/share/doc/",
- "/images/" => "/usr/share/images/"
- )
- $HTTP["url"] =~ "^/doc/|^/images/" {
- dir-listing.activate = "enable"
- }
-}
-
@@ -1,25 +0,0 @@
-# Class: lighttpd::absent
-#
-# Removes lighttpd package and its relevant monitor, backup, firewall entries
-#
-# Usage:
-# include lighttpd::absent
-#
-class lighttpd::absent {
-
- require lighttpd::params
-
- package { "lighttpd":
- name => "${lighttpd::params::packagename}",
- ensure => absent,
- }
-
- # Remove relevant monitor, backup, firewall entries
- if $monitor == "yes" { include lighttpd::monitor::absent }
- if $backup == "yes" { include lighttpd::backup::absent }
- if $firewall == "yes" { include lighttpd::firewall::absent }
-
- # Include debug class is debugging is enabled ($debug=yes)
- if ( $debug == "yes" ) or ( $debug == true ) { include lighttpd::debug }
-
-}
@@ -1,41 +0,0 @@
-# Class: lighttpd::backup
-#
-# Backups lighttpd data and logs using Example42 backup meta module (to be adapted to custom backup solutions)
-# It's automatically included and used if $backup=yes
-# This class permits to abstract what you want to backup from the tool and module to use for backups.
-#
-# Variables:
-# The behaviour of this class has some defaults that can be overriden by user's variables:
-# $lighttpd_backup_data (true|false) : Set if you want to backup lighttpd's data. Default: As defined in $backup_data
-# $lighttpd_backup_log (true|false) : Set if you want to backup lighttpd's logs. Default: As defined in $backup_log
-# $lighttpd_backup_frequency (hourly|daily|weekly|monthly) : Set the frequency of your lighttpd backups. Default: daily.
-# $lighttpd_backup_target : Define how to reach (Ip, fqdn...) this host to backup lighttpd from an external server. Default: As defined in $backup_target
-#
-# You can also set some site wide variables that can be overriden by the above module specific ones:
-# $backup_data (true|false) : Set if you want to enable data backups site-wide.
-# $backup_log (true|false) : Set if you want to enable logs backups site-wide.
-# $backup_target : Set the ip/hostname you want to use on an external backup server to backup this host
-# For the defaults of the above variables check lighttpd::params
-#
-# Usage:
-# Automatically included if $backup=yes
-#
-class lighttpd::backup {
-
- include lighttpd::params
-
- backup { "lighttpd_data":
- frequency => "${lighttpd::params::backup_frequency}",
- path => "${lighttpd::params::datadir}",
- enabled => "${lighttpd::params::backup_data_enable}",
- target => "${lighttpd::params::backup_target_real}",
- }
-
- backup { "lighttpd_logs":
- frequency => "${lighttpd::params::backup_frequency}",
- path => "${lighttpd::params::logdir}",
- enabled => "${lighttpd::params::backup_log_enable}",
- target => "${lighttpd::params::backup_target_real}",
- }
-
-}
@@ -1,23 +0,0 @@
-# Class: lighttpd::backup::absent
-#
-# Remove lighttpd backup elements
-#
-class lighttpd::backup::absent {
-
- include lighttpd::params
-
- backup { "lighttpd_data":
- frequency => "${lighttpd::params::backup_frequency}",
- path => "${lighttpd::params::datadir}",
- enabled => "false",
- target => "${lighttpd::params::backup_target_real}",
- }
-
- backup { "lighttpd_logs":
- frequency => "${lighttpd::params::backup_frequency}",
- path => "${lighttpd::params::logdir}",
- enabled => "false",
- target => "${lighttpd::params::backup_target_real}",
- }
-
-}
Oops, something went wrong.

0 comments on commit bd91554

Please sign in to comment.