Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

16
http://linux2.arinet.org Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax di Ubuntu 7.10 page 1 of 16

Transcript of Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

Page 1: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

Panduan SetupFax server (Hylafax) lengkap dengan Avantfax

di Ubuntu 7.10

page 1 of 16

Page 2: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

PendahuluanPanduan ini dibuat dengan latar belakang keingintahuan penulis mengenai cara menyetel fungsi-fungsi server di Ubuntu. Penulis berlatar belakang dari distro keluarga RedHat seperti Mandriva, Fedora, CentOs, dan Suse (walaupun sebenarnya Suse adalah keturunan Slackware). Telah kira-kira 8 bulan ini penulis menggunakan distro Ubuntu yang merupakan keluarga Debian.

Sebenarnya panduan mensetup Fax server menggunakan Hylafax dan Avantfax telah banyak terdapat di internet, namun sebagian besar dibuat untuk distro keluarga RedHat, sangat sedikit yang berbasiskan Debian, dalam hal ini Ubuntu. Kalaupun ada, kebanyakan sudah cukup lama tidak diupdate. Oleh karena itulah juga penulis membuat panduan ini menggunakan paket-paket yang terbaru.

Latar BelakangSebenarnya mengapa sih repot-repot membuat faxserver?Selama ini kita mengenal mesin fax untuk mengirim dan menerima fax. Tergantung merek dan tipenya, harga mesin fax dapat mencapai jutaan rupiah.

Ada beberapa kendala bila menggunakan mesin fax konvensional:1. Mesin harus rutin di maintenance agar dapat dioperasikan dengan lancar (kertas

tidak macet, hasil fax tetap jelas, dll).2. Dokumen harus di print dahulu bila ingin di fax, dan seringkali kiriman fax

tersebut kurang bagus.3. Hasil fax harus difoto-kopi dahulu bila ingin disimpan lama, sebab hasil fax akan

pudar bila terlalu lama disimpan.4. Perlu usaha khusus untuk mengarsip fax-fax yang dikirim dan masuk.5. Perlu personel khusus untuk mendistribusikan fax-fax yang masuk.

Oleh karenanya, kini banyak perusahan yang telah menerapkan solusi FaxServer, karena memberikan keunggulan-keunggulan berikut ini:

1. Tidak perlu maintenance khusus, karena menggunakan sebuah PC sebagai servernya.

2. Dokumen dapat langsung di fax ke tujuan tanpa harus di print dahulu. Hemat kertas, tinta, dan fax terkirim dengan kualitas seperti pada di layar komputer.

3. Fax yang masuk disimpan dalam bentuk file PDF di komputer, sehingga terjamin.4. Fax terkirim/diterima langsung tersimpan dalam folder-folder khusus dalam

bentuk file PDF.5. Fax yang masuk dapat secara otomatis dikirim melalui email.

Feature-feature Faxserver ini:1. Murni menggunakan software OpenSource.2. Cukup menggunakan PC dan fax modem external biasa.3. Multi user.

page 2 of 16

Page 3: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

4. Dapat mengunakan web based fax client ataupun windows client.5. Konfirmasi send/receive fax lewat email.

Hal-hal yang diperlukan:1. PC/Notebook yang telah terinstall Ubuntu 7.102. Modem External3. Mesin Fax untuk testing4. Koneksi internet / DVD Repo Ubuntu5. Semangat tinggi untuk belajar dan mencoba :)

Secara garis besar, langkah-langkahnya adalah:1. Install Ubuntu2. Pasang Modem3. Install dan setup Hylafax4. Install paket-paket Ubuntu yang dibutuhkan5. Install dan setup Avantfax6. Testing kirim/terima fax

Baiklah kita mulai, install Ubuntu seperti biasa. Pasang modem ke PC, sambungkan ke line telpon dan hidupkan.

Selanjutnya kita mulai install-install. Bisa menggunakan synaptic ataupun apt-get dari console, terserah sesuai kebiasaan kita. Di dalam panduan ini dicantumkan menggunakan apt-get.

A. Install dan Setup Hylafax

A1. Kita install Postfix dulu. Mengapa? Sebab kalau tidak hylafax akan menginstall pula Exim mailserver, kalau kita familiar sih tidak apa-apa.

(Tulisan-tulisan yang didahului oleh tanda '#' dan berhuruf tebal berarti adalah command yang harus kita ketik di console).

# apt-get install postfix

Setup saja postfix seperti biasa/default. Secara default postfix sudah dapat mengirim email.

A2. Install hylafax:# apt-get install hylafax-server

