服务器维护,服务器代维,安全设置,漏洞扫描,入侵检测服务

dirtysea 发表于 2010-6-30 11:19:35

LINUX下安装部署传真服务器hylafax

**:高进波
时间:2009-04-12
主题:LINUX下安装部署传真服务器hylafax
一.准备工作
    1.电话线一条,可以打电话.
    2.直接语音拨号和收到传真的外置MODEM一个.
    3.CENTOS LINUX 5.1

二.安装MODEM
    1.将MODEM接到COM1
      输入命令:stty    或者    dmesg|grep tty    检测系统串行端口,如果是串口一的话,就是/dev/ttyS0
    2.使用minicom和cu测试MODEM (UUCP软件包)
      输入:cu -l ttyS0
      输入:at+fclass=?    ati0    ati1    ati3    ati4    ati5   
            atdt13590721533    使用atdt命令拨电话号,测试是否可以拨出.
    3.测试MODEM
      输入:cu -l ttyS1
   Connected
   输入:at+fclass=?
   0,1,8
   OK
       输入:"~" 出现主机名后输入:"."
       Disconnected
   只要调制解调器能够给出合理的回应,就表示联接正常。
      响应0,1,8表示我目前使用的调制解调器支持数据、class 1传真和语音功能。
      外置modem不需要在系统里面安装驱动程序,系统检测到串行端口就可直接使用.

