收到 Sympa 版本 5.4.3 已經釋出的消息很久了,但是一直都沒有想要更新。最近因為經常要發送「靜思晨語。法譬如水」的關係,覺得這個服務有點變得比較重要了,所以想要把他更新一下。並且調整一些系統上的架構,把資料的穩定性提高一些。
有幾件工作要進行的:
- 更新到 sympa-5.4.3
- 後端資料庫增強 replication 的能力,避免發生 single point failure 的狀況,造成服務中斷或訂閱資料遺失的問題。
- 既有的資料的定期備份到 NAS 上去儲存。
目前只先進行第 1,2 兩項,至於 NAS 那邊,雖然已經有設備了,但是還沒有時間去研究要如何設定他?怎麼樣才能正常備份,所以先放著。以後再找時間處理。
上次更新 sympa 到 5.3.4 已經是去年二月份的事情了,超過一年沒有更新,其實也滿不安心的。但是就算是去年更新到 sympa-5.3.4 也都是自力救濟,因為 FreeBSD ports 到目前為止都還停留在 5.3.2 的版本。那已經是 2006 年的版本了。
這次和上次有些地方稍微省略了一些,比如說繁體中文的翻譯已經預設就具備了,所以這次不用自己翻到昏過去。在 2008/5/8 發佈安裝程序的時候,!FreeBSD 的 ports 還沒有支援完整需要的 perl extension,不過到了 2008/8/19 在確認的時候,已經該有的都有了。
以下是一些重要的安裝過程的筆記,提供日後如果還要更新版本的時候,可以拿來參考用。不外乎就是要確認程式版本相容性,需要的套件有沒有都裝到之類的。以及啟動時的設定也要準備好。
sympa-5.4.3 的 database schema 和 5.3.4 的又有很大的差異,所以如果已經有舊的資料,建議先用 pg_dump -a -D sympa 的方式,把資料 dump 出來,至於 schema 就直接用新的版本即可。等建立好了新的資料庫之後,再把舊的資料倒回去就可以了。
加上 -D 可以讓 pg_dump 在到資料出來的時候,採用 INSERT 的語法,並且加上 schema 的部分,在倒回去的時候比較不會出亂子。因為新舊的 schema 順序不同,不用這種方式去倒資料的話,可能回倒不回去資料庫當中。至於 -a 嗎?就是說我只要資料就好了,不需要給我 create table 的 SQL command,反正用不到,就不用麻煩倒給我了。
忙了一整天,總算搞定。可以趕上今天深夜要發送明天的靜思晨語的需要。
需要的套件
建立目錄
mkdir /usr/ports/local/sympa
建立 Makefile
# New ports collection makefile for: sympa5
# Date created: 8 May 2008
# Whom: Kuo-Feng Tseng <kftseng@iyard.org>
#
# $FreeBSD: ports/local/sympa5/Makefile,v 1.11 2008/05/08 21:43:40 kftseng Exp $
#
PORTNAME= sympa
PORTVERSION= 5.4.3
CATEGORIES= local
MASTER_SITES?= http://www.sympa.org/distribution/
MAINTAINER= kftseng@iyard.org
COMMENT= Sympa is an electronic mailing list manager
BUILD_DEPENDS+= ${SITE_PERL}/Archive/Zip.pm:${PORTSDIR}/archivers/p5-Archive-Zip \
${SITE_PERL}/IO/Stringy.pm:${PORTSDIR}/devel/p5-IO-stringy \
${SITE_PERL}/SOAP/Lite.pm:${PORTSDIR}/net/p5-SOAP-Lite \
${SITE_PERL}/Locale/TextDomain.pm:${PORTSDIR}/devel/p5-Locale-libintl \
${SITE_PERL}/Regexp/Common.pm:${PORTSDIR}/textproc/p5-Regexp-Common \
${SITE_PERL}/${PERL_ARCH}/Template.pm:${PORTSDIR}/www/p5-Template-Toolkit \
${SITE_PERL}/${PERL_ARCH}/XML/LibXML.pm:${PORTSDIR}/textproc/p5-XML-LibXML \
${SITE_PERL}/Crypt/CipherSaber.pm:${PORTSDIR}/security/p5-Crypt-CipherSaber \
${SITE_PERL}/Net/LDAP.pm:${PORTSDIR}/net/p5-perl-ldap \
${SITE_PERL}/${PERL_ARCH}/DBI.pm:${PORTSDIR}/databases/p5-DBI \
${SITE_PERL}/MHonArc/UTF8.pm:${PORTSDIR}/www/mhonarc \
${SITE_PERL}/MIME/Charset.pm:${PORTSDIR}/mail/p5-MIME-Charset \
${SITE_PERL}/MIME/EncWords.pm:${PORTSDIR}/mail/p5-MIME-EncWords \
${SITE_PERL}/${PERL_ARCH}/Crypt/OpenSSL/X509.pm:${PORTSDIR}/security/p5-Crypt-OpenSSL-X509 \
${SITE_PERL}/HTML/StripScripts/Parser.pm:${PORTSDIR}/www/p5-HTML-StripScripts-Parser \
${SITE_PERL}/Locale/Maketext/Lexicon/Gettext.pm:${PORTSDIR}/devel/p5-Locale-Maketext-Lexicon
RUN_DEPENDS= ${BUILD_DEPENDS}
LATEST_LINK= sympa5
USE_APACHE= 1.3+
CONFLICTS= sympa-4* sympa-5.[0-1]* sympa-5.2.1* sympa-5.2.2* sympa-5.2.4*
DB_TYPE?=mysql
PORTDOCS= *
.if defined(WITHOUT_NLS)
PLIST_SUB+= NLS="@comment "
.else
PLIST_SUB+= NLS=""
.endif
.include <bsd.port.pre.mk>
.if ${PERL_LEVEL} < 500806
IGNORE= needs Perl 5.8.6 or above (lang/perl5.8)
.endif
.if defined(WITH_FASTCGI)
BUILD_DEPENDS+= ${LOCALBASE}/${APACHEMODDIR}/mod_fcgid.so:${PORTSDIR}/www/mod_fcgid
BUILD_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/FCGI.pm:${PORTSDIR}/www/p5-FastCGI
.endif
.if ${DB_TYPE} == "Oracle"
BUILD_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/Oracle.pm:${PORTSDIR}/databases/p5-DBD-Oracle
.else
.if ${DB_TYPE} == "Pg"
BUILD_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/Pg.pm:${PORTSDIR}/databases/p5-DBD-Pg
.else
.if ${DB_TYPE} == "Sybase"
BUILD_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/Sybase.pm:${PORTSDIR}/databases/p5-DBD-Sybase
.else
.if ${DB_TYPE} == "mysql"
BUILD_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql
.endif
.endif
.endif
.endif
HAS_CONFIGURE= yes
USE_PERL5= yes
CONFIGURE_ARGS+=--prefix=${PREFIX} \
--with-confdir=${PREFIX}/etc/sympa \
--with-initdir=${PREFIX}/etc/rc.d \
--with-etcdir=${PREFIX}/etc/sympa \
--with-cgidir=${PREFIX}/sympa/cgi-bin \
--with-iconsdir=${PREFIX}/sympa/icons \
--with-sbindir=${PREFIX}/sbin \
--with-libdir=${PREFIX}/lib/sympa \
--with-libexecdir=${PREFIX}/libexec/sympa \
--with-datadir=${DATADIR} \
--with-expldir=${PREFIX}/sympa/expl \
--with-lockdir=/var/spool/lock \
--with-piddir=/var/run/sympa \
--with-localedir=${PREFIX}/share/locale \
--with-mandir=${PREFIX}/man \
--with-docdir=${DOCSDIR} \
--with-sampledir=${EXAMPLESDIR} \
--with-spooldir=${PREFIX}/sympa/spool
.if defined(SENDMAIL_ALIASES_PATH)
CONFIGURE_ARGS+=--with-sendmail_aliases=${SENDMAIL_ALIASES_PATH}
.endif
.if defined(VIRTUAL_ALIASES_PATH)
CONFIGURE_ARGS+=--with-virtual_aliases=${VIRTUAL_ALIASES_PATH}
.endif
.if defined(NEWALIASES_PATH)
CONFIGURE_ARGS+=--with-newaliases=${NEWALIASES_PATH}
.endif
.if defined(NEWALIASES_ARG)
CONFIGURE_ARGS+=--with-newaliases_arg=${NEWALIASES_ARG}
.endif
.if defined(POSTMAP_PATH)
CONFIGURE_ARGS+=--with-postmap=${POSTMAP_PATH}
.endif
.if defined(POSTMAP_ARG)
CONFIGURE_ARGS+=--with-postmap_arg=${POSTMAP_ARG}
.endif
.if defined(MHONARC_PATH)
CONFIGURE_ARGS+=--with-mhonarc=${MHONARC_PATH}
.endif
.if defined(OPENSSL_PATH)
CONFIGURE_ARGS+=--with-openssl=${OPENSSL_PATH}
.endif
CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
MAKE_ENV?= PERL_EXTUTILS_AUTOINSTALL=--skip
MAN8= alias_manager.8 archived.8 bounced.8 sympa.8
pre-fetch:
@${ECHO} ""
@${ECHO} "You may use the following build options:"
@${ECHO} ""
@${ECHO} " DB_TYPE=type Optional: mysql, Oracle, Pg or Sybase"
@${ECHO} " WITH_FASTCGI Use FastCGI instead of plain CGI"
@${ECHO} ""
post-extract:
post-patch:
${MV} ${WRKSRC}/src/etc/script/sympa ${WRKSRC}/src/etc/script/sympa.sh
@${REINPLACE_CMD} -E 's,^(INITSRC.*=.*sympa)$$,\1.sh,' \
${WRKSRC}/src/etc/script/Makefile
.if defined(WITHOUT_NLS)
@${REINPLACE_CMD} -e 's, locale$$,,g' \
-e 's, installlocale,,g' \
${WRKSRC}/Makefile.in
.else
@${REINPLACE_CMD} -e 's, checklocales,,' \
${WRKSRC}/po/Makefile
.endif
.if defined(NOPORTDOCS)
@${REINPLACE_CMD} -e 's, installdoc,,g' \
${WRKSRC}/Makefile.in
.endif
@${FIND} ${WRKSRC} -name "*.orig" -a -exec ${RM} -f {} \;
pre-install:
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
@PKG_PREFIX=${PREFIX} DB_TYPE=${DB_TYPE} WITH_FASTCGI=${WITH_FASTCGI} \
${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
cp ${FILESDIR}/sympa.conf ${TARGETDIR}/etc/sympa
cp ${FILESDIR}/wwsympa.conf ${TARGETDIR}/etc/sympa
post-deinstall:
@PKG_PREFIX=${PREFIX} ${SH} ${PKGDEINSTALL} ${PKGNAME} POST-DEINSTALL
.include <bsd.port.post.mk>
建立 distinfo
make makesum
建立 patch files
- 舊有的 Patch Files 都不太適用了,所以我自己全部調整過。
- files/patch-Makefile.in
--- Makefile.in-orig 2008-05-08 14:15:03.000000000 +0800
+++ Makefile.in 2008-05-08 15:00:21.000000000 +0800
@@ -612,7 +612,7 @@
$(MAKE) PERL='${PERL}' clean) || exit 1; \
done;
-install: importantchanges installdir installsrc installwws installwebtt2 installmailtt2 installlocale installman installscript installsample installconfig installdoc installsoap nextstep
+install: installdir installsrc installwws installwebtt2 installmailtt2 installlocale installman installscript installsample installconfig installdoc installsoap nextstep
nextstep:
@echo ""
@@ -797,17 +797,6 @@
fi \
done \
fi
- @if [ ! -f $(DESTDIR)$(CONFDIR)/sympa.conf ] ; then \
- echo "First installation : creating archives and bounce directories..."; \
- for dir in bounce arc ; do \
- if [ ! -d $(DESTDIR)$(DIR)/$$dir ] ; then \
- echo "Creating $(DESTDIR)$(DIR)/$$dir"; \
- mkdir -p $(DESTDIR)$(DIR)/$$dir; \
- chown $(USER) $(DESTDIR)$(DIR)/$$dir; \
- chgrp $(GROUP) $(DESTDIR)$(DIR)/$$dir; \
- fi \
- done \
- fi
installconfig:
mkdir -p $(DESTDIR)$(CONFDIR)
@@ -823,14 +812,7 @@
INITCONF='1'; \
fi \
fi \
- done; \
- if [ "$$INITCONF" ] ; then \
- echo "###############################################"; \
- echo "It seems to be your first installation of Sympa"; \
- echo "The following wizard will help you create your $(CONFDIR)/sympa.conf and $(CONFDIR)/wwsympa.conf :"; \
- DESTDIR=$(DESTDIR); export DESTDIR; \
- $(PERL) -I $(DESTDIR)$(LIBDIR) $(DESTDIR)$(SBINDIR)/sympa_wizard.pl; \
- fi
+ done;
build_rh_rpm: clean
@echo "Building RedHat RPM in $(RPMTOPDIR) ..."
- files/patch-src-alias_manager.pl
--- src/alias_manager.pl.orig Wed Jan 4 21:16:30 2006
+++ src/alias_manager.pl Thu Aug 9 22:40:18 2007
@@ -43,7 +43,7 @@
my $tmp_alias_file = $Conf{'tmpdir'}.'/sympa_aliases.'.time;
-my $alias_wrapper = '--MAILERPROGDIR--/aliaswrapper';
+my $alias_wrapper = '--LIBEXECDIR--/aliaswrapper';
my $lock_file = '--EXPL_DIR--/alias_manager.lock';
my $default_domain;
my $path_to_queue = '--MAILERPROGDIR--/queue';
- files/patch-src-etc-script-sympa
--- src/etc/script/sympa.orig Mon Apr 16 17:28:17 2007
+++ src/etc/script/sympa Thu Aug 9 21:44:03 2007
@@ -101,7 +101,7 @@
# startparam=""
# fi
- if [ ${OSTYPE} = "Slack" -o ${OSTYPE} = "IRIX" -o ${OSTYPE} = "SunOS" -o ${OSTYPE} = "Debian" -o ${OSTYPE} = "Suse" ]; then
+ if [ ${OSTYPE} = "FreeBSD" -o ${OSTYPE} = "Slack" -o ${OSTYPE} = "IRIX" -o ${OSTYPE} = "SunOS" -o ${OSTYPE} = "Debian" -o ${OSTYPE} = "Suse" ]; then
$sympadir/$1.pl $startparam && echo "success" || echo "failure"
else
$sympadir/$1.pl $startparam && success || failure
@@ -159,7 +159,7 @@
pid=`head -1 --PIDDIR--/$1.pid`
running=`ps -A | grep "$pid"`
if [ "$running" != "" ]; then
- if [ ${OSTYPE} = "Slack" -o ${OSTYPE} = "IRIX" -o ${OSTYPE} = "SunOS" -o ${OSTYPE} = "Debian" -o ${OSTYPE} = "Suse" ]; then
+ if [ ${OSTYPE} = "FreeBSD" -o ${OSTYPE} = "Slack" -o ${OSTYPE} = "IRIX" -o ${OSTYPE} = "SunOS" -o ${OSTYPE} = "Debian" -o ${OSTYPE} = "Suse" ]; then
kill -TERM $pid && echo "success" || echo "failure"
else
kill -TERM $pid && success || failure
- files/patch-src-sympa_wizard.pl
--- src/sympa_wizard.pl.orig Sun Mar 4 18:41:19 2007
+++ src/sympa_wizard.pl Thu Aug 9 21:47:07 2007
@@ -92,13 +92,13 @@
'advice' =>''},
{'name' => 'arc_path',
- 'default' => '--DIR--/arc',
+ 'default' => '--DIR--/sympa/arc',
'query' => 'Where to store HTML archives',
'file' => 'wwsympa.conf','edit' => '1',
'advice' =>'Better if not in a critical partition'},
{'name' => 'bounce_path',
- 'default' => '--DIR--/bounce',
+ 'default' => '--DIR--/sympa/bounce',
'query' => 'Where to store bounces',
'file' => 'wwsympa.conf',
'advice' =>'Better if not in a critical partition'},
@@ -340,14 +340,14 @@
'advice' =>''},
{'name' => 'mhonarc',
- 'default' => '/usr/bin/mhonarc',
+ 'default' => '/usr/local/bin/mhonarc',
'query' => 'Path to MhOnarc mail2html pluggin',
'file' => 'wwsympa.conf','edit' => '1',
'advice' =>'This is required for HTML mail archiving'},
{'title' => 'S/MIME pluggin'},
{'name' => 'openssl',
- 'sample' => '/usr/local/bin/openssl',
+ 'sample' => '/usr/bin/openssl',
'query' => 'Path to OpenSSL',
'file' => 'sympa.conf','edit' => '1',
'advice' =>'Sympa knowns S/MIME if openssl is installed'},
- files/patch-web_tt2-arcsearch.tt2
--- web_tt2/arcsearch.tt2.orig Fri Nov 3 21:43:20 2006
+++ web_tt2/arcsearch.tt2 Thu Aug 9 22:01:13 2007
@@ -14,7 +14,7 @@
[% IF how == 'phrase' %]
[%|loc%](This sentence,[%END%]
-[% ELSIF how == 'any' %]
+[% ELSIF how == 'all' %]
[%|loc%](All of these words,[%END%]
[% ELSE %]
[%|loc%](Each of these words,[%END%]
建立資料庫
- 如果可以的話,為了降低 database crash 風險,建議最好同時裝兩台 database server,並且設定同樣的 sympa 帳號與資料庫。
- 然後在 sympa 的主機上,安裝 pgpool-II,設定 replication_mode=true 和 load_balance_mode=true。並將 sympa 連線的設定改到 pgpool-II 之上即可。
建立資料庫及連結資料庫的帳號
- 建立帳號
% create_user -S -D -R -U pgsql -P sympa
- 建立資料庫
% create_db -U pgsql -O sympa -E SQL_ASCII sympa
Database Schema for PostgreSQL
-- PostgreSQL Database creation script
CREATE DATABASE sympa;
-- Connect to DB
\connect sympa
DROP TABLE user_table;
CREATE TABLE user_table (
email_user varchar (100) NOT NULL,
gecos_user varchar (150),
cookie_delay_user int4,
password_user varchar (40),
lang_user varchar (10),
attributes_user varchar (255),
data_user varchar (255),
CONSTRAINT ind_user PRIMARY KEY (email_user)
);
DROP TABLE subscriber_table;
CREATE TABLE subscriber_table (
list_subscriber varchar (50) NOT NULL,
user_subscriber varchar (100) NOT NULL,
custom_attribute_subscriber varchar (500),
robot_subscriber varchar (80) NOT NULL,
date_subscriber timestamp with time zone NOT NULL,
update_subscriber timestamp with time zone,
visibility_subscriber varchar (20),
reception_subscriber varchar (20),
topics_subscriber varchar (200),
bounce_subscriber varchar (35),
bounce_score_subscriber int4,
bounce_address_subscriber varchar (100),
comment_subscriber varchar (150),
subscribed_subscriber smallint,
included_subscriber smallint,
include_sources_subscriber varchar(50),
CONSTRAINT ind_subscriber PRIMARY KEY (robot_subscriber,list_subscriber,user_subscriber)
);
CREATE INDEX subscriber_idx ON subscriber_table (robot_subscriber,list_subscriber,user_subscriber);
CREATE INDEX subscriber_idx2 ON subscriber_table (user_subscriber);
DROP TABLE admin_table;
CREATE TABLE admin_table (
list_admin varchar(50) NOT NULL,
user_admin varchar(100) NOT NULL,
robot_admin varchar(80) NOT NULL,
role_admin varchar(15) NOT NULL,
date_admin timestamp with time zone NOT NULL,
update_admin timestamp with time zone,
reception_admin varchar(20),
visibility_admin varchar(20),
comment_admin varchar(150),
subscribed_admin smallint,
included_admin smallint,
include_sources_admin varchar(50),
info_admin varchar(150),
profile_admin varchar(15),
CONSTRAINT ind_admin PRIMARY KEY (robot_admin, list_admin, role_admin, user_admin)
);
CREATE INDEX admin_idx ON admin_table(robot_admin, list_admin, role_admin, user_admin);
CREATE INDEX admin_idx2 ON admin_table(user_admin);
DROP TABLE netidmap_table;
CREATE TABLE netidmap_table (
netid_netidmap varchar (100) NOT NULL,
serviceid_netidmap varchar (100) NOT NULL,
robot_netidmap varchar (80) NOT NULL,
email_netidmap varchar (100),
CONSTRAINT ind_netidmap PRIMARY KEY (netid_netidmap, serviceid_netidmap, robot_netidmap)
);
CREATE INDEX netidmap_idx ON netidmap_table(netid_netidmap, serviceid_netidmap, robot_netidmap);
DROP TABLE logs_table;
CREATE TABLE logs_table (
id_logs bigint NOT NULL,
date_logs int4 NOT NULL,
robot_logs varchar (80),
list_logs varchar (50),
action_logs varchar (50) NOT NULL,
parameters_logs varchar (100),
target_email_logs varchar (100),
user_email_logs varchar (100),
msg_id_logs varchar (255),
status_logs varchar (10) NOT NULL,
error_type_logs varchar (150),
client_logs varchar (100),
daemon_logs varchar (10) NOT NULL,
CONSTRAINT ind_logs PRIMARY KEY (id_logs)
);
CREATE INDEX logs_idx ON logs_table(id_logs);
DROP TABLE session_table;
CREATE TABLE session_table (
id_session int8 NOT NULL,
start_date_session int4 NOT NULL,
date_session int4 NOT NULL,
remote_addr_session varchar(60),
robot_session varchar(80),
email_session varchar(100),
hit_session int4,
data_session varchar(255),
CONSTRAINT ind_session PRIMARY KEY (id_session)
);
CREATE INDEX session_idx ON session_table(id_session);
設定
/usr/local/etc/sympa/sympa.conf
## Configuration file for Sympa
## many parameters are optional (defined in src/Conf.pm)
## refer to the documentation for a detailed list of parameters
###\\\\ Directories and file location ////###
## Directory containing mailing lists subdirectories
home /usr/local/sympa/expl
## Sendmail Alias File
sendmail_aliases /etc/mail/aliases.sympa
## Directory for configuration files ; it also contains scenari/ and templates/ directories
etc /usr/local/etc/sympa
## File containing Sympa PID while running.
## Sympa also locks this file to ensure that it is not running more than once. Caution : user sympa need to write access without special privilegee.
pidfile /var/run/sympa/sympa.pid
## Umask used for file creation by Sympa
umask 027
## Directory containing available NLS catalogues (Message internationalization)
localedir /usr/local/share/locale
## The main spool containing various specialized spools
## All spool are created at runtime by sympa.pl
spool /usr/local/sympa/spool
## Incoming spool
queue /usr/local/sympa/spool/msg
## Bounce incoming spool
queuebounce /usr/local/sympa/spool/bounce
## The directory where Sympa stores static contents (CSS, members pictures, documentation) directly delivered by Apache
static_content_path /usr/local/static_content
## The URL mapped with the static_content_path directory defined above
static_content_url /static-sympa
###\\\\ Syslog ////###
## The syslog facility for sympa
## Do not forget to edit syslog.conf
syslog LOCAL1
## Communication mode with syslogd is either unix (via Unix sockets) or inet (use of UDP)
log_socket_type unix
## Log intensity
## 0 : normal, 2,3,4 for debug
log_level 0
###\\\\ General definition ////###
## Main robot hostname
domain [主要的 hostname]
## Listmasters email list comma separated
## Sympa will associate listmaster privileges to these email addresses (mail and web interfaces). Some error reports may also be sent to these addresses.
listmaster [資料庫管理員的 email]
## Local part of sympa email adresse
## Effective address will be [EMAIL]@[HOST]
email sympa
## Who is able to create lists
## This parameter is a scenario, check sympa documentation about scenarios if you want to define one
create_list public_listmaster
###\\\\ Tuning ////###
## Use of binary version of the list config structure on disk: none | binary_file
## Set this parameter to "binary_file" if you manage a big amount of lists (1000+) ; it should make the web interface startup faster
cache_list_config none
## Secret used by Sympa to make MD5 fingerprint in web cookies secure
## Should not be changed ! May invalid all user password
cookie [一個整數,系統更新的話還是要保留舊的整數,不然會無法登入系統]
## comma separated list of operation for which blacklist filter is applyed
## set this parameter to "none" hidde blacklist feature
use_blacklist send,create_list
###\\\\ Internationalization ////###
## Default lang (ca | cs | de | el | es | et_EE | en_US | fr | hu | it | ja_JP | ko | nl | oc | pt_BR | ru | sv | tr | zh_CN | zh_TW)
## This is the default language used by Sympa
lang zh_TW
## Supported languages
## This is the set of language that will be proposed to your users for the Sympa GUI. Don't select a language if you don't have the proper locale packages installed.
#supported_lang ca,cs,de,el,es,et_EE,en_US,fr,hu,it,ja_JP,ko,nl,oc,pt_BR,ru,sv,tr,zh_CN,zh_TW
supported_lang en_US,zh_TW,zh_CN
###\\\\ Errors management ////###
## Bouncing email rate for warn list owner
bounce_warn_rate 10
## Bouncing email rate for halt the list (not implemented)
## Not yet used in current version, Default is 50
bounce_halt_rate 50
## Task name for expiration of old bounces
expire_bounce_task daily
## Welcome message return-path
## If set to unique, new subcriber is removed if welcome message bounce
welcome_return_path unique
###\\\\ MTA related ////###
## Path to the MTA (sendmail, postfix, exim or qmail)
## should point to a sendmail-compatible binary (eg: a binary named 'sendmail' is distributed with Postfix)
sendmail /usr/local/sbin/sendmail
## Maximum number of recipients per call to Sendmail. The nrcpt_by_domain.conf file allows a different tuning per destination domain.
nrcpt 25
## Max. number of different domains per call to Sendmail
avg 10
## Max. number of Sendmail processes (launched by Sympa) running simultaneously
## Proposed value is quite low, you can rise it up to 100, 200 or even 300 with powerfull systems.
maxsmtp 40
###\\\\ Pluggin ////###
## Path to the antivirus scanner engine
## supported antivirus : McAfee/uvscan, Fsecure/fsav, Sophos, AVP and Trend Micro/VirusWall
#antivirus_path /usr/local/uvscan/uvscan
## Antivirus pluggin command argument
#antivirus_args --secure --summary --dat /usr/local/uvscan
###\\\\ S/MIME pluggin ////###
## Path to OpenSSL
## Sympa knowns S/MIME if openssl is installed
#openssl /usr/bin/openssl
## The directory path use by OpenSSL for trusted CA certificates
#capath /usr/local/etc/sympa/ssl.crt
## This parameter sets the all-in-one file where you can assemble the Certificates of Certification Authorities (CA)
#cafile /usr/local/apache/conf/ssl.crt/ca-bundle.crt
## User CERTs directory
ssl_cert_dir /usr/local/sympa/expl/X509-user-certs
## Password used to crypt lists private keys
#key_passwd your_password
###\\\\ Database ////###
## Database type (mysql | Pg | Oracle | Sybase | SQLite)
## be carefull to the case
db_type Pg
## Name of the database
## with SQLite, the name of the DB corresponds to the DB file
db_name sympa
## The host hosting your sympa database
db_host [資料庫主機的 hostname]
db_port [資料庫主機連線的 PORT]
## Database user for connexion
db_user sympa
## Database password (associated to the db_user)
## What ever you use a password or not, you must protect the SQL server (is it a not a public internet service ?)
db_passwd [連接資料庫的密碼]
## Database private extention to user table
## You need to extend the database format with these fields
#db_additional_user_fields age,address
## Database private extention to subscriber table
## You need to extend the database format with these fields
#db_additional_subscriber_fields billing_delay,subscription_expiration
###\\\\ Web interface ////###
## Sympa's main page URL
wwsympa_url http://epaper.iyard.net/w
/usr/local/etc/sympa/wwsympa.conf
###\\\\ Directories and file location ////###
## File containing archived PID while running.
archived_pidfile /var/run/sympa/archived.pid
## File containing bounced PID while running.
bounced_pidfile /var/run/sympa/bounced.pid
## File containing task_manager PID while running.
task_manager_pidfile /var/run/sympa/task_manager.pid
## Where to store HTML archives
## Better if not in a critical partition
arc_path /usr/local/sympa/arc
## Where to store bounces
## Better if not in a critical partition
bounce_path /usr/local/sympa/bounce
###\\\\ Syslog ////###
###\\\\ General definition ////###
###\\\\ Tuning ////###
## Password case (insensitive | sensitive)
## Should not be changed ! May invalid all user password
password_case insensitive
## HTTP cookies lifetime
cookie_expire 3600
## HTTP cookies validity domain
cookie_domain [登入系統 cookie 的 hostname]
###\\\\ Internationalization ////###
###\\\\ Errors management ////###
###\\\\ MTA related ////###
###\\\\ Pluggin ////###
## Path to MhOnarc mail2html pluggin
## This is required for HTML mail archiving
mhonarc /usr/local/bin/mhonarc
###\\\\ S/MIME pluggin ////###
###\\\\ Database ////###
###\\\\ Web interface ////###
## Is fast_cgi module for Apache (or Roxen) installed (0 | 1)
## This module provide much faster web interface
use_fast_cgi 1
## Title of main web page
title [提供的服務的名稱]
## Icons directory (web) location for Sympa
icons_url /icons
## Main page type (lists | home)
default_home home
啟動設定
apache22
- /usr/local/etc/apache22/vhosts/sympa.conf
LoadModule fcgid_module libexec/apache22/mod_fcgid.so
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
<VirtualHost *:80>
ServerAdmin webmaster@[server hostname]
DocumentRoot "/usr/local/www/sympa"
ServerName [server hostname]
AddDefaultCharset utf8
Alias /static-sympa/ /usr/local/static_content/
ScriptAlias /w /usr/local/sympa/cgi-bin/wwsympa-wrapper.fcgi
#ScriptAlias /ws /usr/local/sympa/cgi-bin/sympa_soap_server.fcgi
<Directory /usr/local/sympa/cgi-bin>
SetHandler fcgid-script
# SetHandler cgi-script
Allow from all
Options ExecCGI
</Directory>
<Directory "/usr/local/static_content">
Allow from all
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine on
# RewriteCond %{SERVER_PORT} !443$
# RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]
RewriteRule ^/$ http://%{SERVER_NAME}/w
</IfModule>
</VirtualHost>