A3. Setup hylafax. Pertanyaan-pertanyaan sebagian besar dapat menggunakan nilai default saja (tekan enter saja), kecuali yang berkaitan dengan nomor telpon dan device

page 3 of 16

Page 4: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

modem. Modem kita biasanya akan terdeteksi sebagai /dev/ttyS0 (serial pertama), kecuali di contoh panduan ini, karena saya menggunakan modem virtual, maka modem saya adalah /dev/ttyx0 dan /dev/ttyx1:

# faxsetup

Setup program for HylaFAX (tm) 4.4.0.

Created for i686-pc-linux-gnu on Thu Aug 16 15:51:25 GMT 2007.

Reading cached parameters from /var/spool/hylafax/etc/setup.cache.

Found base64 encoder: /usr/bin/mimencodeFound Quoted-Printable encoder: /usr/bin/mimencode -qFound mimencode for compatibilty: /usr/bin/mimencodeChecking system for proper server configuration.

Warning: /etc/hylafax/getty-link does not exist or is not an executable program!

The file:

/etc/hylafax/getty-link

does not exist or this file is not an executable program. TheHylaFAX software optionally uses this program and the fact thatit does not exist on the system is not a fatal error. If theprogram resides in a different location and you do not want toinstall a symbolic link for /etc/hylafax/getty-link that points to your programthen you must reconfigure and rebuild HylaFAX from source code.

Warning: /etc/hylafax/vgetty-link does not exist or is not an executable program!

The file:

/etc/hylafax/vgetty-link

does not exist or this file is not an executable program. TheHylaFAX software optionally uses this program and the fact thatit does not exist on the system is not a fatal error. If theprogram resides in a different location and you do not want toinstall a symbolic link for /etc/hylafax/vgetty-link that points to your programthen you must reconfigure and rebuild HylaFAX from source code.

Warning: /etc/hylafax/egetty-link does not exist or is not an executable program!

The file:

/etc/hylafax/egetty-link

does not exist or this file is not an executable program. TheHylaFAX software optionally uses this program and the fact thatit does not exist on the system is not a fatal error. If theprogram resides in a different location and you do not want toinstall a symbolic link for /etc/hylafax/egetty-link that points to your programthen you must reconfigure and rebuild HylaFAX from source code.

Make /var/spool/hylafax/bin/ps2fax a link to /var/spool/hylafax/bin/ps2fax.gs.

page 4 of 16

Page 5: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

Make /var/spool/hylafax/bin/pdf2fax a link to /var/spool/hylafax/bin/pdf2fax.gs.

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 old protocol: no [4] Start paging protocol: noAre these ok [yes]?

Modem support functions written to /var/spool/hylafax/etc/setup.modem.Configuration parameters written to /var/spool/hylafax/etc/setup.cache.

Restarting HylaFAX server processes.Should I restart the HylaFAX server processes [yes]?

/etc/init.d/hylafax startNot starting HylaFAX daemons since they are already running.

You do not appear to have any modems configured for use. Modems areconfigured for use with HylaFAX with the faxaddmodem(8) command.Do you want to run faxaddmodem to configure a modem [yes]? Serial port that modem is connected to [ttyS0]? ttyx0Hmm, there does not appear to be an fuser command on your machine.This means that I am unable to ensure that all processes using themodem have been killed. I will keep going, but beware that you mayhave competition for the modem.

Ok, time to setup a configuration file for the modem. The manualpage config(5) may be useful during this process. Also be awarethat at any time you can safely interrupt this procedure.

Reading scheduler config file /var/spool/hylafax/etc/config.

No existing configuration, let's do this from scratch.

Country code [1]? Area code [415]? 021Phone number of fax modem [+1.999.555.1212]? 5551234Local identification string (for TSI/CIG) ["NothingSetup"]? UbuntuFaxLong distance dialing prefix [1]? International dialing prefix [011]? Dial string rules file (relative to /var/spool/hylafax) [etc/dialrules]? Tracing during normal server operation [1]? Tracing during send and receive sessions [11]? Protection mode for received facsimile [0600]? Protection mode for session logs [0600]? Protection mode for ttyx0 [0600]? Rings to wait before answering [1]? Modem speaker volume [off]? Command line arguments to getty program ["-h %l dx_%s"]? Pathname of TSI access control list file (relative to /var/spool/hylafax) [""]? Pathname of Caller-ID access control list file (relative to /var/spool/hylafax) [""]? Tag line font file (relative to /var/spool/hylafax) [etc/lutRS18.pcf]? Tag line format string ["From %%l|%c|Page %%P of %%T"]? Time before purging a stale UUCP lock file (secs) [30]? Hold UUCP lockfile during inbound data calls [Yes]? Hold UUCP lockfile during inbound voice calls [Yes]?