三.下载、安装、配置HylaFAX服务器
    1.安装以下依赖软件包
      libtiff    ghostscript    ghostscript-fonts    sharutils    metamail    fax4CUPS
    2.安装hylafx传真服务器软件包
      rpm -ivh hylafax-4.4.4-1rhel5.i386.rpm
    3.输入:faxsetup进行配置
      接着第一个问题是
      Should an entry be added for the FaxMaster to /etc/aliases ? yes
      在/etc/aliases加入别名, 输入yes,按enter键继续基本配置;
      Users to receive fax related mail ? fandy
      fandy将收到的传真相关的mail(如果统计报表等),输入fandy,按enter键继续基本配置;
      Are these ok ? yes
      **以上信息是否正确,输入yes,按enter键继续基本配置;
      Country code ? 086
      **国际区号0086(**),输入086,按enter键继续基本配置;
      Area code []?20
      国内城市区号(广州市020) 输入20,按enter键继续基本配置;
      Long distance dialing prefix ? 0
      长途码0, 输入0,按enter键继续基本配置;
      International dialing prefix ? 020
      国际电话前置码020, 输入020,按enter键继续基本配置;
      Dial string rules file (relative to /var/spool/hylafax)["etc/dialrules"]?
      拨号规则文件设为/var/spool/hylafax/etc/dialrule,按enter键继续基本配置;
      Tracing during normal server operation ? 1
      启动除错选项,输入1,按enter键继续基本配置;
      Default tracing during send and receive session ?
      接收、发送传真时启用除错功能,按enter键继续基本配置;
      Continuation cover page (relative to /var/spool/hylafax) []?
      设定封面的页的所在目录,按enter键继续基本配置;
      Timeout when converting PostScript documents (secs) ? 180
      设定转换为ps文件的逾时时间180秒,输入180,按enter键继续基本配置;
      Maximum number of concurrent jobs to a destination? 1
      最大同时传送一个目的的工作数,输入1,按enter键继续基本配置;
      Define a group of modems []
      除非你有好几台调制解调器,按enter键继续基本配置;
      Time of day restrictions for outbound jobs ["Any"]?
      限制外送传真的时间Any(任何时间),按enter键继续基本配置;
      Pathname of destination controls file (relative to /var/spool/hylafax) []?
      所有安装目的控制文件的所在目录相对于/var/spool/hylafax按enter键继续基本配置;
      Timeout before purging a stale UUCP lock file (secs) 30
      清除UUCP设定文件的等待时间,输入30,按enter键继续基本配置;
      Max number of pages to permit in an outbound job
      外送传真的最多页数,按enter键继续基本配置;
      Syslog facility name for ServerTracing messages ?
      相关于日志信息是记录在/var/log/messages文件中,按enter键继续基本配置;
      Are these ok ? yes
      确定以上的设定是否正确,输入yes,按enter键继续基本配置;
      Restarting Hylafax server process.
      Should I restart the Hylafax server process ? yes
      现在要启动hylafax服务器。输入yes,按enter键继续基本配置;
      You do not appear to have any modem configured for use. Modems are
      ocnfigured for use with HylaFax with the faxaddmodem command.
      Do you want to run faxaddmomdem to configure a modme ? yes
      你尚未指定任何调制解调器,现在是否要设定使用faxaddmodem命令。输入yes,按enter键继续基本配置;
      Serial port that modem is connected to []? ttyS0
      因为之前没有设定,这里会跳出来叫你设定,调制解调器的端口一般为ttyS0。输入ttyS0,按enter键继续基本配置;
      country code 086
      **国际区号0086(**)。输入086,按enter键继续基本配置;
      Area code ? 020
      **、广东省、广州市区号:020。输入020,按enter键继续基本配置;
      Phone number of fax modem [+1,9999.5555.1212]? +008602084680605
      你调制解调器所接的电话号码,国际区号+区码+电话号码。输入+008602084680605,按enter键继续基本配置;
      Local Identifications string (for TS/CIG) ["NothingEtup"]? Nseasy.Net
      传真机的识别ID,当你传真时显示在对方传真机LCD的文字。输入Nseasy.Net,按enter键继续基本配置;
      Long distance dialing prefix ? 0
      长途号码0。输入0,按enter键继续基本配置;
      International dialing prefix ? 020
      国际电话前置号码020。输入020,按enter键继续基本配置;
      Dial string rules file (relative to /var/spool/hylafax) ?
      拔号规则设定文件为/var/spool/hylafax/etc/dialrules,按enter键继续基本配置;
      Tracing during normal server operation ? 1
      启动侦错功能,按enter键继续基本配置;
      Tracing during send and receive sessions ? 11
      接收、发送传真时执行侦错功能,按enter键继续基本配置;
      Protection mode for received facsimile ?0777
      收到传真的文件权限。输入0777,按enter键继续基本配置;
      Protection mode for session logs ? 0777
      记录文件的档案权限。输入0777,按enter键继续基本配置;
      Protection mode for ttyS0 ? 0777
      端口的访问权限。输入0777,按enter键继续基本配置;
      Rings to wait before answering ? 2
      设定响铃几声后,开始接受传真。输入2,按enter键继续基本配置;
      Modem speaker volume ? on
      设定是否开启Modem音量可替换on、Off、Quiet、Low、Medium、High。输入on,按enter键继续基本配置;
      Command line arguments to getty program ["-h %l dx_%s"]?
      接收传真的命令。按enter键继续基本配置;
      Pathname of Tsi access control list file (relative to /var/spool/hylafax)[""]?
      Modem的识别ID ACL文件存放的路径/var/spool/hylafax。按enter键继续基本配置;
      Pathname of Caller-ID access control list file (relative to /var/spool/hylafax)[""]?
      Caller-ID ACL 文件存放的路径/var/spool/hylafax。按enter键继续基本配置;
      Tag line font file (relative to /var/spool/hylafax) ?
      传真最上面包含(送件人,收件人,日期,公司等)等资料我们称为tag line所使用的字型。按enter键继续基本配置;
      Tag line form string ["From %%1|%c|Page %%P of %%T"]?
      设定前面提到的Tag line格式。按enter键继续基本配置;
      Time before purging a stale UUCP lock file (secs) ? 30
      清除UUCP设定文件的等待时间,输入30,按enter键继续基本配置;
      Hold UUCP lockfile during inbound data calls ? yes
      当有资料傎进来时,保留UUCP设定文件,输入yes,按enter键继续基本配置;
      Hold UUCP lockfile during inbound voice calls ? yes
      当有语音傎进来时,保留UUCP设定文件,输入yes,按enter键继续基本配置;
      Percent good lines to accept during copy quality checking ? 95
      输入95,按enter键继续基本配置;
      Max consecutive bad lines to accept during copy quality checking ? 5
      输入5,按enter键继续基本配置;
      Max number of pages to accept in a received facsimile ? 48
      一次传真进来的最大可接收页数,输入48,按enter键继续基本配置;
      Syslog faxility name for ServerTracing messages ?
      储存纪录的方式Daemon:记录在/var/log/messages。按enter键继续基本配置;
      Set UID to 0 to manipulate CLOCAL [""]?
      按enter键继续基本配置;
      Use available proiority job scheduling mechanism [""]?
      可使用proiorty作业调度机制,按enter键继续基本配置;
      Are these ok ? yes
      确定以上的设定是否正确,输入yes,按enter键继续基本配置;
      Probing for best speed to talk to modem:38400
      开始测试Modem各项功能;
      How should it be configured ? 1
      输入1,按enter键继续基本配置;
      DTE-DCE flow control scheme ?
      按enter键继续基本配置;
      Are these ok ? yes
      确定以上的设定是否正确,输入yes,按enter键继续基本配置;
      Are these ok ? yes
      确定以上的设定是否正确,输入yes,按enter键继续基本配置;
      Do you want to run faxaddmodem to configure another modem ? no
      问你要不要再设定其他的调制解调器, 输入no,按enter键继续基本配置;
      Should I run faxmodem for each configured modem ? yes
      输入yes,按enter键继续基本配置;
      Done verifying system setup.
      至此,已经完成HylaFAX服务器进行基本配置      
    4.hylafax的档案结构
      所有的配置文件主要目录是放在/var/spool/hylafax:
      bin         ## 这里存放一些程序,如收传真,及不同格式的转换程序等
      config      ## 调制解调器的样本配置文件
      etc         ## 所有真正的配置文件
      pollq、docq、doneq、sendq、recvq   ## 所有的queue
      log         ## 记录了每一笔的收送的交谈内容
      info          ## 记录了每一台曾经收送的传真机(有call id)的一些参数,以加速传真不用再查询一次
      status      ## 传真机的状态文件
      bin目录:
      faxrcvd               ## 收到传真所要做的动作
      notify、notify、awk   ## 收送传真的通知动作
      pdf2fax               ## 将pdf文件转为可传真的格式tiff class F
      ps2fax                ## 将ps文件转为可传真的格式tiff class F
      tiff2fax               ## 将tiff传为可传真的格式tiff class F
      etc目录:
      config.*               ## 你的端口的设定,config.端口的名称,如config.ttyS0
      hosts.hfaxd client   ## 存取传真服务器的配置文件
      lastrun               ## 传真服务器最后收送的时间
      setup.modem         ## 测试调制解调器的程序
      lutRS18.pcf         ## tag line的字型文件
      xferfaxlog             ## 收送传真的记录文件
      status目录:
      any.info            ## 你的hylafax的版本数据
      ttyS0               ## 依你端口的名称而有不同,内容为传真服务器的状态
    5.增加删除用户
      新增用户faxadduser,其实它就是在/var/spool/hylafax/etc/hosts.hfaxd加入用户,例如新增加用户帐户:fandy、口令:      123456详细操作如下;
      # faxadduser -p 123456 fandy   #指定使用者的用户名和密码
      # faxadduser yer                  #不指定密碼則密碼是空白的(只要用户名对了不用密码就可以传真)
      刪除用户faxdeluser,其实它就是在/var/spool/hylafax/etc/hosts.hfaxd刪除用户,例如刪除帐户:fandy详细操作如下;
      # faxdeluser fandy                #删除使用者的用户名和密码
    6.接收传真的设定
      hylafax的收/送传真是分开设定的如下介绍如何设定接收部份,要设定接收传真必须使用faxgetty 详细的内容可以使用man             faxgetty    请在/etc/inittab中找到“#run gettys in standard runlevels”下加入一行(其中ttyS0是你调制解调            器的端口如此faxgetty便可以监听ttyS0以便响应传入的要求):
      7:2345:respawn:/usr/sbin/faxgetty ttyS0    #加入信息内容
      接下来在/var/spool/hylafax/etc/hosts.hfaxd文件中添加以下几行允许所有在域192.168.1.*中的所有客户机可以正常使用            传真服务器:
      192.168.1.0
    7.解决传真上方的Tagline变乱码问题
      默认使用英文Portable Compiled Font字型, 但是locale为中文显示, 修改方式:
      第一种方法: 修改/var/spool/hylafax/etc/hylafax.ttySx
      TagLineFormat: "From %%l | %F %T %Z | Page %%P of %%T"
      第二种方法: 把字型那行拿掉不显示Tagline(有些地区是不允许的)
      #TagLineFont : etc/lutRS18.pcf
    8.如果使用分机,在发送传真前要先拔一个号码。
      以拔号码0或9为例,修改/var/spool/hylafax/etc/目录中的config.ttyS0文件,详细修改部分请根据公司内容电话交换机设            置出局号来决定:
      ModemDialCmd:                ATDT%s                # T for tone dialing
      更改为:
      ModemDialCmd:                ATDT9W%s                #拨 9
      或者
      ModemDialCmd:                ATDT0W%s                #拨 0
    9.设定寄信文件格式为.tif or.pdf 及寄信者邮箱地址
      修改/var/spool/hylafax/etc/目录中的FaxDispatch文件
      系统这里会默认建立一个 FaxMAster : fandy的 Alias,所以设定 FaxMaster 就是寄给fandy:
      SENDTO=FaxMaster;
      更改为:
      SENDTO=fandy@nseasy.net;
      设定邮件以那种文件格式来传真(以下两种只选择其中之一pdf、tif格式):
      FILETYPE=pdf;         # 设定邮件附件文件格式为PDF,可设定pdf,建议是设定pdf;
      或者:
      FILETYPE=tif;          # 设定邮件附件文件格式为TIFF,也可设定tif;
    10.重启系统,检查hylafax是否正常运行
      执行ps -aux 可以看到 faxgetty 在执行;
      # ps -aux|grep uucp
      uucp      21760.00.2   78201228 ?      Ss   08:27   0:00 /usr/sbin/faxq
      uucp      21790.00.1   4312   860 ?      Ss   08:27   0:00 /usr/sbin/hfaxd -i hylafax
      uucp      23520.00.3   47681836 ?      Ss   08:28   0:00 /usr/sbin/faxgetty ttyS0
      现在,我们可用faxstat命令来查询服务器状态;
      # faxstat
      HylaFAX scheduler on fax.nseasy.net: Running
      Modem ttyS0 (+008602084680605): Running and idle
      出现以上信息说明服务器已正常运行。

