首页

August 7, 2007

postfix FAQ (2)

问题一:
Aug 7 22:26:22 mail postfix/smtpd[16829]: warning: xsasl_cyrus_server_get_mechanism_list: no applicable SASL mechanisms
Aug 7 22:26:22 mail postfix/smtpd[16829]: fatal: no SASL authentication mechanisms
Aug 7 22:26:23 mail postfix/master[16825]: warning: process /usr/libexec/postfix/smtpd pid 16829 exit status 1
Aug 7 22:26:23 mail postfix/master[16825]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Aug 7 22:28:06 mail postfix/smtpd[16830]: warning: xsasl_cyrus_server_get_mechanism_list: no applicable SASL mechanisms
Aug 7 22:28:06 mail postfix/smtpd[16830]: fatal: no SASL authentication mechanisms
Aug 7 22:28:07 mail postfix/master[16825]: warning: process /usr/libexec/postfix/smtpd pid 16830 exit status 1

解决方法:

# ln -s /usr/local/lib/sasl2 /usr/lib/sasl2

问题二:
Jan 15 20:24:43 localhost postfix/smtpd[3048]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory

原因:系统已经安装sasl-cyrus 删除掉,然后编译重装

由 frank 发表于 10:39 PM | 回复 (0)

August 2, 2007

mysql,php升级笔记

1:mysql 5.0.45

useradd -M -o -r -d /www/mysql -s /bin/bash -c "MySQL Server" -u 27 mysql

./configure --prefix=/usr/local/mysql5 --sysconfdir=/etc --enable-assembler --with-mysqld-ldflags=-all-static --localstatedir=/www/mysql --with-big-tables --with-low-memory --with-extra-charsets=all --enable-thread-safe-client

make

make install

cp support-files/my-large.cnf /etc/my.cnf (针对512M的,不同的内存有不同的配置文件)

cp support-files/mysql.server /etc/rc.d/init.d/mysqld5

chmod 755 /etc/rc.d/init.d/mysqld

chkconfig --add mysqld

/usr/local/mysql5/bin/mysql_install_db --user=mysql


vi /etc/ld.so.conf

增加
/usr/local/mysql5/lib/mysql/

保存ldconfig


修改 /etc/profile

export PATH=$PATH:/usr/local/mysql5/bin

设置密码

mysqladmin -u root password 'password'


2:iconv

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.11.tar.gz

./configure --prefix=/usr
make
make install

ldconfig

3:gd

wget http://www.libgd.org/releases/gd-2.0.35.tar.gz
./configure
make
make install

4:t1lib

./configure

make without_doc
make install

5:freetds

wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz

tar zvxf freetds-stable.tgz
cd freetds-0.64
./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib
make
make install


6:libxm2

wget ftp://xmlsoft.org/libxml2/libxml2-sources-2.6.29.tar.gz

./configure
make
make install


7:php

./configure --prefix=/usr/local/php5 --enable-exif --with-iconv=/usr --with-xml=/usr/local --with-curl=/usr --with-gdbm --with-gettext --enable-track-vars --with-calendar=shared --enable-magic-quotes --enable-trans-sid --enable-wddx --enable-ftp --enable-inline-optimization --with-gd=/usr/local --with-zlib --enable-gd-native-tt --with-t1lib=/usr/local --with-jpeg-dir=/usr --with-zlib-dir=/usr --with-ttf --with-freetype-dir=/usr --with-gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-mysql=/usr/local/mysql5 --enable-force-cgi-redirect --with-apxs2=/usr/local/apache2/bin/apxs --with-mssql=/usr/local/freetds --with-pdo-mysql=/usr/local/mysql5

修改httpd.conf

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

修改默认首页 index.php

cp php.ini-dist /usr/local/php5/lib/php.ini

修改php.ini文件
register_globals = On

由 frank 发表于 9:29 AM | 回复 (1)

July 20, 2007

RHEL 5 安装 序列号

RHEL 5 安装 序列号


Server:

* Red Hat Enterprise Linux (Server including virtualization):
2515dd4e215225dd

+ Red Hat Enterprise Linux Virtualization Platform:
49af89414d147589

Client:

* Red Hat Enterprise Linux Desktop:
660266e267419c67

+ Red Hat Enterprise Linux Desktop + Workstation Option:
da3122afdb7edd23

+ Red Hat Enterprise Linux Desktop + Workstation + DualOS Option
(Virtualization):
7fcc43557e9bbc42

+ Red Hat Enterprise Linux Desktop + DualOS Option (Virtualization):
fed67649ff918c77

测试过,可行!

由 frank 发表于 5:37 PM | 回复 (0)

January 16, 2007

bind9编译笔记

tar zxvf bind-9.3.2-P1.tar.gz
cd bind-9.3.2-P1
./configure --prefix=/usr/local/named --enable-threads --disable-openssl-version-check

或者
./configure --prefix=/usr/local/named --enable-threads --with-openssl=/usr/local/openssl

make
make install

--enable-threads 开启多线程支持

groupadd bind
useradd -g bind -d /usr/local/named -s /sbin/nologin bind

cd /usr/local/named

mkdir etc

sbin/rndc-confgen > etc/rndc.conf

cd etc

tail -10 rndc.conf | head -9 | sed s/#\ //g > named.conf


mkdir /usr/local/named/var

chmod 777 /usr/local/named/var


cd /usr/local/named/var

vi localhost.zone


$TTL 86400
$ORIGIN localhost.
@ 1D IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
1D IN NS @
1D IN A 127.0.0.1

建立named.local文件
vi named.local


$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.

1 IN PTR localhost.

dig命令直接生成named.root文件

dig > named.root


vi common.zone
内容如下

zone "." IN {
type hint;
file "named.root";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};

vi /usr/local/named/etc/named.conf
主要内容如下

options {
directory "/usr/local/named/var";
pid-file "named.pid";
version "I am bind";
listen-on {x.x.x.x;};
};

controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};

include "common.zone";


chown -R bind:bind /usr/local/named

启动服务测试一下
/usr/local/named/sbin/named -c /usr/local/named/etc/named.conf -u bind &


查看状态

/usr/local/named/sbin/rndc status


为了方便建立启动脚本:

vi /etc/rc.d/init.d/named

#!/bin/bash
# named a network name service.
# chkconfig: 545 35 75
# description: a name server

if [ `id -u` -ne 0 ]
then
echo "ERROR:For bind to port 53,must run as root."
exit 1
fi
case "$1" in
start)
if [ -x /usr/local/named/sbin/named ]; then
/usr/local/named/sbin/named -c /usr/local/named/etc/named.conf -u bind && echo . && echo 'BIND9 server started'
fi
;;
stop)
kill `cat /usr/local/named/var/named.pid` && echo . && echo 'BIND9 server stopped'
;;
restart)
echo .
echo "Restart BIND9 server"
$0 stop
sleep 10
$0 start
;;
reload)
/usr/local/named/sbin/rndc reload
;;
status)
/usr/local/named/sbin/rndc status
;;
*)
echo "$0 start | stop | restart |reload |status"
;;
esac


chmod 755 /etc/rc.d/init.d/named

***********************************************************************
***********************************************************************

加入log配置

mkdir /usr/local/named/log

vi /usr/local/named/var/log.conf

logging {
channel warning
{ file "/usr/local/named/log/dns_warnings" versions 3 size 100m;
severity warning;
print-category yes;
print-severity yes;
print-time yes;
};
channel general_dns
{ file "/usr/local/named/log/dns_logs" versions 3 size 100m;
severity info;
print-category yes;
print-severity yes;
print-time yes;
};
category default { warning; };
category queries { general_dns; };
};


chown -R bind:bind /usr/local/named

说明:
1:print-time是设定在日志中是否需要写入时间,print-severity是设定在日志中是否需要写入消息级别,print-category是设定在日志中是否需要写入日志类别。
2:severity是指定记录消息的级别。在bind中主要有以下几个级别(按照严重性递减的顺序):

critical
error
warning
notice
info
debug [ level ]
dynamic

定义了某个级别后,系统会记录包括该级别以及比该级别更严重的级别的所有消息。比如定义级别为error,则会记录critical和error两个级别的信息。一般情况下,我们记录到info级别就可以了。

然后在/usr/local/named/etc/named.conf 加入下列语句

include "log.conf";


/usr/local/named/sbin/rndc reconfig

默认是不启用日志的,你可以通过

/usr/local/named/sbin/rndc status

看到:
query logging is OFF

所以我们用以下命令启用log日志

/usr/local/named/sbin/rndc querylog

由 frank 发表于 10:45 PM | 回复 (4) | 引用

December 27, 2006

bind9的部分FAQ

log日志报如下错误:

27-Dec-2006 23:02:57.118 general: error: dns_master_load: localhost.zone:2: unexpected end of line
27-Dec-2006 23:02:57.118 general: error: dns_master_load: localhost.zone:1: unexpected end of input
27-Dec-2006 23:02:57.118 general: error: zone localhost/IN: loading master file localhost.zone: unexpected end of input

解决办法:

localhost.zone配置文件里TTL前加上$


由 frank 发表于 11:15 PM | 回复 (0)

process `named' is using obsolete setsockopt SO_BSDCOMPAT

今天安装bind 9.3.3,成功安装后,message报如下错误
process `named' is using obsolete setsockopt SO_BSDCOMPAT

解决办法:

将Bind得tar包解压后,在其/lib/isc/unix/socket.c里面找到需要修改的代码:
首先找到这个 (在1297行附近):

#if defined(USE_CMSG) || defined(SO_BSDCOMPAT)
int on = 1;

改成:
#if defined(USE_CMSG)
int on = 1;


************************************************************
#ifdef SO_BSDCOMPAT
if (setsockopt(sock->fd, SOL_SOCKET, SO_BSDCOMPAT,
(void *)&on, sizeof on) < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d, SO_BSDCOMPAT) %s: %s",
sock->fd,
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
ISC_MSG_FAILED, "failed"),
strbuf);


