2008年7月14日 星期一

Openwebmail 的 Internal Server Error

其實滿多人都會遇到這個問題,更新系統後,OpenWebMail 就死了。

當初也被這個困擾好久,紀錄一下我找到的最好用的方法,通常可以在這兩招內把是這個 Internal Server Error 的問題搞定。

這個問題是發生是因為安裝、升級 perl 的時候「沒有 Enable_SUIDPERL」、或者是「OpenWebMail 檔案的權限」等問題為主。

解決辦法如下:

1. 編輯 /usr/local/etc/pkgtools.conf,在 MAKE_ARGS 區段中加入:

MAKE_ARGS = {
'lang/perl5.8' => 'ENABLE_SUIDPERL=yes',
}

之後做 portupgrade 的時候,就會自動 ENABLE_SUIDPERL 了。

這個辦法相當於在做 portupgrade 時,下了:

# portupgrade -f "perl-5.8.*" -m "ENABLE_SUIDPERL=yes" -r "perl-5.8.*"

的指令。

此外,第一次安裝時,必須編輯 /WWW_PATH/cgi-bin/openwebmail/etc/defaults/suid.conf

將 has_savedsuid_support 的 yes 改為 no

2. 新增一個 XXX.sh 檔案,修改權限讓他可以執行,內容是:

#!/bin/sh
chmod 4555 /usr/bin/suidperl
wwwdir='/www/cgi-bin/openwebmail/'
chown -R root:mail $wwwdir
chmod 4755 $wwwdir/openwebmail*.pl
chmod 0755 $wwwdir/vacation.pl
chmod 755 $wwwdir/etc
chmod 770 $wwwdir/etc/sessions
chmod 770 $wwwdir/etc/users

記得要修改 wwwdir,改為自己的正確路徑,之後只要執行這個檔案,就可以自動把權限修改
好了。

~nickle/ttt.sh

#!/bin/sh
chmod 4555 /usr/bin/suidperl
wwwdir='/usr/local/www/cgi-bin/openwebmail'
chown -R root:mail $wwwdir
chmod 4755 $wwwdir/openwebmail*.pl
chmod 0755 $wwwdir/vacation.pl
chmod 755 $wwwdir/etc
chmod 770 $wwwdir/etc/sessions
chmod 770 $wwwdir/etc/users

連結來源



2008年7月9日 星期三

clamav更新修正紀錄

症狀:
  1. openwebmail信件寄不出去
  2. /var/log/maillog 出現一堆錯誤訊息
  3. www# /usr/local/etc/rc.d/clamav-clamd start
    Missing /var/db/clamav/clamav/*.cvd files. You must run freshclam first
  4. www# tail /var/log/clamav/freshclam.log
    freshclam daemon 0.93 (OS: freebsd7.0, ARCH: i386, CPU: i386)
    ClamAV update process started at Wed Jul 9 10:48:40 2008
    WARNING: Your ClamAV installation is OUTDATED!
    WARNING: Local version: 0.93 Recommended version: 0.93.3
    DON'T PANIC! Read http://www.clamav.net/support/faq
    main.cld is up to date (version: 47, sigs: 312304, f-level: 31, builder: sven)
    daily.cld is up to date (version: 7669, sigs: 35027, f-level: 33, builder: ccordes)
更新port tree
  1. cd /usr/src
  2. make update
portupgrade
  1. cd /var/db/pkg
  2. portupgrade -Rcv clamav-0.93/

www# /usr/local/etc/rc.d/clamav-clamd start
Starting clamav_clamd.

www# /usr/local/etc/rc.d/clamav-milter start
Waiting for clamd socket.. 60.. 50.. 40.. 30.. 20.. 10..
There is no clamd socket (/var/run/clamav/clamd.sock)!
無法啟動


解決:
ee /usr/local/etc/clamd.conf

# Path to a local socket file the daemon will listen on.
# Default: disabled
LocalSocket /var/run/clamav/clamd
修改成
# Path to a local socket file the daemon will listen on.
# Default: disabled
LocalSocket /var/run/clamav/clamd.sock

重新啟動sendmail
sh /etc/rc.sendmail stop
sh /etc/rc.sendmail start