3月 18, 2012

Exim4 與 SquirrelMail 設定


設定 Exim4


​# apt-get install dovecot-common dovecot-imapd dovecot-pop3d

# vim /etc/dovecot/dovecot.conf 加入
protocols = imap imaps pop3 pop3s
# vim /etc/exim4/update-exim4.conf.conf
dc_eximconfig_configtype='internet'
# 接收 user@mail.server.net 的信件
dc_other_hostnames='mail.server.net'
# 接受各方連線
dc_local_interfaces='0.0.0.0'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
# exim4 -bt user (檢測郵件派送路徑)
R: system_aliases for user@mail.server.net
R: userforward for user@mail.server.net
R: procmail for user@mail.server.net
R: maildrop for user@mail.server.net
R: lowuid_aliases for user@mail.server.net (UID 1000)
R: local_user for user@mail.server.net
user@mail.server.net
router = local_user, transport = mail_spool


設定 SquirrelMail


1. 至 SquirrelMail 網站下載最新版

2. 在 SquirrelMail Configuration - Languages 下面(控制信件內容)
Default Language : zh_TW
Default Charset : UTF-8
3. 在 functions/i18n.php 下面改成 (控制信件列表)
$languages['zh_TW']['NAME'] = 'Chinese Trad';
$languages['zh_TW']['CHARSET'] = 'big5';
$languages['zh_TW']['LOCALE'] = array('zh_TW.UTF-8', 'zh_TW.big5');
$languages['tw']['ALIAS'] = 'zh_TW';

3月 15, 2012

Lighttpd SSL 加密連線設定

使用 OpenSSL 製作憑證


1. 產生 Private Key
# openssl genrsa -out private.key 1024

2. 使用私鑰產出 Certificate Signing Request(CSR)
# openssl req -new -key private.key -out server.csr

3. 產生 SSL Certificate(CRT)
# openssl x509 -req -days 365 -in server.csr -signkey private.key -out server.crt

4. 把 Private Key 與 CRT 倒在一起,成為 PEM 檔案
# cat private.key server.crt > server.pem

修改 Lighttpd 連線設定


1. 把檔案都丟到 /etc/lighttpd/ssl/ 下面
# cp * /etc/lighttpd/ssl/

2. 更改檔案擁有者
# chown -R www-data:www-data /etc/lighttpd/ssl/*

3. 設定 lighttpd 的 SSL 模組
# vim /etc/lighttpd/conf-enabled10-ssl.conf
$SERVER["socket"] == "0.0.0.0:443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/ssl/server.pem"
}
4. 重新啟動 lighttpd
憑證只有在 lighttpd 啟動時會載入一次,所以當有新憑證產生,記得重新啟動。
# /etc/init.d/lighttpd restart

3月 14, 2012

OpenVZ syslog-ng: Error setting capabilities

錯誤訊息: syslog-ng: Error setting capabilities, capability management disabled; error='Operation not permitted' 修改 /etc/default/syslog-ng SYSLOGNG_OPTS="--no-caps"