/* Press on... /*
}
#endif

由 frank 发表于 10:59 PM | 回复 (0)

August 14, 2006

OpenVPN 2.0 HOWTO-安装篇(翻译)

原文:http://openvpn.net/howto.html
Installing OpenVPN
翻译水平有限,不当之处,请指出

OpenVPN can be downloaded here.For security, it's a good idea to check the file release signature after downloading.

The OpenVPN executable should be installed on both server and client machines, since the single executable provides both client and server functions.

Linux Notes (using RPM package)

If you are using a Linux distribution which supports RPM packages (SuSE, Fedora, Redhat, etc.), it's best to install using this mechanism. The easiest method is to find an existing binary RPM file for your distribution. You can also build your own binary RPM file:

rpmbuild -tb openvpn-[version].tar.gzOnce you have the .rpm file, you can install it with the usual

rpm -ivh openvpn-[details].rpm

or upgrade an existing installation with

rpm -Uvh openvpn-[details].rpm

Installing OpenVPN from a binary RPM package has these dependencies:

openssl
lzo
pam

Furthermore, if you are building your own binary RPM package, there are several additional dependencies:

openssl-devel
lzo-devel
pam-devel

See the openvpn.spec file for additional notes on building an RPM package for Red Hat Linux 9 or building with reduced dependencies.

Linux Notes (without RPM)

If you are using Debian, Gentoo, or a non-RPM-based Linux distribution, use your distro-specific packaging mechanism such as apt-get on Debian or emerge on Gentoo.

It is also possible to install OpenVPN on Linux using the universal ./configure method. First expand the .tar.gz file:

tar xfz openvpn-[version].tar.gzThen cd to the top-level directory and type:

./configure
make
make install

Windows Notes

OpenVPN for Windows can be installed from the self-installing exe file on the OpenVPN download page. Remember that OpenVPN will only run on Windows 2000 or later. Also note that OpenVPN must be installed and run by a user who has administrative privileges (this restriction is imposed by Windows, not OpenVPN). The restriction can be sidestepped by running OpenVPN in the background as a service, in which case even non-admin users will be able to access the VPN, once it is installed. More discussion on OpenVPN + Windows privilege issues.

OpenVPN can also be installed as a GUI on Windows, using Mathias Sundman's installation package, which will install both OpenVPN and the Windows GUI.

After you run the Windows installer, OpenVPN is ready to use and will associate itself with files having the .ovpn extension. To run OpenVPN, you can:

Right click on an OpenVPN configuration file (.ovpn) and select Start OpenVPN on this configuration file. Once running, you can use the F4 key to exit.

Run OpenVPN from a command prompt Window with a command such as:

openvpn myconfig.ovpnOnce running in a command prompt window, OpenVPN can be stopped by the F4 key.

Run OpenVPN as a service by putting one or more .ovpn configuration files in \Program Files\OpenVPN\config and starting the OpenVPN Service, which can be controlled from Start Menu -> Control Panel -> Administrative Tools -> Services.

A GUI is also available for the Windows version of OpenVPN.

Additional Windows install notes.

Mac OS X Notes
Angelo Laub and Dirk Theisen have developed an OpenVPN GUI for OS X.

See also OpenVPN Client and Mac OS X 10.3.

Other OSes
Some notes are available in the INSTALL file for specific OSes. In general, the

./configure
make
make install

method can be used, or you can search for an OpenVPN port or package which is specific to your OS/distribution.

安装OpenVPN

OpenVPN 可以从这里下载.
出于安全的考虑,强烈建议你下载后检查一下文件的数字签名 .
OpenVPN程序可以被安装在服务器端和客户端,本身这个程序是既提供服务器工程也提供客户端功能.

Linux 安装注意事项 (用RPM包)

如果你使用的是下列linux操作系统的RPM包管理方式 (SuSE, Fedora, Redhat, etc.), 最好安装使用这种包管理方式. 最方便的方法是找到他的二进制RPM包,你可以通过tar包自己编译适合自己机器的RPM包:

rpmbuild -tb openvpn-[version].tar.gz

只要你编译好RPM包,那就可以进行安装了

rpm -ivh openvpn-[details].rpm

或者升级已经安装的程序

rpm -Uvh openvpn-[details].rpm

用RPM包安装OpenVPN,会有以下的RPM包依赖关系:
• openssl
• lzo
• pam

此外,如果你自己编译适合自己的RPM包,你必须要事先安装好下列的依赖关系RPM包:
• openssl-devel
• lzo-devel
• pam-devel

查看openvpn.spec文件,看一下关于在Red Hat Linux 9系统上编译RPM包需要额外注意的包依赖关系.

Linux 安装注意事项 (不用RPM包)

如果你使用Debian,Gentoo这些非RPM包管理方式的linux发行系统,你可以使用他们自身的包管理方式,比如Debian用apt-get,Gentoo用emerge.

当然也可以采用普通的./configure方式编译安装OpenVPN,编译之前先解压缩.tar.gz文件:
tar xfz openvpn-[version].tar.gz
进入解压缩后的根目录
./configure
make
make install

Windows 安装注意事项

Winodow版的OpenVPN安装程序可以到 OpenVPN下载页面去下载.注意这个版本的OpenVPN只能在Windows2000或者更高的版本上才能安装. 另外要注意的是必须要拥有管理员权限的用户才能去安装OpenVPN,(这是Windows系统出于安全的限制).在这个限制下,OpenVPN可以运行在系统后台进行服务,即使当软件装完,非管理员用户想访问VPN. 更多关于 OpenVPN + Windows 权限的讨论.

OpenVPN在Windows下可以被装成图形界面,可以使用Mathias Sundman的安装包, 将同时装上OpenVPN和图形界面.
装完OpenVPN后,系统会使用已经关联的.ovpn后缀的文件. 为了运行OpenVPN,你可以:
• 右键单击OpenVPN的配置文件,即.ovpn后缀的文件,然后选择Start OpenVPN on this configuration file.程序就可以运行, 你可以用 F4快捷键退出.
• 在DOS窗口,你也可以用以下命令运行OpenVPN:
openvpn myconfig.ovpn
同样,用DOS命令启动的OpenVPN,也可以通过按 F4键退出.
• 我们可以通过开始 -> 控制面板 -> 管理工具 -> 服务 来启动OpenVPN服务,一个或更多的OpenVPN的配置文件放在\Program Files\OpenVPN\config下.
一个针对Windows的图形界面的OpenVPN.

更多windows安装程序注意事项.

Mac OS X 安装注意事项
Angelo Laub和Dirk Theisen 已经开发出OpenVPN GUI for OS X.
更多信息可查看 OpenVPN Client and Mac OS X 10.3.
其它操作系统

可以看INSTALL 文件关于其他系统的安装说明,一般情况下都是
./configure
make
make install

你可以针对你的系统和软件包管理方式寻找相应的OpenVPN包,并用合适的方法安装.

由 frank 发表于 12:11 PM | 回复 (0) | 引用

August 9, 2006

FMS2(Flash Media Server )服务器的设置-日志篇

FMS2(Flash Media Server )服务器的设置-日志篇

最近配置fms2,闲来顺便翻译了一下配置文件,翻译不好,就当参考吧:)

FMS的log日志设置

由 frank 发表于 11:50 AM | 回复 (2)

August 7, 2006

Red5 简单安装指南howto

Red5是个开源的flash服务器,相对fms 4500$的一个lic的价格,能省好多钱哦,今天就测试安装一下Red5

1.配置java环境
去sun网站下载最新的jdk1.5.0_07,怎么安装不说了,直接解压安装到/usr/java/jdk1.5.0_07目录

然后在/etc/profile添加以下几句信息
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin:/usr/java/jdk1.5.0_07/jre/bin
export JAVA_HOME=/usr/java/jdk1.5.0_07
export CLASSPATH="./:/usr/java/jdk1.5.0_07/lib:/usr/java/jdk1.5.0_07/jre/lib"
export LD_LIBRARY_PATH=/usr/java/jdk1.5.0_07/jre/lib/i386:/usr/java/jdk1.5.0_07/jre/lib/i386/server

注意,默认的as4可能自带java,把自带的先删除了!!

2.安装apche-ant
去apache网站下载最近的版本,安装方法跟jdk差不多,也是解压到/usr/local/ant目录

然后在/etc/profile添加以下几句信息
export ANT_HOME=/usr/local/ant
export PATH=$PATH:/usr/local/ant/bin


source /etc/profile 让配置生效

3.安装Red5

可以用svn下载最新的版本

svn co http://svn1.cvsdude.com/osflash/red5/java/server/tags/0_5/ red5

cd red5

编译:输入ant命令,自动编译

运行
./red5.sh &


4.简单的配置,使用demo
配置端口:conf/red5.properties 修改此文件就行

访问http://ip:5080

可以运行自带的demo,记住如果你配了ip,自带的demo里的地址localhost都要换成你的真实地址

在线录制的例子:
http://www.acmewebworks.com/red5/videos/SimpleStreamRecording.html

在线播放的例子:
http://www.acmewebworks.com/red5/videos/SimpleLiveBroadcast.html

分享例子,类似远程演示:
http://www.acmewebworks.com/OSProjects/mtasc/videos/BallControl.html


由 frank 发表于 4:47 PM | 回复 (0) | 引用

August 5, 2006

ffmpeg使用语法[转贴]

Ffmpeg使用语法

ffmpeg [[options][`-i' input_file]]... {[options] output_file}...

如果没有输入文件,那么视音频捕捉就会起作用。

作为通用的规则,选项一般用于下一个特定的文件。如果你给 –b 64选项,改选会设置下一个视频速率。对于原始输入文件,格式选项可能是需要的。

缺省情况下,ffmpeg试图尽可能的无损转换,采用与输入同样的音频视频参数来输出。

3.选项

a) 通用选项

-L license

-h 帮助

-fromats 显示可用的格式,编解码的,协议的。。。

-f fmt 强迫采用格式fmt

-I filename 输入文件

-y 覆盖输出文件

-t duration 设置纪录时间 hh:mm:ss[.xxx]格式的记录时间也支持

-ss position 搜索到指定的时间 [-]hh:mm:ss[.xxx]的格式也支持

-title string 设置标题

-author string 设置作者

-copyright string 设置版权

-comment string 设置评论

-target type 设置目标文件类型(vcd,svcd,dvd) 所有的格式选项(比特率,编解码以及缓冲区大小)自动设置 ,只需要输入如下的就可以了:
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg

-hq 激活高质量设置

-itsoffset offset 设置以秒为基准的时间偏移,该选项影响所有后面的输入文件。该偏移被加到输入文件的时戳,定义一个正偏移意味着相应的流被延迟了 offset秒。 [-]hh:mm:ss[.xxx]的格式也支持

b) 视频选项

-b bitrate 设置比特率,缺省200kb/s

-r fps 设置帧频 缺省25

-s size 设置帧大小 格式为WXH 缺省160X128.下面的简写也可以直接使用:
Sqcif 128X96 qcif 176X144 cif 252X288 4cif 704X576

-aspect aspect 设置横纵比 4:3 16:9 或 1.3333 1.7777

-croptop size 设置顶部切除带大小 像素单位

-cropbottom size –cropleft size –cropright size

-padtop size 设置顶部补齐的大小 像素单位

-padbottom size –padleft size –padright size –padcolor color 设置补齐条颜色(hex,6个16进制的数,红:绿:兰排列,比如 000000代表黑色)

-vn 不做视频记录

-bt tolerance 设置视频码率容忍度kbit/s

-maxrate bitrate设置最大视频码率容忍度

-minrate bitreate 设置最小视频码率容忍度

-bufsize size 设置码率控制缓冲区大小

-vcodec codec 强制使用codec编解码方式。 如果用copy表示原始编解码数据必须被拷贝。

-sameq 使用同样视频质量作为源(VBR)

-pass n 选择处理遍数(1或者2)。两遍编码非常有用。第一遍生成统计信息,第二遍生成精确的请求的码率

-passlogfile file 选择两遍的纪录文件名为file


c)高级视频选项

-g gop_size 设置图像组大小

-intra 仅适用帧内编码

-qscale q 使用固定的视频量化标度(VBR)

-qmin q 最小视频量化标度(VBR)

-qmax q 最大视频量化标度(VBR)

-qdiff q 量化标度间最大偏差 (VBR)

-qblur blur 视频量化标度柔化(VBR)

-qcomp compression 视频量化标度压缩(VBR)

-rc_init_cplx complexity 一遍编码的初始复杂度

-b_qfactor factor 在p和b帧间的qp因子

-i_qfactor factor 在p和i帧间的qp因子

-b_qoffset offset 在p和b帧间的qp偏差

-i_qoffset offset 在p和i帧间的qp偏差

-rc_eq equation 设置码率控制方程 默认tex^qComp

-rc_override override 特定间隔下的速率控制重载

-me method 设置运动估计的方法 可用方法有 zero phods log x1 epzs(缺省) full

-dct_algo algo 设置dct的算法 可用的有 0 FF_DCT_AUTO 缺省的DCT 1 FF_DCT_FASTINT 2 FF_DCT_INT 3 FF_DCT_MMX 4 FF_DCT_MLIB 5 FF_DCT_ALTIVEC

-idct_algo algo 设置idct算法。可用的有 0 FF_IDCT_AUTO 缺省的IDCT 1 FF_IDCT_INT 2 FF_IDCT_SIMPLE 3 FF_IDCT_SIMPLEMMX 4 FF_IDCT_LIBMPEG2MMX 5 FF_IDCT_PS2 6 FF_IDCT_MLIB 7 FF_IDCT_ARM 8 FF_IDCT_ALTIVEC 9 FF_IDCT_SH4 10 FF_IDCT_SIMPLEARM

-er n 设置错误残留为n 1 FF_ER_CAREFULL 缺省 2 FF_ER_COMPLIANT 3 FF_ER_AGGRESSIVE 4 FF_ER_VERY_AGGRESSIVE

-ec bit_mask 设置错误掩蔽为bit_mask,该值为如下值的位掩码 1 FF_EC_GUESS_MVS (default=enabled) 2 FF_EC_DEBLOCK (default=enabled)

-bf frames 使用frames B 帧,支持mpeg1,mpeg2,mpeg4

-mbd mode 宏块决策 0 FF_MB_DECISION_SIMPLE 使用mb_cmp 1 FF_MB_DECISION_BITS 2 FF_MB_DECISION_RD

-4mv 使用4个运动矢量 仅用于mpeg4

-part 使用数据划分 仅用于mpeg4

-bug param 绕过没有被自动监测到编码器的问题

-strict strictness 跟标准的严格性

-aic 使能高级帧内编码 h263+

-umv 使能无限运动矢量 h263+

-deinterlace 不采用交织方法

-interlace 强迫交织法编码 仅对mpeg2和mpeg4有效。当你的输入是交织的并且你想要保持交织以最小图像损失的时候采用该选项。可选的方法是不交织,但是损失更大

-psnr 计算压缩帧的psnr

-vstats 输出视频编码统计到vstats_hhmmss.log

-vhook module 插入视频处理模块 module 包括了模块名和参数,用空格分开

D)音频选项

-ab bitrate 设置音频码率

-ar freq 设置音频采样率

-ac channels 设置通道 缺省为1

-an 不使能音频纪录

-acodec codec 使用codec编解码

E)音频/视频捕获选项

-vd device 设置视频捕获设备。比如/dev/video0

-vc channel 设置视频捕获通道 DV1394专用

-tvstd standard 设置电视标准 NTSC PAL(SECAM)

-dv1394 设置DV1394捕获

-av device 设置音频设备 比如/dev/dsp


F)高级选项

-map file:stream 设置输入流映射

-debug 打印特定调试信息

-benchmark 为基准测试加入时间

-hex 倾倒每一个输入包

-bitexact 仅使用位精确算法 用于编解码测试

-ps size 设置包大小,以bits为单位

-re 以本地帧频读数据,主要用于模拟捕获设备

-loop 循环输入流。只工作于图像流,用于ffserver测试

由 frank 发表于 10:28 AM

ffmpeg的编译大全

ffmpeg的编译大全

最近互联网视频共享的网站很火,公司也想搞类似的网站,初步是用fms+ffmpeg形式

fms负责在线录制,播放,ffmpeg则在后台处理上传的资源转换成一定的格式。

为了让ffmpeg支持的格式尽量多,所以特把我的编译笔记分享一下

环境:redhat as4

1。首先获取ffmpeg

很多人找不到怎么下载,其实之前ffmpeg可以通过cvs下载,不过最近他已经换成了更加强大的svn

如何使用SVN我这里不再介绍,网上还有大量的安装和使用的文章可以借鉴,这里简单罗列几个SVN辅助的软件:

SubVersion,从 http://subversion.tigris.org/ 下载,支持linux,我们这里就装这个

TortoiseSVN,从 http://tortoisesvn.tigris.org/ 下载,是很不错的SVN客户端程序,为windows外壳程序集成到windows资源管理器和文件管理系统的Subversion客户端,用起来很方便,commit动作变得就像Winrar右键压缩一样方便。


ok,那我们先装subversion,记住最好之前装过apr和apr-util,在apache.org网站能下到

wget http://subversion.tigris.org/downloads/subversion-1.3.2.tar.gz
tar zvxf subversion-1.3.2.tar.gz
cd subversion-1.3.2
./configure --with-apr=/usr/local/apr-httpd --with-apr-util=/usr/local/apr-util-httpd/
make
make install


到此,我们就可以通过svn命令获取最新的ffmpeg了

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

你会发现在你所在的目录,自动出现一个ffmpeg的目录,就是你下载的源代码。


我们还不能这么快编译ffmpeg,应该如果要让ffmpeg支持更多格式的转换,还需做一些前期工作


2.支持mp3,linux当然是lame,下载解压

cd lame-3.96.1
./configure --enable-shared --prefix=/usr
这里推荐尽量装在/usr下,默认是装在/usr/local下。这样ffmpeg编译都能顺利的找到库文件


3.支持Ogg Vorbis:
as4自带相应的rpm包,你可以安装一下如下rpm包
libvorbis, libvorbis-devel,libogg, libogg-devel


4.支持xvid x264,现在最流行的两种高质量的压缩格式
xvid的编译安装
wget http://downloads.xvid.org/downloads/xvidcore-1.1.0.tar.gz
tar zvxf xvidcore-1.1.0.tar.gz
./configure --prefix=/usr
make
make install

x264的获取同样是采用svn方式,看来svn取代cvs不远了
svn co svn://svn.videolan.org/x264/trunk x264
cd x264
./configure --prefix=/usr --enable-shared
make
make install


5.AC3和dts编码的支持
as4系统似乎已经支持ac3编码,编译的时候只要加--enable-a52 --enable-gpl参数就行

libdts编译参数
./configure --prefix=/usr
make
make install


6.mpg4 aac格式支持,由于服务器还针对手机用户服务,所以,类似aac,mpg4铃声格式的支持,我们也得做。这里我们安装faad2和faac就行
下载请到http://www.audiocoding.com/modules/mydownloads/

FAAD2的编译
cd faad2
autoreconf -vif
./configure --prefix=/usr --with-mp4v2 --enable-shared
make
make install

faac的编译
cd faac
chmod +x bootstrap
./bootstrap
./configure --prefix=/usr --with-mp4v2 --enable-shared
make
make install


7.支持3gp格式,这也是现在好多手机支持的格式,因为手机用户是我们的主要用户,所以也得支持编译

编译的时候加上--enable-amr_nb --enable-amr_wb参数就行,根据编译系统的提示,所以我们得下载一

些编译3gp所需得文件。

wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip
解压以后把里面的文件都拷贝到libavcodec/amrwb_float

wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip
解压以后把里面的文件都拷贝到libavcodec/amr_float


好了,基本ffmpeg支持的格式,我们基本都做好前期准备了,下面是ffmpeg的编译


./configure --prefix=/usr --enable-gpl --enable-shared --enable-mp3lame --enable-amr_nb --enable-amr_wb --enable-amr_if2 --enable-libogg --enable-vorbis --enable-xvid --enable-a52 --enable-a52bin --enable-faadbin --enable-dts --enable-pp --enable-faad --enable-faac --enable-x264 --enable-pthreads --disable-ffserver --disable-ffplay
make
make install

补充1:
关于3gp的编译,如果大家要编译--enable-amr_nb-fixed,那就不能跟--enable-amr_nb同时编译,我不大清楚这两者到底有什么区别,似乎fixed是修正版,管他呢,编译的方法:
wget http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip
解压以后把里面的文件都拷贝到libavcodec/amr目录下

修改libavcodec/amr/makefile 找到CFLAGS = -Wall -pedantic-errors -I. $(CFLAGS_$(MODE)) -D$(VAD) 换成CFLAGS = -Wall -I. $(CFLAGS_$(MODE)) -D$(VAD) -DMMS_IO

整体编译参数就是
./configure --prefix=/usr --enable-gpl --enable-shared --enable-mp3lame --enable-amr_nb-fixed --enable-amr_wb --enable-amr_if2 --enable-libogg --enable-vorbis --enable-xvid --enable-a52 --enable-a52bin --enable-dts --enable-pp --enable-faad --enable-faadbin --enable-faac --enable-x264 --enable-pthreads --disable-ffserver --disable-ffplay
make
make install

补充2:
有朋友说在当在cpu是x86的情况下,不能编译过去,我这里没发生过这情况,如果你真编译不过去,可以试着加上cpu=cpu

ok,一个强大的ffmpeg编译好了,不过目前管方的ffmpeg还不支持wma9和rmvb,不过网上有很多解决方法,大家去自己找找。

由 frank 发表于 10:15 AM | 回复 (9) | 引用

July 26, 2006

关于suexec的FAQ

apache编译支持suexec功能

./configure --enable-suexec --with-suexec-logfile=/www/logs/suexec.log --with-suexec-uidmin=500 --with-suexec-gidmin=100 --with-suexec-caller=daemon --with-suexec-docroot=/www

关于suexec的FAQ
1.出现以下错误  command not in docroot
编译的时候加入--with-suexec-docroot    以后虚拟主机运行suexec的目录必须包含指定的目录里,通过suexec -V 可以察看docroot目录是哪儿

2.出现以下错误  user mismatch (daemon instead of www)
编译的时候加入--with-suexec-caller=daemon  默认是www,但一般apache的运行用户是nobody或者daemon,这里我们是httpd2.2.2,用户是daemon,所以指定这个参数,否则suexec不能被运行。

3.出现以下错误  cannot run as forbidden uid (1001/index.cgi)
在虚拟主机配置SuexecUserGroup时,指定的用户和组,必须高于--with-suexec-uidmin --with-suexec-gidmin 指定的用户uid和gid,否则被限制使用。

由 frank 发表于 12:29 PM

July 24, 2006

postfix FAQ

今天把postfix升级到2.3.0 之前2.2.10一直使用很好,当然还是按以前的编译方式,但却发现smtp不正常,察看log显示以下错误

Jul 24 14:58:46 wap postfix/smtpd[15000]: warning: unsupported SASL server implementation: cyrus
Jul 24 14:58:46 wap postfix/smtpd[15000]: fatal: SASL per-process initialization failed
Jul 24 14:58:47 wap postfix/master[14946]: warning: process /usr/libexec/postfix/smtpd pid 15000 exit status 1
Jul 24 14:58:47 wap postfix/master[14946]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling

好生觉得奇怪,察看2.3.0的Change log ,找到原因,原来编译的时候必须加一个参数,英文是这么写的

[Incompat 20051220] The Postfix-with-Cyrus-SASL build procedure has
changed. You now need to specify -DUSE_CYRUS_SASL in addition to
-DUSE_SASL_AUTH or else you end up without any Cyrus SASL support.
The error messages are:

    unsupported SASL server implementation: cyrus
    unsupported SASL client implementation: cyrus

增加-DUSE_CYRUS_SASL 这个编译参数后,重新编译,测试通过

由 frank 发表于 5:30 PM

July 16, 2006

使用IPMI远程控制管理DELL2850服务器

Dell™ PowerEdge™ 2850 系统底板管理控制器 (BMC) 通过与主机板上的不同传感器通信来监视系统是否有严重事件,并在某些参数超出其预置阈值时发出警报和日志事件。 BMC 支持工业标准的 Intelligent Platform Management Interface (IPMI) 规范,可以实现远程配置、监测和恢复系统。 BMC 提供以下功能:
通过系统的串行端口和集成 NIC 进行访问
故障日志记录和 SNMP 警报发送
访问系统事件日志 (SEL) 和传感器状况
控制包括开机和关机在内的系统功能
独立于系统电源或工作状态的支持
用于系统设置、基于文本公用程序和操作系统控制台的文本控制台重定向
使用 LAN 上串行 (SOL) 访问 Red Hat® Enterprise Linux 串行控制台界面
看到了吧,以上是DELL官方对IPMI功能的描述,这些功能非常强大哦,据我所知,现在一般大厂的服务器都支持ipmi功能,比如DELL,HP,IBM。今天我们以DELL的2850为例,给大家简单介绍一下IPMI的基本使用。


1.配置系统启用IPMI,启动服务器,在启动过程中,看提示,按Ctrl+E 进入IPMI管理界面

2.设置IPMI Over LAN为On,默认为Off,意思为启用通过LAN方式的IPMI。

ipmi01.jpg


3.设置IPMI的地址,这里的地址可以跟你服务器的ip地址一样,不会有冲突,放心设置,MAC地址不用设置。VLAN不用设置。

ipmi02.jpg

4.这里是设置访问的用户名和密码,远程访问IPMI是需要验证的。

ipmi03.jpg


好了设置完毕,重启机器,基本上现在服务器就已经能通过远程访问ipmi了。


我们先在另外一台机器装上ipmiltool,一个管理IPMI的开源工具,可以在任何机器安装,安装的机器本身主板可以没有IPMI。

装完以后,我们试验一下能不能访问,运行以下命令

ipmitool –I lan –H host -U user -a channel info

host:填写你的服务器的IP地址
user:填写你之前设置的用户名,我们这里是root

正常的话,会提示你输入密码,就是图3我们设置的密码。

以下是显示的信息:

ipmi04.jpg

说明远程服务器,我们刚才设置的服务器已经启用IPMI。

那怎么在本地访问IPMI呢,如果你直接用ipmitool访问是访问不了的,会提示以下错误:
Error: Unable to establish LAN session
Unable to Get Channel Info
这里我们得安装OpenIPMI,装完这个,系统就能认出IPMI,这样我们才能通过ipmitool访问,当然前提是你的内核编译支持IPMI了。

装完OpenIPMI后,启用IPMI服务 /etc/rc.d/init.d/ipmi start 一般如果内核支持的话,能正常启动,用lsmod看看加载的模块
 

ipmi05.jpg

这时我们可以本地访问IPMI,还是刚才那个命令,参看channel信息,不过本地访问命令有所不同,改为

ipmi06.jpg

下面我们介绍一些远程控制IPMI的用法

获取远程服务器的电源状态

Ipmitool -I lan –H host –U root –a chassis power status

远程软关机,相当于按下reset,这个在服务器死机的时候用到

Ipmitool -vI lan –H host –U root –a chassis power soft

类似的命令我们也可以用来远程开机,获取服务器运行的信息等。

参考文档:
使用ipmitool 实现Linux 系统下对服务器的ipmi 管理
IPMI HOWTO for Debian GNU/Linux on the Intel SR2300

著作信息:张微波 2006.7.16 北京

由 frank 发表于 6:49 AM | 回复 (6) | 引用

July 10, 2006

编译内核的一个FAQ

最近玩AS4U3,由于没有redhat的帐号,所以只能手工编译src,但在rpmbuild的时候,出现以下错误:

rpmbuild --rebuild kernel-2.6.spec

error: Architecture is not included:i386

以前似乎从来没见过这个错误,呵呵,看了以下帮助,解决,原来还得加以下参数

rpmbuild --rebuild --target=i686 kernel-2.6.spec

咳,都是新机器闹的,嘿嘿

 

由 frank 发表于 10:07 AM

June 26, 2006

加速yum的下载

两个途径可以加速yum的速度,大家可根据情况自己组合使用。

1.使用http-proxy ,  设置方法不说了,就是修改/etc/yum.conf,或者直接在/etc/profile添加以下语句
http_proxy="http://user:password@server ip:3128"
export http_proxy

记得保存后 source该配置文件,使配置生效。

2。使用yum的扩展插件yum-fastestmirror,个人认为这个插件非常有效,速度真的是明显提高,安装只要
yum -y install yum-fastestmirror   就行。

希望通过以上方法,能解除yum的漫长等待过程。

由 frank 发表于 8:06 AM | 回复 (2)

June 25, 2006

gftp远程目录乱码问题解决

默认安装的fc5,用gftp,发现有些远程站点的中文出现乱码,本身软件菜单没有字体的修改地方,多次尝试后,发现有个有效的解决办法。

编辑/usr/bin/gftp文件。
在#!/bin/sh之后加上

export LANG=zh_CN

由 frank 发表于 11:00 PM | 回复 (0)

硬盘安装fc5

安装环境:ibm240 笔记本,由于没有光驱,没办法,只能用硬盘。

1.分个fat32区,大概5G吧,够放下iso文件就行,当然这个分区我预先做了个dos6.22系统,嘿嘿,从redhat9.0的光盘里拷贝出 dosutils这个目录放在分区根目录,其实只需要  dosutils目录里的loadlin.exe,autoboot.bat和 autoboot空目录就行。

2.从fc5的第一张光盘里isolinux目录拷贝initrd.img,vmlinuz至你的autoboot空目录里。

3.把5张fc的iso镜像文件放在根目录下fc5下。

ok,启动电脑,进入dos系统,在dosutils目录里,运行autoboot.bat就行。

由 frank 发表于 9:44 PM

June 16, 2006

vi的使用之汇总

功能最强在的编辑器——vi
vi是所有UNIX系统都会提供的屏幕编辑器,它提供了一个视窗设备,通过它可以编辑文件。当然,对UNIX系统略有所知的人,或多或少都觉得vi超级难用,但vi是最基本的编辑器,所以希望读者能好好把它学起来,以后在UNIX世界里必将畅行无阻、游刃有余,因为其他几种文本处理器并非UNIX标准配备。说不定别人的Linux机器没安装joe或pico,如果您不会vi,那您可能就没辄了。
vi的基本概念
基本上vi可分为三种操作状态,分别是命令模式(Command mode)、插入模式(Insert mode)和底线命令模式(Last line mode),各模式的功能区分如下:
1. Comand mode:控制屏幕光标的移动,字符或光标的删除,移动复制某区段及进入Insert mode下,或者到Last line mode。
2. Insert mode:唯有在Insert mode下,才可做文字数据输入,按Esc等可回到Comand mode。
3. Last line mode:将储存文件或离开编辑器,也可设置编辑环境,如寻找字符串、列出行号等。
不过可以把vi简化成两个模式,即是将Last line mode也算入Command mode,把vi分成Command 和Insert mode。
vi的基本操作
•进入vi
在系统提示符号输入vi及文件名称后,即可进入vi全屏幕编辑画面:
$ vi testfile
有一点要特别注意,就是您进入vi之后是处于“Command mode”下,您要切换到Insert mode才能输入文字。初次用vi的用户都会想先用上下左右键移动光标,结果电脑一直叫,把自己气个半死,所以进入vi后,先不要乱动,转换入Insert后再说。
•切换至Insert mode编辑文件
在Command mode下按‘i’、‘a’或‘o’三键就可进入Insert mode。这时候您就可以开始输入文字了。
i: 插入,从目前光标所在之处插入所输入的文字。
a: 增加,目前光标所在的下一个字开始输入文字。
o: 插入新的一行,从行首开始输入文字。
•Insert的切换→Command mode,按Esc键
您目前处于Insert mode,您就只能一直打字。假如您发现打错字了,想用光标键往回移动,将该字删除,就要按ESC键转换回Command mode,再删除文字。
•离开vi及存文件
在Command mode下,可按冒号“:”键入入Last line mode,例如:
:w filename (输入“w filename”,将文章存入指定的文件名filename)
:wq (输入“wq”,因为进入之时已经指定文件名testfile,所以会写入testfile并离开vi)
:q! (输入“q!”,强制离开并放弃编辑的文件)

Command mode功能键列表
在介绍command mode指令的时后,指令后面加上“常用”字眼的功能键,表示比较常用的vi指令,请读者您一定要学会、记住。
(1)I、a、o切换进入Insert mode。[超级常用]
(2)移动光标
vi可以直接用键盘上的光标键来上下左右移动,但正规的vi是用小写英文字母
h、j、k、l,分别控制光标左、下、上、右移一格。
按Ctrl+B:屏幕往后移动一页。[常用]
按Ctrl+F:屏幕往前移动一页。[常用]
按Ctrl+U:屏幕往后移动半页。
按Ctrl+D:屏幕往前移动半页。
按 0 (数字零):移动文章的开头。[常用]
按 G:移动到文章的最后。[常用]
按 w:光标跳到下个word的开头。[常用]
按 e:光标跳到下个word的字尾。
按 b:光标回到上个word的开头。
按 $:移到光标所在行的行尾。[常用]
按 ^:移到该行第一个非空白的字符。
按 0:移到该行的开头位置。[常用]
按 #:移到该行的第#个位置,例:51、121。[常用]
(3)删除文字
x:每按一次删除光标所在位置的后面一个字符。[超常用]
#x:例如,6x 表删除光标所在位置的后面6个字符。[常用]
X:大字的X,每按一次删除光标所在位置的前面一个字符。
#X:例如,20X 表删除光标所在位置的前面20个字符。
dd:删除光标所在行。[超常用]
#dd:例如,6dd表删除从光标所在的该行往下数6行之文字。[常用]
(4)复制
yw:将光标所在处到字尾的字符复制到缓冲区中。
(想在和#x、#X的功能相反)
p:将缓冲区内的字符粘贴到光标所在位置(指令‘yw’与‘p必须搭配使用)。
yy:复制光标所在行。[超常用]
p:复制单行到您想粘贴之处。(指令‘yy’与‘p’必须搭配使用)
#yy:如:6yy表示拷贝从光标所在的该行往下数6行之文字。[常用]
p:复制多行到您想粘贴之处。(指令‘#yy’与‘p’必须搭配使用)
“ayy:将复制行放入buffer a, vi提供buffer功能,可将常用的数据存在buffer
“ap:将放在buffer a的数据粘贴。
“b3yy:将三行数据存入buffer b。
“b3p:将存在buffer b的资料粘贴
(5)取代
r: 取代光标所在处的字符:[常用]
R:取代字符直到按Esc为止。
(6)复原(undo)上一个指令
u:假如您误操作一个指令,可以马上按u,回复到上一个操作。[超常用]
.: .可以重复执行上一次的指令。
(7)更改
cw:更改光标所在处的字到字尾$处。
c#w:例如,c3w代表更改3个字。
(8)跳至指定行
Ctrl+G:列出光标所在行的行号。
#G:例如,15G,表示移动光标至文章的第15行行首。[常用]
Last line mode下指令简介
读者您要使用Last line mode之前,请记得先按Esc键确定您已经处于Command mode下后,再按冒号“:”或“/”或“?”三键的其中一键进入Last line mode。
1.列出行号
set nu: 输入“set nu”后,会在文章的每一行前面列出行号。
2.跳到文章的某一行
#:井号代表一个数字,在Last line mode提示符号“:”前输入数字,再按Enter就会跳到该行了,如:15[Enter]就会跳到文章的第15行。[常用]
3.寻找字符串
/关键字:先按/,再输入您想寻找的字,如果第一次找的关键字不是您相尽可能的,可以一直按n会往下寻找到您要的关键字为止。
?关键字:先按?,再输入您想寻找的字,如果第一次找的关键字不是您想要的,可以按n会往前寻找到您要的关键字为止。
4.取代字符串
1,$s/string/replae/g:在last line mode输入“1,$s/string/replace/g”会将全文的string字符串取代为replace字符串,其中1,$s就是指搜寻区间为文章从头至尾的意思,g则是表示全部取代不必确认。
%s/string/replace/c:同样会将全文的string字符串取代为replace字符串,和上面指令不同的地方是,%s和1,$s是相同的功能,c则是表示要替代之前必须再次确认是否取代。
1,20s/string/replace/g:将1至20行间的string替代为relpace字符串。
5.存文件
w:在last line mode提示符号“:”前按w即可将文件存起来。[超常用]
#,# w filename:如果您想摘取文章的某一段,存成另一个文件,可用这个指令#代表行号,例如30,50 w nice,将您正在编辑文章的第30~50行存成nice这个文件。
6.离开
q:按q就离开,有时如果无法离开vi,可搭配“!:强置离开vi,如“q!”
qw:一般建议离开时,搭配w一起使用,如此离开时还可存文件。[常用]

由 frank 发表于 6:02 AM

May 19, 2006

openssh快速编译安装howto

我想当一个称职的linux管理员,openssh的升级一定很重要,毕竟现在telnet早就因为安全的问题被淘汰了,但现在系统自带的openssh有些版本也非常老,不少都有非常严重的漏洞,所以有必要告诉大家怎么在原有系统的基础上升级openssh

首先系统自带的openssh
rpm -qa |grep openssh
查到后,毫不犹豫的删除,一般都版本太老,有不少漏洞

然后到www.openssh.com下载最新的openssh,这次我编译的最新版本是OpenSSH_4.3p2.
下载解压后,用以下参数编译
./configure \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc/ssh \
--libexecdir=/usr/libexec/openssh \
--with-tcp-wrappers \
--with-rsh=/usr/bin/rsh \
--with-privsep-path=/var/empty/sshd \
--disable-strip \
--with-superuser-path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

make

make install

拷贝服务脚本
cp contrib/redhat/sshd.init /etc/rc.d/init.d/sshd

ok.安装很简单吧

然后编辑
vi /etc/ssh/sshd_config

PermitRootLogin no 限制root用户登陆

PasswordAuthentication no 因为我是用密匙登陆,所以这里取消用简单的密码登陆,大家可参考

linux下SSH配合SecureCRT的密匙完美使用方法
关于SecureCrt使用ssh2的补充

由 frank 发表于 2:53 PM | 回复 (0)

May 12, 2006

在postfix下编译安装amavisd-new+clamav+SpamAssassin

前几天给大家介绍了postfix + cyrus-sasl2 + courier-authlib + Courier-IMAP + postfixadminmaidrop的安装,基本邮件系统已经可以使用,今天继续给大家讲怎么给postfix邮件系统加上防病毒和防垃圾邮件系统

1.安装clamav
wget http://keihanna.dl.sourceforge.net/sourceforge/clamav/clamav-0.88.tar.gz
 
groupadd clamav
useradd -g clamav -s/bin/false -d/dev/null clamav
./configure --prefix=/usr/local/clamav --with-dbdir=/usr/local/share/clamav
make
make check
make install 
 

vi /usr/local/clamav/etc/clamd.conf

LogSyslog
LogVerbose
LogFacility LOG_MAIL
LogFile /var/log/clamav/clamd.log
PidFile /var/run/clamav/clamd.pid
DatabaseDirectory /usr/local/share/clamav
LocalSocket /var/run/clamav/clamd
StreamMaxLength 10M
User amavis
ScanMail
ScanArchive
ScanRAR

vi /usr/local/clamav/etc/freshclam.conf
DatabaseDirectory /usr/local/share/clamav
UpdateLogFile /var/log/clamav/freshclam.log
LogSyslog
LogVerbose
DatabaseOwner amavis
Checks 12
DatabaseMirror db.CN.clamav.net
DatabaseMirror database.clamav.net
NotifyClamd

注意:注释掉两个文件中Example那行


添加amavis用户和组,配合amavisd使用
groupadd amavis
useradd -g amavis -s /bin/false -c "Amavis User" -d /dev/null amavis

创建日志文件夹并设置权限
mkdir /var/log/clamav
chmod -R 744 /var/log/clamav
chown -R amavis:amavis /var/log/clamav

chown -R amavis.amavis /usr/local/share/clamav
mkdir /var/run/clamav
chmod 700 /var/run/clamav
chown amavis.amavis /var/run/clamav

手动更新病毒库
/usr/local/clamav/bin/freshclam

设置自动更新病毒库
crontab -e
0 4 * * * root /usr/local/clamav/bin/freshclam --quiet -l /var/log/clamd.log

启动
# /usr/local/clamav/sbin/clamd


2.安装amavisd
 
wget http://www.ijs.si/software/amavisd/amavisd-new-2.4.1.tar.gz
 
升级file,可以通过file -v看一下版本,要求4.06版本以上
wget ftp://ftp.astron.com/pub/file/file-4.17.tar.gz
 
 
安装以下文件,这些都是安装amavisd需要的
 
perl -MCPAN -e shell
cpan>install Archive::Tar  
cpan>install Archive::Zip  
cpan>install Compress::Zlib
cpan>install Convert::UUlib
cpan>install MIME::Base64  
cpan>install Mail::Internet
cpan>install Net::Server   
cpan>install Net::SMTP     
cpan>install Digest::MD5  
cpan>install IO::Stringy   
cpan>install Time::HiRes  
cpan>install Unix::Syslog  
cpan>install BerkeleyDB
cpan>install Convert::TNEF
cpan>install MIME::Parser
cpan>install MIME::Tools    
 
升级perl到最新版本,至少5.8.2以上版本
wget http://www.perl.com/CPAN/src/stable.tar.gz
tar zvxf stable.tar.gz
cd perl-5.8.8
./configure.gnu --prefix=/usr -Dpager="/bin/less -isR"
make
make test   测试一下,没问题后再install
make install

注意升级perl的话,可能会造成系统的其他perl应用不正常,请慎重升级,一般redhat9.0默认的5.8.0应该也没问题
 
mkdir -p /var/amavis /var/amavis/tmp /var/amavis/var /var/amavis/db /var/amavis/home
 
chown -R amavis:amavis /var/amavis
chmod -R 750 /var/amavis
 
cp amavisd /usr/local/sbin/
chown root /usr/local/sbin/amavisd
chmod 755  /usr/local/sbin/amavisd
 
cp amavisd.conf /etc/
chown root /etc/amavisd.conf
chmod 644  /etc/amavisd.conf
 
mkdir /var/virusmails
chown amavis:amavis /var/virusmails
chmod 750 /var/virusmails
 

#=====================================
 
修改 /etc/amavisd.conf
 
$mydomain = 'example.com';
 
$virus_admin               = "postmaster\@$mydomain";  # notifications recip.
$mailfrom_notify_admin     = "postmaster\@$mydomain";  # notifications sender
$mailfrom_notify_recip     = "postmaster\@$mydomain";  # notifications sender
$mailfrom_notify_spamadmin = "postmaster\@$mydomain"; # notifications sender
$mailfrom_to_quarantine = ''; # null return path; uses original sender if undef
 

加入对Clamav 的支持
# ### http://www.clamav.net/
 ['ClamAV-clamd',
   \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"],
   qr/\bOK$/, qr/\bFOUND$/,
   qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ], 
 
 
3.安装SpamAssassin
perl -MCPAN -e shell
cpan>install Digest::SHA1
cpan>install HTML::Parser
cpan>install Net::DNS
cpan>install Mail::SPF::Query
cpan>install IP::Country
cpan>install Net::Ident
cpan>install IO::Socket::INET6
cpan>install IO::Socket::SSL
cpan>install DBI
cpan>install LWP::UserAgent
cpan>install Mail::SpamAssassin

SA的配置我这里不讲了,如果你想了解一点,也可参考我在这里的blog笔记
 
测试amavis
# /usr/local/sbin/amavisd debug
 
启动停止服务
# /usr/local/sbin/amavisd start|stop
 

4.让postfix使用amavisd
 
在/usr/local/etc/postfix/main.cf 加入
 
content_filter = smtp-amavis:[127.0.0.1]:10024
在/usr/local/etc/postfix/master.cf 加入
 
smtp-amavis unix -   -   n     -       2  smtp
        -o smtp_data_done_timeout=1200
        -o disable_dns_lookups=yes
                                                                                
127.0.0.1:10025 inet n -       n       -       -  smtpd
        -o content_filter=
        -o local_recipient_maps=
        -o relay_recipient_maps=
        -o smtpd_restriction_classes=
        -o smtpd_client_restrictions=
        -o smtpd_helo_restrictions=
        -o smtpd_sender_restrictions=
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o mynetworks=127.0.0.0/8
 
#============================================
 
参考文档
 
http://www.xjtusky.com/article.asp?id=109
http://genco.gen.tc/postfix_virtual.php#amavisdclamav
http://www.toping.net/bbs/htm_data/10/0602/1042.html
http://www.freespamfilter.org/FC4.html

由 frank 发表于 7:21 AM | 回复 (3)

May 10, 2006

Maildrop安装调试笔记

groupadd vmail -g 1001
useradd vmail -u 1001 -g 1001

wget http://internap.dl.sourceforge.net/sourceforge/courier/maildrop-2.0.2.tar.bz2

tar jvxf maildrop-2.0.2.tar.bz2

./configure --enable-sendmail=/usr/sbin/sendmail --enable-trusted-users='root vmail' --enable-syslog=1 --enable-maildirquota --enable-maildrop-uid=1001 --enable-maildrop-uid=1001 --with-trashquota --with-dirsync

make
make install

注意源码安装的,将courierauthconfig 命令链接到/usr/bin里,假设装在:
/usr/local/courier-authlib/bin/courierauthconfig,则:
ln -s /usr/local/courier-authlib/bin/courierauthconfig /usr/bin/courierauthconfig
这样编译出来的maildrop才会ourier Authentication Library extension enabled.

maildrop -v

maildrop 2.0.2 Copyright 1998-2005 Double Precision, Inc.
GDBM extensions enabled.
Courier Authentication Library extension enabled.
Maildir quota extension enabled.
This program is distributed under the terms of the GNU General Public
License. See COPYING for additional information.

如果没有显示Courier Authentication Library extension enabled.说明你的maidrop还不支持courier auth,请仔细检查,重新编译

maildrop建议不要自定义目录安装,可以减少不必要的麻烦,删除很方便:直接在已经编译的源代码目录 make uninstall 就行

配置main.cf和master.cf使postfix调用maildrop

========================
vi /etc/postfix/main.cf

virtual_transport = maildrop  
maildrop_destination_recipient_limit = 1 

========================
vi /etc/postfix/master.cf
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -w 90 -d ${user}@${nexthop} ${recipient} ${user} ${extension}${nexthop}


调试maildrop是否正常工作

从其他邮箱发一份邮件到你新建立的email地址,看到类似log记录
May 10 07:21:05 mail postfix/pipe[13994]: 78DCC156AE7: to=<frank@domain.com>, relay=maildrop, delay=0, status=sent

(domain.com)
看到relay=maildrop 并且log没有报错,则说明maildrop已经正常工作

FAQ:

1. 编译安装的时候出现以下报错configure: error: pcre.h not found - install PCRE from www.pcre.org
请安装pcre-devel包

由 frank 发表于 7:35 AM | 回复 (3)

May 7, 2006

笔记postfix + cyrus-sasl2 + courier-authlib + Courier-IMAP + postfixadmin

postfix + cyrus-sasl2 + courier-authlib + Courier-IMAP + postfixadmin
最终修改:2006.5.10

1.安装cyrus-sasl-2.x
删除以前的rpm包以及相关目录
rpm -e --nodeps cyrus-sasl-2.1.10-4 cyrus-sasl-plain-2.1.10-4 cyrus-sasl-md5-2.1.10-4 cyrus-sasl-devel-2.1.10-4
rm -rf /usr/lib/sasl
rm -rf /usr/lib/sasl2

wget  ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.21.tar.gz

./configure
--enable-plain --enable-cram --enable-digest --enable-login --enable-sql
--disable-anon --disable-ntlm --disable-gssapi --disable-krb4 --disable-otp --disable-srp --disable-srp-setpass
-with-authdaemond=/usr/local/courier-authlib/var/spool/authdaemon/socket
--with-mysql=/usr/local/mysql --with-mysql-includes=/usr/local/mysql/include/mysql --with-mysql-

libs=/usr/local/mysql/lib/mysql

make
make install

ln -s /usr/local/lib/sasl2 /usr/lib/sasl2

增加"/usr/local/lib"到你的"/etc/ld.so.conf",并执行ldconfig命令。

vi /usr/local/lib/sasl2/smtpd.conf

pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket
注意,这个文件的编辑不要多写一个空格,否则会出现smtp验证不过的问题

 
2.编译postfix2.x

wget ftp://postfix.cn99.com/postfix/official/postfix-2.2.10.tar.gz

tar zvxf postfix-2.2.10.tar.gz

下载VDA补丁,使postfix支持磁盘限额
wget http://web.onda.com.br/nadal/postfix/VDA/postfix-2.2.10-vda.patch.gz

gzip -d  postfix-2.2.10-vda.patch.gz

chkconfig --level 2345 sendmail off

安装postfix之前添加相关的用户&用户组
groupadd postfix -g 1000
groupadd postdrop
useradd postfix -u 1000 -g postfix -G postdrop
groupadd vmail -g 1001
useradd vmail -u 1001 -g 1001
mkdir /home/mail
chown vmail:vmail /home/mail
chmod -R 771 /home/mail

打补丁
patch -p1 < ../postfix-2.2.10-vda.patch


make tidy

make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH -I/usr/local/include/sasl' 'AUXLIBS=-

L/usr/local/mysql/lib/mysql -lmysqlclient -lm -lz -L/usr/local/lib -lsasl2'

make
make install


mv /etc/aliases /etc/aliases.old
ln -s /etc/postfix/aliases /etc/aliases
echo 'root: admin@example.com'>>/etc/postfix/aliases
/usr/bin/newaliases

touch /etc/postfix/mysql_virtual_alias_maps.cf
touch /etc/postfix/mysql_virtual_domains_maps.cf
touch /etc/postfix/mysql_virtual_mailbox_maps.cf
touch /etc/postfix/mysql_virtual_limit_maps.cf

vi /etc/postfix/main.cf

myhostname = mail.example.com         # mail.example.com是安装Postfix软件的主机名
mydomain = example.com                # example.com是安装Postfix软件的主机名中的域名部分
myorigin = $mydomain
mydestination =
alias_maps = hash:/etc/aliases
home_mailbox = Maildir/               # 使用Maildir作为邮件的存储格式


#=====================MySQL=====================
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_base = /home/mail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 102400000
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 1001
virtual_uid_maps = static:1001
virtual_gid_maps = static:1001
virtual_transport = virtual
#"virtual_gid_maps"和"virtual_uid_maps"是postfix用户的gid和uid, "virtual_minimum_uid"应当≤"virtual_uid_maps",

"virtual_mailbox_limit"是每个邮箱的大小。

#=====================Quota=====================
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
virtual_overquota_bounce = yes
#virtual_trash_count=yes
#virtual_trash_name=.Trash

#====================SASL======================
smtpd_recipient_restrictions =
 permit_mynetworks,
 permit_sasl_authenticated,
 reject_non_fqdn_hostname,
 reject_non_fqdn_sender,
 reject_non_fqdn_recipient,
 reject_unauth_destination,
 reject_unauth_pipelining,
 reject_invalid_hostname
 #reject_rbl_client opm.blitzed.org,
 #reject_rbl_client list.dsbl.org,
 #reject_rbl_client bl.spamcop.net,
 #reject_rbl_client sbl-xbl.spamhaus.org
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes

#=============================================
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
unknown_local_recipient_reject_code = 550


编辑cf配置文件

vi /etc/postfix/mysql_virtual_alias_maps.cf

user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = alias
select_field = goto
where_field = address
additional_conditions = AND active = '1'

=================================

vi /etc/postfix/mysql_virtual_domains_maps.cf

user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = domain
select_field = description
where_field = domain
additional_conditions = AND active = '1'

=================================

vi /etc/postfix/mysql_virtual_mailbox_maps.cf

user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = maildir
where_field = username
additional_conditions = AND active = '1'

=================================

vi /etc/postfix/mysql_virtual_limit_maps.cf

user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = quota
where_field = username
additional_conditions = AND active = '1'


启动和挺直postfix服务
/usr/sbin/postfix start
/usr/sbin/postfix stop

3.编译courier-authlib

wget http://kent.dl.sourceforge.net/sourceforge/courier/courier-authlib-0.58.tar.bz2

tar jvxf courier-authlib-0.58.tar.bz2

./configure
--prefix=/usr/local/courier-authlib --without-stdheaderdir
--without-authuserdb --without-authpam --without-authldap --without-authpwd --without-authshadow --without-authvchkpw --without-authpgsql --without-authcustom
--with-authmysql --with-mysql-libs=/usr/local/mysql/lib/mysql --with-mysql-includes=/usr/local/mysql/include/mysql
--with-redhat

一个关键点:

如果courier-authlib安装到非标准位置(例如安装到/usr/local下),一定记得在./configure时增加--without-stdheaderdir,这样以后在编译Courier-IMAP和maildrop的时候,不用特别指定courier-authlib的库文件位置


make
make install
make install-configure

增加"/usr/local/courier-authlib/lib/courier-authlib"到你的"/etc/ld.so.conf",并执行ldconfig命令。
chmod +x /usr/local/courier-authlib/var/spool/authdaemon

vi /usr/local/courier-authlib/etc/authlib/authdaemonrc    可以不修改
authmodulelist="authmysql"
authmodulelistorig="authmysql"
daemons=10

vi /usr/local/courier-authlib/etc/authlib/authmysqlrc


MYSQL_SERVER localhost
MYSQL_USERNAME postfix
MYSQL_PASSWORD yourpassword

MYSQL_SOCKET /tmp/mysql.sock

MYSQL_DATABASE postfix
MYSQL_USER_TABLE mailbox

MYSQL_CRYPT_PWFIELD password

MYSQL_UID_FIELD 1001
MYSQL_GID_FIELD 1001

MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD '/home/mail/' #设置postfix存储邮件的目录
MYSQL_NAME_FIELD name

MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD quota
MYSQL_WHERE_CLAUSE active='1'

启动courier-authlib
/usr/local/courier-authlib/sbin/authdaemond start


4.编译安装安装Courier-IMAP

wget http://surfnet.dl.sourceforge.net/sourceforge/courier/courier-imap-4.1.0.tar.bz2
tar jvxf courier-imap-4.1.0.tar.bz2

./configure --prefix=/usr/local/courier-imap --with-redhat --enable-unicode --disable-root-check --with-trashquota --without

-ipv6 CPPFLAGS='-I/usr/local/courier-authlib/include' COURIERAUTHCONFIG='/usr/local/courier-authlib/bin/courierauthconfig'

CPPFLAGS='-I/usr/local/courier-authlib/include'    如果编译courier-authlib没有安装在默认路径,必须指定这个,如果之前编译courier-authlib加了--without-stdheaderdir,就不需要指定了

make

make install


cp /usr/local/courier-imap/etc/imapd.dist /usr/local/courier-imap/etc/imapd
cp /usr/local/courier-imap/etc/imapd-ssl.dist /usr/local/courier-imap/etc/imapd-ssl
cp /usr/local/courier-imap/etc/pop3d.dist /usr/local/courier-imap/etc/pop3d
cp /usr/local/courier-imap/etc/pop3d-ssl.dist /usr/local/courier-imap/etc/pop3d-ssl

 配置Courier-IMAP,为用户提供pop3服务:
vi /usr/local/courier-imap/etc/pop3d
POP3DSTART=yes
 注:如果你想为用户提供IMAP服务,可以在"/usr/local/courier-imap/etc/imapd"文件中设置"IMAPDSTART=yes"。

cp courier-imap.sysvinit /etc/rc.d/init.d/imapd
chmod 755 /etc/rc.d/init.d/imapd
chkconfig --add imapd


5.编译安装postfixadmin

wget http://high5.net/postfixadmin/download.php?file=postfixadmin-2.1.0.tgz

tar -zxvf postfixadmin-2.1.0.tgz

把解压的目录改名拷贝到默认的web目录下,比如 /var/www

cd /var/www/postfixadmin

$ chmod 640 *.php *.css
$ cd /var/www/postfixadmin/admin
$ chmod 640 *.php .ht*
$ cd /var/www/postfixadmin/images/
$ chmod 640 *.gif *.png
$ cd /var/www/postfixadmin/languages/
$ chmod 640 *.lang
$ cd /var/www/postfixadmin/templates/
$ chmod 640 *.tpl
$ cd /var/www/postfixadmin/users/
$ chmod 640 *.php

导入数据库

mysql -uroot -p  < DATABASE_MYSQL.TXT

访问:
http://域名/postfixadmin/

 


6.FAQ:
1.出现authentication error: Input/output error错误的时候
估计是查询mysql时,authdaemond出错了。具体要打开authdaemonrc里的:

DEBUG_LOGIN=2    原来默认是0

然后看看/var/log/message或/var/log/maillog 在认证失败时有什么提示。根据提示去检查问题到底出在哪儿


2.warning: SASL authentication failure: cannot connect to Courier authdaemond: Permission denied
检查 authdaemond的socket所在目录及其父目录的属性是否对smtpd可读。如果不可读则出现这个问题(permission的问题)。

3.warning: SASL authentication failure: cannot connect to Courier authdaemond: No such file or directory
检查/usr/local/lib/sasl2/smtpd.conf,看看是否有多写一个空格,一般空格很难直观的发现

由 frank 发表于 8:45 PM | 回复 (11)

April 30, 2006

《Postfix权威指南》

oreilly_postfix_the_definitive_guide 
作者: Kyle D. Dent 著 O'Reilly Taiwan公司 编译

 章节目录


前言
第一章 简介
Postfix的起源与设计理念
E-mail与Internet
Postfix的角色
Postfix的安全性
如何取得Postfix
第二章 基本概念
Unix的概念
E-mail的概念
第三章 Postfix的结构
Postfix的组件
邮件如何进入Postfix系统
Postfix的队列管理器
投递操作
实际追踪Postfix的邮件处理流程
第四章 基本的配置与管理
第一次启动Postfix
配置文件
重要的考虑事项
管理
master.cf
收信限制
改写地址格式
改变根目录(chroot)
在线说明书
第五章 队列管理
qmgr的运行原理
队列管理工具
第六章 E-mail与DNS
DNS概论
决定邮件路由
Postfix与DNS
常见问题
第七章 本地投递与 POP/IMAP
Postfix的投递代理程序
邮箱格式
本地邮件的投递操作
POP与IMAP
本地邮件传输协议(LMTP)
第八章 虚拟网域
共享网域搭配系统账户
独立网域搭配系统账户
独立网域搭配虚拟账户
虚拟网域搭配特殊格式的邮箱
投递到外部程序
第九章 邮件转发
备用交换器
传输表
入站邮件网关
出站邮件网关
UUCP、传真以及其他投递机制
第十章 邮件列表
简易的邮件列表
邮件列表管理系统
第十一章 反垃圾邮件
垃圾邮件的本质
垃圾邮件的问题
开放转发(Open Relay)
辨别垃圾邮件
反垃圾邮件的措施
Postfix的挡信机制
客户端判别规则
SMTP语法规范参数
内容检查
自定义过滤条件组合
反垃圾邮件实例
第十二章 SASL身份验证
SASL概论
Postfix与SASL
Postfix的SASL配置
测试SASL验证配置
SMTP客户端验证
第十三章 传输层安全协议(TLS)
Postfix与TLS
TLS证书
第十四章 内容过滤
基于命令的过滤
基于守护进程的过滤
其他考虑事项
第十五章 外部数据库
MySQL
LDAP
附录一 配置参数
附录二 Postfix支持工具
附录三 Postfix的编译与安装
附录四 问题集
索引

下载地址  可惜不是中文的,大家先看英文吧,中文书店有买

由 frank 发表于 1:29 PM

April 29, 2006

Courier-IMAP编译出错解决

编译Courier-IMAP的时候,出现以下报错信息:

imaplogin.c:35:32: courierauth.h: 没有那个文件或目录
imaplogin.c:36:37: courierauthdebug.h: 没有那个文件或目录
imaplogin.c:159: warning: `struct authinfo' declared inside parameter list
imaplogin.c:159: warning: its scope is only this definition or declaration, which is probably not what you want
imaplogin.c: In function `login_callback':
imaplogin.c:169: dereferencing pointer to incomplete type
imaplogin.c:170: warning: implicit declaration of function `auth_getoption'
imaplogin.c:170: dereferencing pointer to incomplete type
imaplogin.c:171: warning: assignment makes pointer from integer without a cast
imaplogin.c:175: dereferencing pointer to incomplete type
imaplogin.c:180: dereferencing pointer to incomplete type
imaplogin.c:184: dereferencing pointer to incomplete type
imaplogin.c:199: dereferencing pointer to incomplete type
imaplogin.c:200: dereferencing pointer to incomplete type
imaplogin.c:223: warning: implicit declaration of function `auth_callback_default'
imaplogin.c:227: dereferencing pointer to incomplete type
imaplogin.c:228: dereferencing pointer to incomplete type
imaplogin.c:233: dereferencing pointer to incomplete type
imaplogin.c:233: dereferencing pointer to incomplete type
imaplogin.c:243: dereferencing pointer to incomplete type
imaplogin.c:247: dereferencing pointer to incomplete type
imaplogin.c:251: dereferencing pointer to incomplete type
imaplogin.c:252: dereferencing pointer to incomplete type
imaplogin.c: In function `do_imap_command':
imaplogin.c:281: warning: implicit declaration of function `courier_authdebug_login'
imaplogin.c:375: warning: implicit declaration of function `auth_login'
imaplogin.c:376: warning: implicit declaration of function `courier_safe_printf'
imaplogin.c: In function `main':
imaplogin.c:454: warning: implicit declaration of function `courier_authdebug_login_init'
imaplogin.c: In function `login_imap':
imaplogin.c:599: warning: implicit declaration of function `DPRINTF'
make[3]: *** [imaplogin.o] Error 1
make[3]: Leaving directory `/root/soft/postfix/courier-imap-4.1.0/imap'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/soft/postfix/courier-imap-4.1.0/imap'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/soft/postfix/courier-imap-4.1.0'
make: *** [all] Error 2

google寻找了一圈,没有实质性的答案,不过仔细看了编译出错的,很快就找到解决办法,就是在预编译的时候加 CPPFLAGS='-I/usr/local/courier-authlib/include'

那完整的编译参数是
./configure --prefix=/usr/local/courier-imap --with-redhat --enable-unicode --disable-root-check --with-trashquota --without-ipv6  \
CPPFLAGS='-I/usr/local/courier-authlib/include'  \
COURIERAUTHCONFIG='/usr/local/courier-authlib/bin/courierauthconfig'

由 frank 发表于 1:32 PM | 回复 (1)

April 24, 2006

squid快速编译安装

http://www.squid-cache.org/下载最新的tar包

编译:

./configure
--exec_prefix=/usr/local/squid
--bindir=/usr/sbin
--libexecdir=/usr/lib/squid
--sysconfdir=/etc/squid
--enable-poll
--enable-snmp
--enable-removal-policies="heap,lru"
--enable-storeio="aufs,coss,diskd,null,ufs"
--enable-ssl
--with-openssl=/usr/kerberos
--enable-delay-pools
--enable-linux-netfilter
--with-pthreads --enable-auth="basic"
--with-winbind-auth-challenge
--enable-useragent-log
--enable-referer-log
--disable-dependency-tracking
--enable-cachemgr-hostname=localhost
--disable-ident-lookups
--enable-truncate
--enable-underscores
--datadir=/usr/share/squid
--enable-basic-auth-helpers="NCSA"
--enable-err-language="Simplify_Chinese"
--enable-default-err-language="Simplify_Chinese"

make
make install

安装完毕后,修改目录权限,默认是以"nobody"用户运行squid.所以我们要为/usr/local/squid/var 设置相应的权限,否则会报以下错误

FATAL: Failed to make swap directory /usr/local/squid/var/cache: (13) Permission denied
Squid Cache (Version 2.5.STABLE13): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 4

或者以下错误

FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
        The parent directory must be writeable by the
        user 'nobody', which is the cache_effective_user
        set in squid.conf.

最简单的处理办法就是
chown -R nobody:nobody /usr/local/squid/var

ok,生成缓存目录
/usr/local/squid/sbin/squid -z

然后启动squid,测试一下是否成功

/usr/local/squid/sbin/squid -NCd1

默认端口是3128,用ie测试一下,如果能看到中文的拒绝访问错误提示,就说明安装正确,并且已经使用.

以后就可以直接/usr/local/squid/sbin/squid  & 后台运行即可,当然怎么配置,我这里不讲了

由 frank 发表于 2:17 PM | 回复 (0)

April 12, 2006

qmail中的几个error的产生的原因和解决方法

qmail中的几个error的产生的原因和解决方法

1 deferral: Unable_to_chdir_to_maildir._(#4.2.1)

这个是qmail找不到用户的收信目录所致。如果你是用vpopmail的虚拟域名来管理的,那看看你的control/locals文件,里面不能有虚拟域名,只能有实际域名(这个实际域名的意思应该是使用系统用户作为用户的域,而不是使用vpopmail的虚拟用户的域)。因此呢,如果不是用vpopmail,那么可能是系统用户的目录权限设置不正确。

如果发生这个错误,首先保证你没有对user/assign做过手动修改,添加域名都是使用vpopmail的vadddomin命令来添加的,没有修改过~vopmail/domins目录以及其下面目录的权限和属主,然后修改了locals文件之后重启应该就没有问题了。

2 deferral: Uh-oh:_.qmail_has_prog_delivery_but_has_x_bit_set._(#4.7.0)

这个是因为你的.qmail文件设置了x属性,把.qmail文件的x去掉就ok了。这个.qmail文件就在你的domins/xxx.com下面,包括比如.qmail-default之类的文件,修改一下权限,去掉x就ok了。

3 454 oops, unable to write pipe and I can't auth (#4.3.0)

这个错误是在你打了smtp auth的补丁之后,却发现不能正常auth,输入了正确的用户名密码还是提示不正确。可以通过下面的命令来测试。

[root@caph qmail-smtpd]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 xxx.com ESMTP
ehlo
250-xxx.com
250-PIPELINING
250-8BITMIME
250-SIZE 104857600
250 AUTH LOGIN PLAIN CRAM-MD5 //显示这个通常表示你已经打好了补丁,不过这个是可以通过修改qmail-smtp.c文件来定制的。
auth login
334 VXNlcm5hbWU6
awefaq23rasdf
334 UGFzc3dvcmQ6
awefwaef
454 oops, unable to write pipe and I can't auth (#4.3.0)
quit
221 xxx.com
Connection closed by foreign host.

出现了这种问题是因为smtp运行脚本没有设置正确的用户所致。将你的smtp的tcpserver命令的运行用户和组指定一下。

QMAILDUID=`id -u vpopmail`
QMAILDGID=`id -g vpopmail`

/usr/local/bin/tcpserver -v -H -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD"
-u "$QMAILDUID" -g "$QMAILDGID" 0 smtp /usr/local/bin/rblsmtpd -r relays.ordb.org
/var/qmail/bin/qmail-smtpd
/home/vpopmail/bin/vchkpw /bin/true /bin/cmd5checkpw /bin/true 2>&1

不需要修改~vpopmail/bin/vchkpw的属性。

4 451 qq write error or disk full (#4.3.0)

通常产生这个可能有2个原因:(1)你的qmail queue所在的磁盘空间不足。(2)qmail-queue的权限设置不正确或者文件有问题。

 

错误信息:the smtp server reply:qq crashed (#5.1.1)
修改stmp启动脚本,改大smtp的softlimit

Sorry. Although I'm listed as a best-preference MX or A for that host,it isn't in my control/locals file, so I don't treat it as local. (#5.4.6)
修改源码:ipme.c
ip_scan("0.0.0.0",&ix.ip);--92行左右加进
if (!ipalloc_append(&ipme,&ix)) { close(moreipme_fd); return 0; }

 

在邮件队列中快速删除从一个地方发过来但又不存在的邮件?
A:
设bad.jite.com是这个域。可以键入以下命令

echo # > ~alias/.qmail-baddomain-default
echo bad.jite.com:alias-baddomain>> /var/qmail/control/virtualdomains
echo bad.jite.com:127.0.0.1 >> /var/qmail/control/smtproutes
然后运行/var/qmail/bin/qmail-tcpok,给qmail-send 一个HUP信号

 

解决qmail经常收到来至<#@[]>这样的邮件!
首先说明一下<>和<#@[]>都是系统bouce信件信封(envelope)上的寄信人地址
这两种信都是系统产生的,区别在于<>往往是系统single bouce的地址,而<#@[]>则是系统double bounces或者triple bouces的地址
系统用这两种地址是为了避免邮件回路(mail loops)
来自<#@[]>一般都是系统的double bounces
要去掉这些double bounces可以有一种简单的办法
其原理是产生一个nobody的地址,发往这里的信件都会被丢弃,这样double bouces就不会烦你的postmaster了
具体步骤如下:
echo # > /var/qmail/alias/.qmail-nobody
echo nobody > /var/qmail/control/doublebounceto

由 frank 发表于 5:14 AM | 回复 (2)

February 21, 2006

为PHP编译imap函数

编译imap可能区别与其他程序的编译,这里给大家说一下,省得大家走弯路

1.下载imap的客户端库程序
wget ftp://ftp.cac.washington.edu/imap/imap-2004g.tar.Z

2.编译imap
下载的包已经不需要预编译,可以自己编译,但这里我们的编译必须加参数,比如我的系统是redhat,那我们就编译为
make lrh
至于你的系统为其他,加何参数,你可以自己看Makefile,找到你对应系统的参数

3.编译成功后,cd c-client
cp *.h /usr/local/include/
cp c-client.a  /usr/local/lib/

4.现在我们可以重新编译php,加上--with-imap参数

 

由 frank 发表于 5:57 AM | 回复 (2)

February 20, 2006

为php编译mcrypt函数

网站的需要,php需要用到mcrypt函数,初步看了一下php的编译函数,很简单,就是增加--with-mcrypt编译参数就行,但你真的预编译的时候,他就会提示错误configure: error: mcrypt.h not found. Please reinstall libmcrypt,大致意思是你没有编译libmcrypt,我们只好先编译libmcrypt
 
到这里ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/下载libmcrypt-2.5.7.tar.gz,编译很简单,依旧是configure,make,make check,make install。

装完马上重新去编译php,安装非常顺利。

当然我是走了不少弯路,还以为要装mcrypt这个程序,装这个程序更加麻烦,除了要安装libmcrypt,还要安装mhash,装完这两个,记得修改ld.so.conf,这样mcrypt才能正常安装。由于可能php实际不需要这个,这里就不讲实际问题了,如果大家碰到问题,可来交流。

附:mcrypt-2.6.4的安装

1.先安装libmcrypt,前面已经阐述

2.安装mhash,去http://mhash.sourceforge.net/下载mhash,安装简单,不过我安装最新的0.9.4版本,在make check时候失败,所以我最后安装了个0.9.2版本。

3.安装mcrypt-2.6.4.tar.gz
如果你顺利安装了前2者,你才可以安装mcrypt-2.6.4.tar.gz,但在预编译的时候,你可能会碰到以下错误:configure: error: "You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/" 按理你应该是安装了mhash,之所以他提这么的错误,我们可以初步分析为预编译的时候没找到lib文件所在的地址,所以我们可以这么做
cd mcrypt-2.6.4
LD_LIBRARY_PATH=/usr/local/lib ./configure
make
make install

由 frank 发表于 3:36 PM | 回复 (0)

January 5, 2006

apache的rewrite模块实例操作

最近公司做一个网站,需要应用到url重定向到静态页面的技术,以前一直头疼学习rewrite模块的规则配置,看来今天不得不硬着头皮学习了。

我们的目标是把http://www.bulknews.cn/show.php?id=1014700通过rewrite的url重写,使可以直接http://www.bulknews.cn/1014700.html访问

1.首先配置apache的httpd.conf,目的是使.htaccess文件生效
<VirtualHost a.b.c.d>
    ServerAdmin a@b.com
    DocumentRoot /var/www/bulknews
    ServerName www.bulknews.cn
<Directory />
      Options FollowSymLinks
      AllowOverride All
</Directory>
ErrorLog  "|/usr/local/sbin/cronolog /var/log/www/wapya/www.bulknews.cn_error_log.%Y%m%d"
CustomLog "|/usr/local/sbin/cronolog /var/log/www/wapya/www.bulknews.cn_access_log.%Y%m%d" combined
</VirtualHost>

注意,这里必须是FollowSymLinks,AllowOverride是All,否则rewrite引擎根本不起作用,另外如果你的apache默认根目录是/var/www 的话,在/var/www的配置字段也要设置
Options FollowSymLinks
 AllowOverride All
我的就因为这个,只是在虚拟主机设置,导致一直不能实现静态页面的转化。

2.在/var/www/bulknews下设置.htaccess文件
我们这边最简单的配置就是
RewriteEngine   on
RewriteBase     /
RewriteRule     (.+)\.html$ show.php?id=$1 [L]

OK,重启web服务,这时候你就可以正常访问http://www.bulknews.cn/1014700.html

另外rewrite还有很多应用,大家可以多去google找一些资料,功能还是很神奇的。

参考文档:
Search Engine  Friendly的URL设计

 

由 frank 发表于 2:50 PM | 回复 (4) | 引用

December 30, 2005

qmail+vpopmail安装笔记

这次重新安装,参考了Bill's Linux Qmail Toaster的文章,改作者对qmail的应用做了深度的整合,基本上实现了大家普遍关心的Qmail SMTP 发信验证,SSL支持和病毒,垃圾邮件检测的支持。

我今天的笔记不包括垃圾邮件和病毒的检测,大家如果关心的可以去Bill's Linux Qmail Toaster详细看看。

安装qmail邮件服务器之前,当然你得配置好dns了,至于dns得mx怎么配置,不是我们今天要讲的重点。
首先为了安装顺利进行,大家先确认系统是否安装了以下程序,我们用一个简单的命令来查询:
rpm -qa |grep g++ gcc-g++ gdbm gdbm-devel openssl openssl-devel stunnel krb5-devel bzip2 bzip2-devel
如果没有安装的话,可以到系统的安装盘寻找相应的rpm包,我的系统是redhat 9.0。如果你是fedra或者Debian,那你更加方便,只要yum或者apt-get安装缺失的软件包就行。

然后删除系统自带的邮件系统,以免安装受影响
rpm -e --nodeps sendmail postfix

1。下载所需软件包
mkdir -p /var/src/tar    我们把所有的软件下载到此
cd /var/src/tar

wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
wget http://shupp.org/software/netqmail-1.05.tar.gz
wget http://shupp.org/patches/qmail-toaster-0.8.patch.bz2
wget http://shupp.org/software/vpopmail-5.4.10.tar.gz
wget http://shupp.org/software/autorespond-2.0.4.tar.gz
wget http://shupp.org/patches/autorespond-2.0.4-2.0.5.patch
wget http://shupp.org/software/qmailadmin-1.2.9.tar.gz
wget http://shupp.org/software/qmailadmin-help-1.0.8.tar.gz
wget http://cr.yp.to/software/ezmlm-0.53.tar.gz
wget http://shupp.org/software/ezmlm-idx-0.443.tar.gz
wget http://shupp.org/software/courier-imap-4.0.6.tar.bz2
wget http://shupp.org/software/courier-authlib-0.58.tar.bz2
wget http://shupp.org/software/squirrelmail-1.4.5.tar.bz2
wget http://shupp.org/software/quota_usage-1.3-1.2.7.tar.gz
wget http://shupp.org/software/toaster-scripts-0.8.tar.gz

cd ../
tar -xzf tar/netqmail-1.05.tar.gz
cd netqmail-1.05
./collate.sh

2。安装软件
daemontools
mkdir -p /package
chmod 1755 /package
cd /package
tar -xpzf /var/src/tar/daemontools-0.76.tar.gz
cd admin/daemontools-0.76
patch -p1 < /var/src/netqmail-1.05/other-patches/daemontools-0.76.errno.patch
package/install

ucspi-tcp
cd /var/src/
tar -xzf tar/ucspi-tcp-0.88.tar.gz
cd ucspi-tcp-0.88
patch -p1 < /var/src/netqmail-1.05/other-patches/ucspi-tcp-0.88.errno.patch
make
make setup check

qmail
mkdir /var/qmail
groupadd nofiles
useradd -g nofiles -d /var/qmail/alias alias
useradd -g nofiles -d /var/qmail qmaild
useradd -g nofiles -d /var/qmail qmaill
useradd -g nofiles -d /var/qmail qmailp
groupadd qmail
useradd -g qmail -d /var/qmail qmailq
useradd -g qmail -d /var/qmail qmailr
useradd -g qmail -d /var/qmail qmails
cd /var/src
tar -xzf tar/toaster-scripts-0.8.tar.gz
cd netqmail-1.05/netqmail-1.05/
 ln -s /usr/kerberos/include/com_err.h /usr/kerberos/include/krb5.h /usr/kerberos/include/profile.h /usr/include/
rm /usr/sbin/sendmail

 

make
make setup check
注意qmail的补丁将在vpopmail安装以后打

打开SPF checking
echo 3 > /var/qmail/control/spfbehavior

cd ~alias; echo "admin@example.com" > .qmail-postmaster ;\
echo "admin@example.com" > .qmail-mailer-daemon ;\
echo "admin@example.com" > .qmail-root )
chmod 644 ~alias/.qmail*

./config-fast full.hostname   你可以填写你实际邮件服务器的域名

修改qmail的man路径
Edit  /etc/man.config
Add "MANPATH /var/qmail/man"

相应脚本
cd /var/src
cp toaster-scripts-0.8/rc /var/qmail/rc
chmod 755 /var/qmail/rc
mkdir /var/log/qmail
echo ./Maildir/ >/var/qmail/control/defaultdelivery
cp toaster-scripts-0.8/qmailctl /var/qmail/bin/
chmod 755 /var/qmail/bin/qmailctl
ln -s /var/qmail/bin/qmailctl /usr/bin
ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
#Now create the supervise directories/scripts for the qmail services:
mkdir -p /var/qmail/supervise/qmail-send/log
mkdir -p /var/qmail/supervise/qmail-smtpd/log
mkdir -p /var/qmail/supervise/qmail-pop3d/log
mkdir -p /var/qmail/supervise/qmail-pop3ds/log
cp /var/src/toaster-scripts-0.8/send.run /var/qmail/supervise/qmail-send/run
cp /var/src/toaster-scripts-0.8/send.log.run /var/qmail/supervise/qmail-send/log/run
cp /var/src/toaster-scripts-0.8/smtpd.run /var/qmail/supervise/qmail-smtpd/run
cp /var/src/toaster-scripts-0.8/smtpd.log.run /var/qmail/supervise/qmail-smtpd/log/run
cp /var/src/toaster-scripts-0.8/pop3d.run /var/qmail/supervise/qmail-pop3d/run
cp /var/src/toaster-scripts-0.8/pop3d.log.run /var/qmail/supervise/qmail-pop3d/log/run
cp /var/src/toaster-scripts-0.8/pop3ds.run /var/qmail/supervise/qmail-pop3ds/run
cp /var/src/toaster-scripts-0.8/pop3ds.log.run /var/qmail/supervise/qmail-pop3ds/log/run
echo 20 > /var/qmail/control/concurrencyincoming
chmod 644 /var/qmail/control/concurrencyincoming
chmod 755 /var/qmail/supervise/qmail-send/run
chmod 755 /var/qmail/supervise/qmail-send/log/run
chmod 755 /var/qmail/supervise/qmail-smtpd/run
chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
chmod 755 /var/qmail/supervise/qmail-pop3d/run
chmod 755 /var/qmail/supervise/qmail-pop3d/log/run
chmod 755 /var/qmail/supervise/qmail-pop3ds/run
chmod 755 /var/qmail/supervise/qmail-pop3ds/log/run
mkdir -p /var/log/qmail/smtpd
mkdir -p /var/log/qmail/pop3d
mkdir -p /var/log/qmail/pop3ds
chown -R qmaill /var/log/qmail

允许daemontools来启动qmail
ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service

检测qmail是否安装成功
sleep 5
qmailctl stat

Vpopmail
groupadd -g 89 vchkpw
useradd -u 89 -g vchkpw vpopmail
cd /var/src
tar -xzf tar/vpopmail-5.4.10.tar.gz
cd vpopmail-5.4.10

./configure --enable-logging=v
make
make install-strip
echo '127.:allow,RELAYCLIENT=""' > ~vpopmail/etc/tcp.smtp
cd ~vpopmail/etc
tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp

安装vpopmail启动脚本
cp ../toaster-scripts-0.8/vpopmailctl /var/qmail/bin/vpopmailctl

chmod 755 /var/qmail/bin/vpopmailctl
ln -s /var/qmail/bin/vpopmailctl /usr/bin

这时候我们可以安装qmail的补丁了
cd /var/src/netqmail-1.05/netqmail-1.05
bunzip2 -c ../../tar/qmail-toaster-0.8.patch.bz2 | patch -p0
make clean
make
qmailctl stop
make setup check

chown -R vpopmail:vchkpw /var/qmail/spam

重启启动qmail
qmailctl start

允许daemontools来启动vpopmail
ln -s /var/qmail/supervise/qmail-pop3d /var/qmail/supervise/qmail-pop3ds /service

检测vpopmail
sleep 5
vpopmailctl stat

测试
添加域:
/home/vpopmail/bin/vadddomain test.com [会让你定义密码]

添加用户:
/home/vpopmail/bin/vadduser -q 6MB user@test.com

然后用outlook测试一下你新建的帐号,就ok了

由 frank 发表于 4:00 AM | 回复 (1)

August 30, 2005

在linux下使用google talk

相信大家都已经试用google的talk很多天,做为linux的爱好者,其实更加关心,google的talk是否能在linux下正常使用。可惜在google talk的主页还没有针对linux的版本,让人有点遗憾,不过欣喜的是talk用的是开源的Jabber协议,心想:"既然开源,应该能在gaim上使用"。

打开gaim的帐号设置,果然看到有Jabber协议,嘿嘿,离成功不远了

登入选项
协议:Jabber
用户名:gmail邮箱前缀
服务器:gmail.com
资源:google talk
密码:gmail邮箱密码

显示主要选项:
Jabber选项
选中"use TLS if available"和"Allow plaintext auth over unencrypted steams"
端口:5222
连接服务器:64.233.167.125

googletalk.jpg

ok,大家尽情享受google talk带来的乐趣吧

原文参考:
http://www.linuxfans.org/nuke/modules.php?name=News&file=article&sid=2862&mode=&order=0&thold=0

由 frank 发表于 8:00 AM | 回复 (3)

August 25, 2005

在linux下安装摄像头

环境:
系统:Fedora Core 4
摄像头:恋影双双 比翼版

先去摄像头的官方网站看摄像头的详细信息,得知此摄像头的芯片为中微星301P,据说这款芯片低端市场占有率70%,可惜就是这么高的占有率,居然没有linux的任何驱动,真为公司悲哀。

幸好国外的朋友开发了兼容这款芯片的驱动程序。大家可以到http://mxhaard.free.fr/spca5xx.html 下载最近的驱动。安装非常简单。

tar zvxf spca5xx-20050701.tar.gz
cd spca5xx-20050701
make clean    (如果你以前安装过旧版本,先运行此)
make
make install

我的是2.6的内核,2,4内核的请参考安装说明

FC4支持即插即用了,我的摄像头是usb,插上就认,你可以lsmod看到插上摄像头后已经加载spca5xx模块。

如果你的系统没设置即插即用,那你只能重新启动,或者参考Fedora Core 4.0 HAL配置即插即用移动存储(USB及1394)的实践

好了,系统认出摄像头来后,就开始我们的实际应用,打开GnomeMeeting,如果你还没装yum一下了:)

初始化的时候,软件会让你选择驱动,如果模块加载正确的话,默认系统会选择z-star vimsicro zc0301p

 cam2.jpg

好了,尽情享受摄