|
CentOS5.xでiaxmodemとHylafaxの組み合わせでFAXサーバを構築します。 CebtOS5.4(32Bit)で確認しました。 0.Asteriskのセットアップまで終えておくこと 1.iaxmodem + Hylafaxに必要なライブラリー類のセットアップ yum -y install libjpeg libjpeg-devel libtiff libtiff-devel \ ghostscript ghostscript-devel ghostscript-fonts sox 2.iaxmodemのインストール cd wget http://sourceforge.net/projects/iaxmodem/files/iaxmodem/iaxmodem-1.2.0/iaxmodem-1.2.0.tar.gz/download tar xvfz iaxmodem-1.2.0.tar.gz cd iaxmodem-1.2.0 cd lib/libiax2/ ./configure make make install ②ライブラリー環境の設定 echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf /sbin/ldconfig -v ③spandspのインストール cd .. cd spandsp/ ./configure make make install /sbin/ldconfig -v ④iaxmodemのバイナリをコピー cd .. cd .. ./build cp -p iaxmodem /usr/local/sbin/ ⑤環境ファイルのコピー mkdir /etc/iaxmodem cp -p iaxmodem-cfg.ttyIAX /etc/iaxmodem/ttyIAX cat /etc/iaxmodem/ttyIAX 3.hylafaxのインストール cd wget ftp://ftp.hylafax.org/source/hylafax-6.0.3.tar.gz tar xvfz hylafax-6.0.3.tar.gz cd hylafax-6.0.3 ./configure 変更するのは、13と14の用紙サイズに関連するところです。 ==================================================================
Looks like manual pages go in /usr/local/man.
Looks like manual pages should be installed with bsd-source-cat.
Press Return to Continue
HylaFAX configuration parameters (part 1 of 2) are:
[ 1] Directory for applications: /usr/local/bin
[ 2] Directory for lib data files: /usr/local/lib/fax
[ 3] Directory for lib executables: /usr/local/sbin
[ 4] Directory for system apps: /usr/local/sbin
[ 5] Directory for manual pages: /usr/local/man
[ 7] Directory for spooling: /var/spool/hylafax
[ 8] Directory for uucp lock files: /var/lock
[ 9] Uucp lock file scheme: ascii
[10] PostScript imager package: gs
[11] PostScript imager program: /usr/bin/gs
[12] Manual page installation scheme: bsd-source-cat
[13] Default page size: North American Letter
[14] Default vertical res (lpi): 98
Are these ok [yes]? 13
Default page size [North American Letter]? A4
HylaFAX configuration parameters (part 1 of 2) are:
[ 1] Directory for applications: /usr/local/bin
[ 2] Directory for lib data files: /usr/local/lib/fax
[ 3] Directory for lib executables: /usr/local/sbin
[ 4] Directory for system apps: /usr/local/sbin
[ 5] Directory for manual pages: /usr/local/man
[ 7] Directory for spooling: /var/spool/hylafax
[ 8] Directory for uucp lock files: /var/lock
[ 9] Uucp lock file scheme: ascii
[10] PostScript imager package: gs
[11] PostScript imager program: /usr/bin/gs
[12] Manual page installation scheme: bsd-source-cat
[13] Default page size: ISO A4
[14] Default vertical res (lpi): 98
Are these ok [yes]? 14
Default vertical res (lpi) [98]? 196
HylaFAX configuration parameters (part 1 of 2) are:
[ 1] Directory for applications: /usr/local/bin
[ 2] Directory for lib data files: /usr/local/lib/fax
[ 3] Directory for lib executables: /usr/local/sbin
[ 4] Directory for system apps: /usr/local/sbin
[ 5] Directory for manual pages: /usr/local/man
[ 7] Directory for spooling: /var/spool/hylafax
[ 8] Directory for uucp lock files: /var/lock
[ 9] Uucp lock file scheme: ascii
[10] PostScript imager package: gs
[11] PostScript imager program: /usr/bin/gs
[12] Manual page installation scheme: bsd-source-cat
[13] Default page size: ISO A4
[14] Default vertical res (lpi): 196
Are these ok [yes]? yes
HylaFAX configuration parameters (part 2 of 2) are:
[15] Location of getty program: /sbin/agetty
[16] Location of voice getty program: /bin/vgetty
[17] Location of sendmail program: /usr/sbin/sendmail
[18] Location of TIFF tools: /usr/bin
[19] Location of SysV init scripts: /etc/rc.d/init.d
[20] Location of SysV start scripts: ../rc2.d ../rc3.d ../rc4.d ../rc5.d
[21] Location of SysV stop scripts: ../rc0.d ../rc1.d ../rc6.d
[22] Name of SysV start script: S97hylafax
[23] Name of SysV stop script: K05hylafax
[24] Init script starts faxq: yes
[25] Init script starts hfaxd yes
[26] Start paging protocol: no
Are these ok [yes]? yes
:
Creating pkg/srequest from ./pkg/srequest.in
Creating port/mkdepend from ./port/mkdepend.in
Creating regex/Makefile from ./regex/Makefile.in
Creating po/Makefile from ./po/Makefile.in
Creating po/version.po from ./po/version.po.in
Done.
==================================================================
② makeとmake install make make install ③faxsetupの実行 faxsetup 問い合わせには以下のように答える。 ==================================================================
Setup program for HylaFAX (tm) 6.0.3.
Created for i686-pc-linux-gnu on Tue May 11 12:55:59 JST 2010.
Found base64 encoder: /usr/bin/base64
Found Quoted-Printable encoder: qp-encode
Looks like /usr/bin/base64 supports base64 encoding.
Found mimencode for compatibilty: mimencode
Checking system for proper client configuration.
Checking system for proper server configuration.
Warning: /bin/vgetty does not exist or is not an executable program!
The file:
/bin/vgetty
does not exist or this file is not an executable program. The
HylaFAX software optionally uses this program and the fact that
it does not exist on the system is not a fatal error. If the
program resides in a different location and you do not want to
install a symbolic link for /bin/vgetty that points to your program
then you must reconfigure and rebuild HylaFAX from source code.
Warning: /bin/egetty does not exist or is not an executable program!
The file:
/bin/egetty
does not exist or this file is not an executable program. The
HylaFAX software optionally uses this program and the fact that
it does not exist on the system is not a fatal error. If the
program resides in a different location and you do not want to
install a symbolic link for /bin/egetty that points to your program
then you must reconfigure and rebuild HylaFAX from source code.
Warning: /usr/share/ghostscript/fonts does not exist or is not a directory!
The directory /usr/share/ghostscript/fonts does not exist or this file is not a directory.
This is the directory where the HylaFAX client applications expect to
locate font metric information to use in formatting ASCII text for
submission as facsimile. Without this information HylaFAX may generate
illegible facsimile from ASCII text.
Make /var/spool/hylafax/bin/ps2fax a link to /var/spool/hylafax/bin/ps2fax.gs.
Make /var/spool/hylafax/bin/pdf2fax a link to /var/spool/hylafax/bin/pdf2fax.gs.
There does not appear to be an entry for the FaxMaster either in
the YP/NIS database or in the /etc/aliases file. The
FaxMaster is the primary point of contact for HylaFAX problems.
The HylaFAX client-server protocol server identifies this alias as
the place to register complaints and HylaFAX directs automatic mail
messages to this user when problems are identified on a server
machine or when the routine server maintainence scripts are run
(e.g. faxcron).
Should an entry be added for the FaxMaster to /etc/aliases [yes]?
Users to receive fax-related mail [root]?
/etc/aliases: 77 aliases, longest 10 bytes, 778 bytes total
Rebuilt /etc/aliases database.
Update /var/spool/hylafax/status/any.info.
HylaFAX configuration parameters are:
[1] Init script starts faxq: yes
[2] Init script starts hfaxd yes
[3] Start paging protocol: no
Are these ok [yes]?
Modem support functions written to /var/spool/hylafax/etc/setup.modem.
Configuration parameters written to /var/spool/hylafax/etc/setup.cache.
No scheduler config file exists, creating one from scratch.
Country code [1]? 81
Area code []? 6
Long distance dialing prefix [1]? 0
International dialing prefix [011]? 001
Dial string rules file (relative to /var/spool/hylafax) ["etc/dialrules"]?
Tracing during normal server operation [1]?
Default tracing during send and receive sessions [0xffffffff]?
Continuation cover page (relative to /var/spool/hylafax) []?
Timeout when converting PostScript documents (secs) [180]?
Maximum number of concurrent jobs to a destination [1]?
Define a group of modems []?
Time of day restrictions for outbound jobs ["Any"]?
Timeout before purging a stale UUCP lock file (secs) [30]?
Max number of pages to permit in an outbound job [0xffffffff]?
Syslog facility name for ServerTracing messages [daemon]?
The non-default scheduler parameters are:
CountryCode: 81
AreaCode: 6
LongDistancePrefix: 0
InternationalPrefix: 001
Are these ok [yes]?
Creating new configuration file /var/spool/hylafax/etc/config...
Restarting HylaFAX server processes.
Should I restart the HylaFAX server processes [yes]?
/etc/rc.d/init.d/hylafax start
HylaFAX: faxq hfaxd (without SNPP support).
You do not appear to have any modems configured for use. Modems are
configured for use with HylaFAX with the faxaddmodem(8C) command.
Do you want to run faxaddmodem to configure a modem [yes]? no
Done verifying system setup.
==================================================================
④設定ファイルの編集 vi /etc/asterisk/iax.conf 以下の行を追加 ; add for iaxmodem [iaxmodem] type=friend username=iaxmodem secret=password host=dynamic disallow=all allow=ulaw allow=slinear requirecalltoken=no ;context=fax-out ⑤iaxmodemとHylafaxの連携に関するファイルを編集 cd /root/iaxmodem-1.2.0 cp -p config.ttyIAX /var/spool/hylafax/etc/ vi /var/spool/hylafax/etc/config.ttyIAX 以下の内容とする。 =========================================== CountryCode: 81 AreaCode: 6 FAXNumber: +81.6.6111.1234 LongDistancePrefix: 1 InternationalPrefix: 011 DialStringRules: etc/dialrules ServerTracing: 0xFFF SessionTracing: 0xFFF RecvFileMode: 0600 LogFileMode: 0600 DeviceMode: 0600 RingsBeforeAnswer: 1 SpeakerVolume: off GettyArgs: "-h %l dx_%s" LocalIdentifier: "Aska IAXmodem" TagLineFont: etc/lutRS18.pcf TagLineFormat: "From %%l|%c|Page %%P of %%T" MaxRecvPages: 200 =========================================== ⑥リトライ回数の設定等 cd /usr/local/lib/fax/ vi sendfax.conf 以下の内容とする。 =========================================== MaxTries: 2 MaxDials: 2 =========================================== vi hfaxd.conf JobFmt?の部分を以下のように置き換える。 =========================================== #JobFmt: "%-3j %3i %1a %6.6o %-12.12e %5P %5D %7z %.25s" JobFmt: "%-5j %1a %-27.27e %5P %5D %10Z %.25s" =========================================== ⑦自動起動の設定 cd /root/iaxmodem-1.2.0 cp -p iaxmodem.init.fedora /etc/init.d/iaxmodem chmod +x /etc/init.d/iaxmodem chkconfig --add iaxmodem chkconfig --list iaxmodem ⑧/etc/inittabの書き換え echo "# Run faxgetty" >> /etc/inittab echo "mo:2345:respawn:/usr/local/sbin/faxgetty /dev/ttyIAX" >> /etc/inittab ここで再起動。 ⑨受信したFaxをメールで転送する場合FaxDispatch?を書き換える。 vi /var/spool/hylafax/etc/FaxDispatch 内容は以下のとおりとする。 ============================================== SENDTO=your@mail.address; FILETYPE=pdf; ============================================== |