Article Title: Build a simple and easy-to-use FAX server. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: CCID
Abstract: This article explains how to configure Linux as a FAX server.
.
I. Introduction
The configuration described below uses Hylafax 4.0p2.rjc11, which runs on Mandrake7.1. On the server side, Hylafax consists of three daemon:
Faxq: main service programs
Hfaxd: Manage Network Connections
Faxgetty: Manage sessions between Modem
The program running on the client is as follows (these programs can also be run on the server ):
Sendfax: send a fax
Faxstat: check the fax queue
Faxrm: deletes a job from the queue.
The related configuration files are in the/var/spool/fax/etc/folder.
Ii. Installation
I strongly recommend that you install the following software packages (both of them are included in Mandrake 7.1 ):
Ghostscript ftp://ftp.cs.wisc.edu/pub/ghost/aladdin
Libtiff ftp://rufus.w3.org/linux/redhat
You can also obtain these resources from the official website http://www.hylafax.org/links.html. To install Hylafax, you must install the following RPM packages:
Rpm-ivh hylafax-common-4.0pl2.rjc11-3mdk
Rpm-ivh hylafax-client-4.0pl2.rjc11-3mdk
Rpm-ivh hylafax-server-4.0pl2.rjc11-3mdk
3. Configure Hylafax
Run the following command to configure the server:
Faxsetup-server (the operation must be performed as root)
In addition to the following items, select OK for all other query options, that is, select the default value:
· Country code [1]? Enter 33 for France
· Area code []? Enter 1 for Paris
· Long distance dialing prefix [1]? Enter 0
· International dialing prefix [011]? Enter 00
· Dial string rules file [etc/dialrules]? Enter etc/dialrules. europe
· Serial port that modem is connected to []? Enter ttyS0 (for COM1) or ttyS1 (for COM2)
By default, Hylafax does not automatically call the daemon faxgetty at startup. This process can be completed manually.
1. Edit the/etc/inittab file and insert the following content at the end of the file:
Mo: 2345: respawn:/usr/sbin/faxgetty-D ttyS0
Then run kill-HUP l to restart faxgetty.
Or modify the rc. local file:
2. Add the following lines to the/etc/rc. d/rc. local file:
/Usr/sbin/faxgetty-D/dev/ttys0
Run faxgetty-D/dev/ttys0.
Note: You can use the faxaddmodem command to add multiple modems.
After these operations, the file/var/spool/fax/etc/config. ttyS0 (Serial Port 1) is created for faxgetty, including the configuration of the/dev/ttyS0 modem. The/usr/share/fax/hfaxd. conf file contains the configuration of the hfaxd daemon. I have not modified it.
Possible problems:
Use the probemodem command to detect the modem. In addition, there are some typical configurations in/var/spool/fax/config.
.
My modem is 3Com's US Robotics 56 K, So I copied the usr-2.0 file to/var/spool/fax/etc, renamed config. ttyS0, and made the following changes:
# Configuration for using the Class 2.0 command interface
# With a USR v.34 Courier or Sporster modem.
#
# CONFIG: CLASS2.0: USRobotics *-*
#
CountryCode: 33
AreaCode: 1
# FAXNumber: your number ex (for france): 0134123412
LongDistancePrefix: 0
InternationalPrefix: 00
DiadStringRules: etc/dialrules. europe (Important. europe !)
ServerTracing: 1
SessionTracing: 11
RecvFileMode: 0600
LogFileMode: 0600
DeviceMode: 0600
RingsBeforeAnswer: 1
SpeakerVolume: off
GettyArgs: "-h % l dx _ % s"
# LocalIdentifier: "Your Company" (uncomment if wanted on the fax)
# TagLineFont: etc/lutRS18.pcf (idem)
# TagLineFormat: "De % l | % c | Page % p sur % t" (idem)
# MaxRecvPages: 25
ModemType: Class2.0 # use class 2.0 interface
ModemRate: 57600 #38400 DCE-DTE communication rate
ModemFlowControl: rtscts # XON/XOFF flow control assumed
ModemDialCmd: ATDT0 % s # I added 0 because I go through a PABX !!
# ModemNoFlowCmd: AT & H0 & I0 & R1 # setup modem for no flow control
ModemHardFlowCmd: AT & H1 & I0 & R2 # setup modem for hardware flow control
# ModemSoftFlowCmd: AT & H2 & I2 & R1 # setup modem for software flow control
# ModemSetupDTRCmd: ATS13 = 1 & D2 # setup so DTR drop resets modem
# ModemSetupDCDCmd: AT & C1 # setup so DCD reflects carrier (or not)
ModemResultCodesCmd: ATQ0X4 # enable extended result codes
# ModemSetupAACmd: AT + FAA = 1
# ModemSetVolumeCmd: "ATM0 ATM1 ATM1 ATM1"
Class2BUGCmd: AT + FBU = 0
Class2CQQueryCmd :! (0), (0) # override modem response
Class2NRCmd: AT + FNR = 1, 1, 0
Next, add the following lines to/var/spool/fax/etc/host:
Localhost
192.168.0.1
Allow all machines in the domain 192.168.1.0 to use faxes.
4. Start Hylafax
To run Hylafax automatically at startup, run the drakxservices command in Mandrake, run the setup command in Red Hat, and then run the following command manually:
/Etc/rc. d/init. d/hylafax start
If no faxgetty exists in the Process List (ps-e), try the following command:
/Usr/sbin/faxgetty-D/dev/ttyS0
5. How to Use Hylafax
Send Fax:
Sendfax-n-d number file1 file2
Check Results:
Faxstat-s (displays the faxes sent in the queue)
Faxstat-d (display sent faxes)
Faxstat-r (display received fax)
Remove a fax from the queue:
Faxrm number_of_job
Clear the buffer pool:
Faxqclean
Show statistics:
Faxcron
6. Use Hylafax in the Network
Server Configuration:
On http://www.hylafax.org/links.html, you can find many links related to hylafax.
Http://www.boerde.de /~ Horstf downloads Printfx and Repond
.
You need to download three files:
Printfax. pl (perl script)
Respond.zip(respond.exe pressure package)
Smb_conf.add (the module to be added to/etc/smb. conf)
Copy printfax. pl To the/usr/bin/directory and make the following changes:
### Format of commandline
# $ Response linefmt = mgetty;
$ Export linefmt = hylafax;
### The faxspoolprogram
### For mgetty + sendfax:
# $ Faxspool =/usr/bin/faxspool;
### For hylafax:
$ Faxspool =/usr/bin/sendfax;
### Additional faxspool args (e.g. header, coverpage)
### Empty:
@ Faxspool_args = qw (-n );
### For mgetty + sendfax with a special header:
# @ Faxspool_args = qw (-h/usr/local/etc/mgetty + sendfax/faxheader. smb );
### For hylafax with send email when job is done or requeued and use
### A4 sized paper:
# @ Faxspool_args = qw (-D-R-s a4 );
Note: Check the version number of printfax. pl before modification. You may have modified the version you downloaded.
Add the smb_conf.add module to/etc/smb. conf:
[Fax] comment = Fax Printer
Public = yes
Postscript = yes
Print command = (/usr/bin/printfax. pl % I % s % U % m; rm % s )&
Printable = yes
Writable = no
Path =/var/spool/samba
Check the print command, especially the print command in windows2000.
Restart Samba. /Etc/rc. d/init. d/smb restart
Client Configuration:
The following is a typical client configuration in Windows 95/98/NT/2000. Install respond.zip, which includes config.exeand respond.exe:
1. Copy these two files to the widows directory, for example, c: windows
2. Run START-> PROGRAMS-> startto create a respond.exe Link (for how to create a shortcut Link under win2000, please find win2000 help ).
3rd, run respond.exe or restart the computer.
Then you must create a network printer:
1. Click START> printers> add.
2. Select a network printer
3. Click "browse" to select the FA on the network.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service