Install mailman apache config.
Also includes default index.html file which needs to be customized. Change-Id: Idd2d03a95b8bfaba42d94701dc5a5ced204a1c65
This commit is contained in:
parent
33f0963048
commit
d68c6987a3
@ -1,73 +0,0 @@
|
||||
# Sample configuration for Debian mailman with Apache
|
||||
|
||||
# We can find mailman here:
|
||||
ScriptAlias /cgi-bin/mailman/ /usr/lib/cgi-bin/mailman/
|
||||
# And the public archives:
|
||||
Alias /pipermail/ /var/lib/mailman/archives/public/
|
||||
# Logos:
|
||||
Alias /images/mailman/ /usr/share/images/mailman/
|
||||
|
||||
# Use this if you don't want the "cgi-bin" component in your URL:
|
||||
# In case you want to access mailman through a shorter URL you should enable
|
||||
# this:
|
||||
#ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/
|
||||
# In this case you need to set the DEFAULT_URL_PATTERN in
|
||||
# /etc/mailman/mm_cfg.py to http://%s/mailman/ for the cookie
|
||||
# authentication code to work. Note that you need to change the base
|
||||
# URL for all the already-created lists as well.
|
||||
|
||||
<Directory /usr/lib/cgi-bin/mailman/>
|
||||
AllowOverride None
|
||||
Options ExecCGI
|
||||
AddHandler cgi-script .cgi
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
<Directory /var/lib/mailman/archives/public/>
|
||||
Options FollowSymlinks
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
<Directory /usr/share/images/mailman/>
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
|
||||
## The following describes how to configure mailman on
|
||||
## a dedicated virtual host, courtesy Marco d'Itri.
|
||||
|
||||
# Add these lines in /etc/mailman/mm_cfg.py:
|
||||
#DEFAULT_EMAIL_HOST = 'lists.example.net'
|
||||
#DEFAULT_URL_HOST = 'lists.example.net'
|
||||
#DEFAULT_URL_PATTERN = 'http://%s/'
|
||||
|
||||
#<VirtualHost *>
|
||||
#ServerName lists.example.net
|
||||
#DocumentRoot /var/www/lists
|
||||
#ErrorLog /var/log/apache2/lists-error.log
|
||||
#CustomLog /var/log/apache2/lists-access.log combined
|
||||
#
|
||||
#<Directory /var/lib/mailman/archives/>
|
||||
# Options FollowSymLinks
|
||||
# AllowOverride None
|
||||
#</Directory>
|
||||
#
|
||||
#Alias /pipermail/ /var/lib/mailman/archives/public/
|
||||
#Alias /images/mailman/ /usr/share/images/mailman/
|
||||
#ScriptAlias /admin /usr/lib/cgi-bin/mailman/admin
|
||||
#ScriptAlias /admindb /usr/lib/cgi-bin/mailman/admindb
|
||||
#ScriptAlias /confirm /usr/lib/cgi-bin/mailman/confirm
|
||||
#ScriptAlias /create /usr/lib/cgi-bin/mailman/create
|
||||
#ScriptAlias /edithtml /usr/lib/cgi-bin/mailman/edithtml
|
||||
#ScriptAlias /listinfo /usr/lib/cgi-bin/mailman/listinfo
|
||||
#ScriptAlias /options /usr/lib/cgi-bin/mailman/options
|
||||
#ScriptAlias /private /usr/lib/cgi-bin/mailman/private
|
||||
#ScriptAlias /rmlist /usr/lib/cgi-bin/mailman/rmlist
|
||||
#ScriptAlias /roster /usr/lib/cgi-bin/mailman/roster
|
||||
#ScriptAlias /subscribe /usr/lib/cgi-bin/mailman/subscribe
|
||||
#ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/
|
||||
#</VirtualHost>
|
||||
|
4
modules/mailman/files/index.html
Normal file
4
modules/mailman/files/index.html
Normal file
@ -0,0 +1,4 @@
|
||||
<html><body><h1>It works!</h1>
|
||||
<p>This is the default web page for this server.</p>
|
||||
<p>The web server software is running but no content has been added, yet.</p>
|
||||
</body></html>
|
@ -8,6 +8,16 @@ class mailman($mailman_host='') {
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
file { "/var/www/index.html":
|
||||
source => 'puppet:///modules/mailman/index.html',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
ensure => 'present',
|
||||
replace => 'true',
|
||||
mode => 444,
|
||||
require => Package["apache2"],
|
||||
}
|
||||
|
||||
file { '/etc/mailman/mm_cfg.py':
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
@ -18,14 +28,34 @@ class mailman($mailman_host='') {
|
||||
require => Package["mailman"]
|
||||
}
|
||||
|
||||
file { '/etc/mailman/apache.conf':
|
||||
file { "/etc/apache2/sites-available/mailman":
|
||||
content => template('mailman/mailman.vhost.erb'),
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 444,
|
||||
ensure => 'present',
|
||||
source => 'puppet:///modules/mailman/apache.conf',
|
||||
replace => 'true',
|
||||
require => Package["mailman"]
|
||||
mode => 444,
|
||||
require => Package["apache2"],
|
||||
}
|
||||
|
||||
file { "/etc/apache2/sites-enabled/mailman":
|
||||
ensure => link,
|
||||
target => '/etc/apache2/sites-available/mailman',
|
||||
require => [
|
||||
File['/etc/apache2/sites-available/mailman'],
|
||||
],
|
||||
}
|
||||
|
||||
file { '/etc/apache2/sites-enabled/000-default':
|
||||
require => File['/etc/apache2/sites-available/mailman'],
|
||||
ensure => absent,
|
||||
}
|
||||
|
||||
exec { "gracefully restart apache":
|
||||
subscribe => [ File["/etc/apache2/sites-available/mailman"]],
|
||||
refreshonly => true,
|
||||
path => "/bin:/usr/bin:/usr/sbin",
|
||||
command => "apache2ctl graceful",
|
||||
}
|
||||
|
||||
service { 'mailman':
|
||||
@ -38,7 +68,7 @@ class mailman($mailman_host='') {
|
||||
service { 'apache2':
|
||||
ensure => running,
|
||||
hasrestart => true,
|
||||
subscribe => File['/etc/mailman/apache.conf'],
|
||||
subscribe => File["/etc/apache2/sites-available/mailman"],
|
||||
require => Package["apache2"]
|
||||
}
|
||||
}
|
||||
|
49
modules/mailman/templates/mailman.vhost.erb
Normal file
49
modules/mailman/templates/mailman.vhost.erb
Normal file
@ -0,0 +1,49 @@
|
||||
<VirtualHost *:80>
|
||||
ServerName <%= mailman_host %>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/mailman-error.log
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit,
|
||||
# alert, emerg.
|
||||
LogLevel warn
|
||||
|
||||
CustomLog ${APACHE_LOG_DIR}/mailman-access.log combined
|
||||
|
||||
DocumentRoot /var/www
|
||||
|
||||
# We can find mailman here:
|
||||
ScriptAlias /cgi-bin/mailman/ /usr/lib/cgi-bin/mailman/
|
||||
# And the public archives:
|
||||
Alias /pipermail/ /var/lib/mailman/archives/public/
|
||||
# Logos:
|
||||
Alias /images/mailman/ /usr/share/images/mailman/
|
||||
|
||||
# Use this if you don't want the "cgi-bin" component in your URL:
|
||||
# In case you want to access mailman through a shorter URL you should enable
|
||||
# this:
|
||||
#ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/
|
||||
# In this case you need to set the DEFAULT_URL_PATTERN in
|
||||
# /etc/mailman/mm_cfg.py to http://%s/mailman/ for the cookie
|
||||
# authentication code to work. Note that you need to change the base
|
||||
# URL for all the already-created lists as well.
|
||||
|
||||
<Directory /usr/lib/cgi-bin/mailman/>
|
||||
AllowOverride None
|
||||
Options ExecCGI
|
||||
AddHandler cgi-script .cgi
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
<Directory /var/lib/mailman/archives/public/>
|
||||
Options FollowSymlinks
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
<Directory /usr/share/images/mailman/>
|
||||
AllowOverride None
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
</VirtualHost>
|
Loading…
x
Reference in New Issue
Block a user