page 5 of 16

Page 6: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

Percent good lines to accept during copy quality checking [95]? Max consecutive bad lines to accept during copy quality checking [5]? Max number of pages to accept in a received facsimile [25]? Syslog facility name for ServerTracing messages [daemon]? Set UID to 0 to manipulate CLOCAL [""]? Use available priority job scheduling mechanism [""]?

Your facsimile phone number (5551234) does not agree with yourcountry code (1) or area code (021). The numbershould be a fully qualified international dialing number of the form:

+1 021 <local phone number>

Spaces, hyphens, and periods can be included for legibility. For example,

+1.021.555.1212

is a possible phone number (using your country and area codes).

The non-default server configuration parameters are:

CountryCode: 1AreaCode: 021FAXNumber: 5551234LongDistancePrefix: 1InternationalPrefix: 011DialStringRules: etc/dialrulesSessionTracing: 11RingsBeforeAnswer: 1SpeakerVolume: offGettyArgs: "-h %l dx_%s"LocalIdentifier: UbuntuFaxTagLineFont: etc/lutRS18.pcfTagLineFormat: "From %%l|%c|Page %%P of %%T"MaxRecvPages: 25

Are these ok [yes]?

Now we are going to probe the tty port to figure out the typeof modem that is attached. This takes a few seconds, so be patient.Note that if you do not have the modem cabled to the port, or themodem is turned off, this may hang (just go and cable up the modemor turn it on, or whatever).

Probing for best speed to talk to modem: 38400 OK.

About fax classes:

The difference between fax classes has to do with how HylaFAX interactswith the modem and the fax protocol features that are used when sendingor receiving faxes. One class isn't inherently better than another;however, one probably will suit a user's needs better than others. Class 1 relies on HylaFAX to perform the bulk of the fax protocol.Class 2 relies on the modem to perform the bulk of the fax protocol.Class 2.0 is similar to Class 2 but may include more features.Class 1.0 is similar to Class 1 but may add V.34-fax capability.Class 2.1 is similar to Class 2.0 but adds V.34-fax capability. HylaFAX generally will have more features when using Class 1/1.0 thanwhen using most modems' Class 2 or Class 2.0 implementations. Generallyany problems encountered in Class 1/1.0 can be resolved by modifications

page 6 of 16

Page 7: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

to HylaFAX, but usually any problems encountered in Class 2/2.0/2.1 willrequire the modem manufacturer to resolve it.

Use Class 1 unless you have a good reason not to.

Hmm, this looks like a Class 1 modem.Product code (ATI0) is "T38FAX".Other information (ATI3) is "Vyacheslav Frolov".DTE-DCE flow control scheme [default]? Modem manufacturer is "Vyacheslav Frolov".Modem model is "t38modem".

Using prototype configuration file t38modem...

The modem configuration parameters are:

ModemFlowControl: rtsctsModemRevQueryCmd: AT+FREV?

Are these ok [yes]?

Creating new configuration file /var/spool/hylafax/etc/config.ttyx0...Creating fifo /var/spool/hylafax/FIFO.ttyx0 for faxgetty... done.Done setting up the modem configuration.

Checking /var/spool/hylafax/etc/config for consistency......some parameters are different.

The non-default scheduler parameters are:

CountryCode: 1AreaCode: 021LongDistancePrefix: 1InternationalPrefix: 011DialStringRules: etc/dialrules

Are these ok [yes]?

Creating new configuration file /var/spool/hylafax/etc/config......saving current file as /var/spool/hylafax/etc/config.sav.

Don't forget to restart hylafax in order to run faxgetty on this new modemline.Updating /etc/hylafax/config from /var/spool/hylafax/etc/config.Creating /etc/hylafax/config.sav from /var/spool/hylafax/etc/config.sav.Creating /etc/hylafax/config.ttyx0 from /var/spool/hylafax/etc/config.ttyx0.Updating /etc/hylafax/setup.cache from /var/spool/hylafax/etc/setup.cache.Updating /etc/hylafax/setup.modem from /var/spool/hylafax/etc/setup.modem./var/spool/hylafax/config

A4. Cek modem sudah terdetect oleh hylafax:# /etc/init.d/hylafax restart * Stopping HylaFAX faxq [ OK ] * Starting HylaFAX faxq [ OK ]