四.测试HylaFAX服务器运行情况包括测试“接收传真、发送传真”   
    1.使用命令行来送传真sendfax
      可以直接使用的档有文本文件(不支持中文),如果要有中文必需使用相关软件将其转换才成ps文件、pdf文件、tiff文件、            tif文件可以正常传真:
      # sendfax -n -d 07608559031 files.tif    #发送传真给07608559031,n指不发送封面
    2.显示当前等待发送的文件:
      # faxstat -s
    3.从发送队列中删除传真任务: faxrm JobID
      # faxrm 2
    4.查询传真机的状态 :
      # faxstat
    5.查询/var/spool/hylafax/recvq 收到的传真
      # faxstat -r
    6.查询/var/spool/hylafax/doneq 完成的传真
      # faxstat -d
    7.查询正在发送的传真
      # faxstat -s
    8.清除缓冲池
      # faxqclean
    9.显示统计结果
      # faxcron
    10.打开收到传真文件(HylaFAX服务器收到的传真文件通常存放在/var/spool/hylafax/recvq目录中):
      Linux操作系统内有很多可供浏览图片的程序(本例中使用gThumb图像浏览器来观看):
      打开接收到fax000000001.tif
五.客户端的安装
    1.下载客户端软件HylaFAX-clinet Professional for Windows XP
    2.测试使用HylaFAX-clinet程序和HylaFAX服务器运行情况(包括测试“收传真、发送传真”)
      使用HylaFAX-clinet程序和HylaFAX服务器发送传真详细操作;
      本例子以发送一件docx文件为例,首先使用word程序打开以下的dco.docx文件
      按『打印(P)』键
      出现打印文件相关设置界面
      打印机名称(N):以送到 OneNote 2007   
      更改为:
      打印机名称(N):HylaFAX-Pro
      请注意打印机名称的选项,按『确定』键**下一步
完成!


来源:http://www.gaojinbo.com/linux下安装部署传真服务器hylafax.html
页: [1]
查看完整版本: LINUX下安装部署传真服务器hylafax