# faxstat -a -sHylaFAX scheduler on voyager2: Running

page 7 of 16

Page 8: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

Modem ttyx0 (5551234): Running and idleModem ttyx1 (5554321): Running and idle

A5. Create Admin dan User. Hal ini diperlukan bila nanti kita akan menggunakan program fax dari network yang memerlukan login.

# faxadduser -a 123456 -p 123456 -u 100 admin (123456 adalah passwordnya)# faxadduser -u 101 userfax

B. Install dan Setup Paket-paket yang dibutuhkan

Cukup banyak paket-paket yang dibutuhkan dan ada beberapa paket yang memerlukan setup lebih lanjut.

B1. # apt-get install apache2 apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 libmagic-dev php5-gd php5-cli php5-mysql php5-common php-pear php5 php5-dev php-soap mysql-server imagemagick libtiff4 libtiff4-dev netpbm libungif4g a2ps

Ketika ditanya, berikan password untuk user root mysql.

B2. # pear install MDB2 mail mail_mime

B3. # pear install pear/MDB2#MySQL

B4. # pecl install fileinfo

B5. Restart Apache: # /etc/init.d/apache2 restart

page 8 of 16

Page 9: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

C. Install dan Setup AvantfaxC1. Download paket Avantfax terbaru dari http://www.avantfax.com

C2. Extract filenya dan setup:# tar zxf avantfax-3.0.2.tgz# cd avantfax-3.0.3# mv avantfax /var/www/

C3. Edit file setup.sh dan sesuaikan dengan kondisi Ubuntu kita:- Ubah baris chown apache.apache menjadi chown www-data.www-data

C4. Jalankan file setup.sh tersebut:# ./setup.shCreating AvantFAX databaseEnter MySQL root password: (if none, press ENTER)Enter password: Tables_in_avantfaxAddressBookAddressBookEmailAddressBookFAXDIDRouteDistroListFaxArchiveFaxCategoryModemsSysLogUserAccountUserPasswords

Pastikan tidak ada error. Bila ada, betulkan dan jalankan kembali.

C5. Masukkan cronjob ini ke crontab root:# crontab -e# runs once an hour to update the phone book0 * * * * /var/www/avantfax/includes/phb.php# runs once a day to remove old files0 0 * * * /var/www/avantfax/includes/remold.php

page 9 of 16

Page 10: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

C6. Setup Avantfax lewat Web interface. Hidupkan web browser dan buka http://localhost/avantfax/adminKita akan melihat layar login seperti ini (username standard: admin, passwordnya: password):

Pada pertama kali login ini kita akan diminta untuk segera mengganti password admin:

page 10 of 16

Page 11: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

Setelah login, kita akan melihat layar administration seperti ini:

Seperti dapat dilihat di gambar di atas, sepertinya ada bug di avantfax dimana user admin pertama kita tidak memiliki info apapun, oleh karena itu segeralah kita membuat user baru dengan mengklik menu New User. Berikan ia hak-hak administrasi. Tuliskan pula email accountnya ke user linux.

page 11 of 16

Page 12: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

Seperti terlihat dibawah ini jadinya:

Selanjutnya yang juga penting dan wajib adalah mensetup modem di Avantfax. Klik menu Configure Modems.

Bila modem kita adalah /dev/ttyS0, maka cukup dituliskan ttyS0. Disini karena modem saya /dev/ttyx0 dan /dev/ttyx1, maka saya menuliskannya ttyx0. Alias modem pilih identifikasi terserah kita saja, misalnya: modem1. Contact dikosongkan saja dulu.

page 12 of 16

Page 13: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

Bila sudah tersetel user dan modem, maka kita sudah bisa login dari layar depan Avantfax, yaitu: http://localhost/avantfax

page 13 of 16

Page 14: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

Selanjutnya silahkan dicoba kirim/terima fax. Bila sudah ada fax masuk, maka di Inbox Avantfax kita akan terlihat seperti ini:

D. TroubleshootingKita dapat memonitor proses kirim/terima fax dari /var/log/syslog. Dengan demikian kita bisa mengetahui apa kesalahan apa, misalnya busy tone, dll.

Seperti di bawah ini bila kita mengirim fax, akan terlihat:

D1. # tail -f /var/log/syslogJan 16 11:14:53 voyager2 FaxSend[4467]: MODEM VYACHESLAV FROLOV T38FAX/0.8.0Jan 16 11:14:54 voyager2 FaxSend[4467]: SEND FAX: JOB 10 DEST 0123 COMMID 000000032 DEVICE '/dev/ttyx0' FROM 'root <root@localhost>' USER adminJan 16 11:15:03 voyager2 FaxGetty[15482]: ANSWER: FAX CONNECTION DEVICE '/dev/ttyx1'Jan 16 11:15:17 voyager2 FaxGetty[4532]: RECV FAX (000000033): from UbuntuFax, page 1 in 0:14, INF, 3.85 line/mm, 2-D MMR, 14400 bit/sJan 16 11:15:18 voyager2 FaxSend[4467]: SEND FAX: JOB 10 SENT in 0:12Jan 16 11:15:32 voyager2 FaxGetty[4562]: RECV FAX (000000033): from UbuntuFax, page 2 in 0:13, INF,

page 14 of 16

Page 15: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

3.85 line/mm, 2-D MMR, 14400 bit/sJan 16 11:15:32 voyager2 FaxGetty[4563]: RECV FAX (000000033): recvq/fax000000008.tif from UbuntuFax, route to <unspecified>, 2 pages in 0:29Jan 16 11:15:32 voyager2 FaxSend[4467]: SEND FAX: JOB 10 SENT in 0:13Jan 16 11:15:34 voyager2 FaxGetty[15482]: RECV FAX: bin/faxrcvd.php "recvq/fax000000008.tif" "ttyx1" "000000033" ""

Setiap hari Avantfax juga akan mengirimkan summary penggunaan fax server kita ke email seperti ini:

From [email protected] Thu Mar 29 18:38:12 2007Date: Thu, 29 Mar 2007 18:38:11 +0700From: root <[email protected]>To: [email protected]: HylaFAX Usage Report

Facsimile transmitted since :

Sender Pages Time Pg/min Errs TypRate [email protected] (fajar) 1 0:29 2.1 0 9600 2-D MR---------------------------------------------------------------------------Total 1 0:29 2.1 0

Facsimile transmitted since last week:

Sender Pages Time Pg/min Errs TypRate [email protected] (fajar) 1 0:29 2.1 0 9600 2-D MR---------------------------------------------------------------------------Total 1 0:29 2.1 0

Facsimile received since :

Sender CIDName CIDNumber Pages Time Pg/min Errs TypRate TypData0218309747 6 4:39 1.3 0 9600 2-D MR------------------------------------------------------------------------------------------Total 6 4:39 1.3 0

Facsimile received since last week:

Sender CIDName CIDNumber Pages Time Pg/min Errs TypRate TypData0218309747 6 4:39 1.3 0 9600 2-D MR------------------------------------------------------------------------------------------Total 6 4:39 1.3 0

Report failed calls and associated session logs:

Nothing to purge in info directory.

Truncate merged session logs older than 730 days:

Nothing to purge in receive queue.

Nothing to purge in the tmp directory.

D2. Kemana lagi bila masih mengalami kesulitan? Yang paling tepat adalah dengan mengikuti mailing list hylafax di http://www.hylafax.org

page 15 of 16

Page 16: Panduan Setup Fax server (Hylafax) lengkap dengan Avantfax

http://linux2.arinet.org

Atau bisa juga menghubungi saya di [email protected], semoga saya bisa membantu.

E. PenutupDemikianlah panduan Faxserver dengan Hylafax dan Avantfax di Ubuntu. Masih banyak kekurangan dan mungkin saja ada cara yang lebih baik. Oleh karena itu silahkan kirimkan koreksi/kritik/saran kamu ke [email protected]. Dapat juga menghubungi saya lewat yahoo messenger di fajarpri

Jakarta, 16 January 2008-- Fajar Priyanto | Reg'd Linux User #327841 | Linux tutorial http://linux2.arinet.org14:52:43 up 7:10, 2.6.22-14-generic GNU/Linux Let's use OpenOffice. http://www.openoffice.orgThe real challenge of teaching is getting your students motivated to learn.

Semua hasil karya penulis di website http://linux2.arinet.org ini dilisensikan di bawah terms Creative Commons License.

Silahkan di klik link di atas untuk melihat secara detail, tapi secara singkat memiliki arti:Kamu bebas untuk:1. Mengcopy, mendistribusikan, dan mempraktekkannya2. Melakukan perubahan atas aslinya.

Namun dengan syarat:1. Kamu harus menyebutkan penulis aslinya.2. Tidak digunakan untuk keperluan komersial.3. Jika kamu melakukan perubahan apapun, atau melakukan pekerjaan atas dasar artikel disini, kamu harus JUGA menggunakan lisensi yang IDENTIK dengan lisensi disini.

Selamat belajar :)

page 16 of 16