Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th December 2009, 09:54
letsharehowto letsharehowto is offline
Junior Member
 
Join Date: Dec 2009
Location: Sai gon - Viet Nam
Posts: 12
Thanks: 0
Thanked 12 Times in 8 Posts
Default Fax server with Ubuntu server 9.10, Conexant drivers, Hylafax and Avantfax

Today I tell you how to install, config box which can received fax, send fax, remind you when fax coming via email, forward fax via email (look like fax2email) with Ubuntu server 9.10, Conexant drivers, Hylafax and Avantfax.

I don't know how box run and please don't ask me why and why :-)
My english no good, so sorry.

My hardware:
-Cheap desktop: Compaq Evo D510 Desktop Computer - Intel Pentium 4 2.4GHz, 512MB DDR, 40GB HDD, CD-ROM, Windows XP Home (http://www.tigerdirect.com/applicati...098&CatId=2628)
-Two cheap HSF fax modem: D-LINK DFM-562IS (http://www.vitinhphongvu.com/index.p...uctone&sp=1937)
-I'm working in Viet Nam. My ISP: VNN

When I try Ubuntu server 9.04, box send fax good but when box received fax: first fax received good, second fax can not received because modem fax do not turn on auto answer. Modem ring ring and ring...

I try Postfix, Postfix don't work. I use Sendmail, Sendmail work good. I don't need config any more, only type: apt-get install sendmail. Thats'it.

We have three steps:
-Step one: Setup Ubuntu server 9.10.
-Step two: Config HSF fax modem and install Hylafax.
-Step three: Install Avantfax.

Step one: Setup Ubuntu server 9.10:
^^^^^^^^

Connect internet.
Setup box with Ubuntu server 9.10. If you don't know how, you can google.

Note:

-If you don't want Ubuntu Startup slows down at Starting Mail Transport Agent (MTA) sendmail you have to choose long hostname. Example: "tom.localdomain". If you choose short name: "tom", box boot up, box Forward fax via email and box remind you when fax come is very slow.
-Software selection: LAMP Server and OpenSSH Server
-Password for the MYSQL "root" user: 111111

Step two: Config HSF fax modem and install Hylafax:
^^^^^^^^

Set root password. Code:

sudo passwd root
exit

Logon with root and latter do everything with root too.
Set static IP. Code:

nano /etc/network/interfaces

Replace the iface eth0 inet dhcp with this:

###Begin###############################

iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

###End################################

Reset connection. Code:

ifdown eth0 && ifup eth0

Upgrade box. Code:

apt-get update
apt-get upgrade

You have to reboot box. Code:

reboot

Logon root, install sendmail and some software. Code:

apt-get install mc gcc make unzip sendmail

Find kernel version. Code:

uname -r

My case: 2.6.31-14-generic-pae. I search and download ALSA driver from http://www.linuxant.com/alsa-driver/...ubuntu-x86.php. Code:

wget http://www.linuxant.com/alsa-driver/...u_i386.deb.zip

Unzip file. Code:

unzip alsa-driver-linuxant_1.0.20.3_k2.6.31_14_generic_pae_ubuntu_i3 86.deb.zip

Install file. Code:

dpkg -i alsa-driver-linuxant_1.0.20.3_k2.6.31_14_generic_pae_ubuntu_i3 86.deb

Remove file. Code:

rm *.deb

Follow website https://help.ubuntu.com/community/Di...Howto/Conexant, I download. Code:

wget http://www.bargweb.net/images/2009/n...acoEdition.zip

Unzip file. Code:

unzip hsfmodem-7.80.02.05-DiacoEdition.zip

Install. Code:

cd hsfmodem-7.80.02.05-DiacoEdition
make install

Run hsfconfig (I choose default all of them). Code:

hsfconfig

Remove file. Code:

cd
rm *.zip

Install Hylafax. Code:

apt-get install hylafax-server

I have two fax modem cards. The first one I use ttySHSF0, class 1.0. Second one: ttySHSF1, class 1.0. When setup finish first one, box ask me want config another one, I say yes, second one I say no. I keep default allmost. Fax setup. Code:

faxsetup

Reboot box. Code:

reboot

Step three: Install Avantfax.
^^^^^^^^^^

Logon root. Check modem work or not. Code:

faxstat -a -s

If modem work, box say:

root@tom:~# faxstat -a -s
HylaFAX scheduler on tom.localdomain: Running
Modem ttySHSF0 (+1.999.555.1212): Running and idle
Modem ttySHSF1 (+1.999.555.1212): Running and idle

Install some software for Avantfax. Code:

apt-get install apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 libapr1 libaprutil1 libsqlite3-0 php5-cli php5-common mysql-server imagemagick libtiff4-dev netpbm libnetpbm10-dev libungif-bin libungif4-dev sudo php-mail php-mail-mime php-file php-db php5-mysql psutils wdiff expect rsync php5-dev libmagic-dev php5-cgi

Install fileinfo. Code:

pecl install fileinfo
pear install Mail Net_SMTP Mail_mime MDB2_driver_mysql fileinfo

Download Avantfax from http://www.avantfax.com. Code:

wget http://downloads.sourceforge.net/ava...se_mirror=osdn

Unzip file. Code:

tar -xf avantfax-3.1.6.tgz

Change something file debian-install.sh. Code:

cd avantfax-3.1.6
nano debian-install.sh

Delete everything then replace with:


###Begin########################################## #################

FAXDOMAIN=fax.mydomain.com
INSTDIR=/var/www/avantfax
HYLADIR=/usr/sbin
SPOOL=/var/spool/hylafax
USER=avantfax
PASS=d58fe49
DB=avantfax
HTTPDUSER=www-data
HTTPDGROUP=www-data

#!/bin/sh
#
# AvantFAX install script for Debian
# This script will configure /etc/sudoers and the HylaFAX hyla.conf, config, config.<devid> files
# Only run once
#

# CHECK IF HYLAFAX IS INSTALLED

echo "Checking for HylaFAX installation"

hyla=`which sendfax`
if [ "$?" -ne "0" ]; then
echo You must install and configure HylaFAX first
exit
fi

. ./debian-prefs.txt


## SETUP SMARTY
chmod 0770 avantfax/includes/templates/admin_theme/templates_c/ avantfax/includes/templates/admin_theme/cache/ avantfax/includes/templates/main_theme/templates_c/ avantfax/includes/templates/main_theme/cache/
chown $HTTPDUSER:$HTTPDGROUP avantfax/includes/templates/admin_theme/templates_c/ avantfax/includes/templates/admin_theme/cache/ avantfax/includes/templates/main_theme/templates_c/ avantfax/includes/templates/main_theme/cache/

chmod 0755 avantfax/includes/faxcover.php avantfax/includes/faxrcvd.php avantfax/includes/notify.php avantfax/tools/update_contacts.php avantfax/tools/faxcover.php avantfax/includes/avantfaxcron.php avantfax/includes/dynconf.php

cp avantfax/includes/local_config-example.php avantfax/includes/local_config.php


# echo "AdminGroup: apache" >> /etc/hylafax/hfaxd.conf

# SETUP AVANTFAX JOBFMT

cat >> /etc/hylafax/hyla.conf << EOF

#
## JobFmt for AvantFAX
#
JobFmt: "%-3j %3i %1a %15o %40M %-12.12e %5P %5D %7z %.25s"

EOF

# INSTALL AVANTFAX

mv avantfax $INSTDIR
chown -R $HTTPDUSER.$HTTPDGROUP $INSTDIR
chmod -R 0770 $INSTDIR/tmp $INSTDIR/faxes
chown -R $HTTPDUSER.uucp $INSTDIR/tmp $INSTDIR/faxes


# IMPORT MYSQL DATABASE

/etc/init.d/mysql start

echo "## Creating AvantFAX MySQL database ##"
mysql --user=root --password=111111 -e "GRANT ALL ON $DB.* TO $USER@localhost IDENTIFIED BY \"$PASS\"" mysql
mysqladmin --default-character-set=utf8 --user=$USER --password=$PASS create $DB
mysql --user=$USER --password=$PASS $DB < create_tables.sql
mysqlshow --user=$USER --password=$PASS $DB

# SYMLINK AVANTFAX SCRIPTS

ln -s $INSTDIR/includes/faxrcvd.php $SPOOL/bin/faxrcvd.php
ln -s $INSTDIR/includes/dynconf.php $SPOOL/bin/dynconf.php
ln -s $INSTDIR/includes/notify.php $SPOOL/bin/notify.php

mv $HYLADIR/bin/faxcover $HYLADIR/bin/faxcover.old
ln -s $INSTDIR/includes/faxcover.php $HYLADIR/bin/faxcover

# FIX FILEINFO

ln -s /usr/share/file/magic* /usr/share/misc/

# SETUP SUDO PERMISSIONS

echo "Setting up sudo"

cat /etc/sudoers | grep -v requiretty > /tmp/sudoers
echo "$HTTPDUSER ALL= NOPASSWD: /sbin/reboot, /sbin/halt, /usr/sbin/faxdeluser, /usr/sbin/faxadduser -u * -p * *" >> /tmp/sudoers
mv /etc/sudoers /etc/sudoers.orig
mv /tmp/sudoers /etc/sudoers
chmod 0440 /etc/sudoers
chown root.root /etc/sudoers

# Make backup of HylaFAX configuration

mkdir /etc/hylafax/abackup
cp /etc/hylafax/config* /etc/hylafax/abackup/

# CONFIGURE MODEMS TO USE AVANTFAX

for i in `ls /etc/hylafax/config.*`; do
if [ "$i" != "/etc/hylafax/config.sav" ]; then
if [ "$i" != "/etc/hylafax/config.devid" ]; then
tilde=`echo $i | grep '~'`
if [ "$?" -eq "1" ]; then
if [ ! -L $i ]; then
cat >> $i << EOF

#
## AvantFAX
#
FaxRcvdCmd: bin/faxrcvd.php
DynamicConfig: bin/dynconf.php
UseJobTSI: true

EOF
fi
fi
fi
fi
done

cat >> /etc/hylafax/config << EOF

#
## AvantFAX
#
NotifyCmd: bin/notify.php

EOF

# ADD MODEMS TO DATABASE

for i in `ls /etc/hylafax/config.*`; do
if [ "$i" != "/etc/hylafax/config.sav" ]; then
if [ "$i" != "/etc/hylafax/config.devid" ]; then
tilde=`echo $i | grep '~'`
if [ "$?" -eq "1" ]; then
if [ -f $i ]; then
modem=`echo $i | awk -F'/' '{print $6}' | awk -F'.' '{print $2}'`

# ADD MODEMS TO AVANTFAX DATABASE
mysql --user=$USER --password=$PASS -e "INSERT INTO Modems SET device='$modem', alias ='$modem'" $DB

echo "Configuring $modem for AvantFAX"
fi
fi
fi
fi
done

# ADD CRONTAB ENTRIES

echo "Setting up /etc/cron.d/avantfax"
printf "0 0 * * *\t$INSTDIR/includes/avantfaxcron.php -t 2\n" > /etc/cron.d/avantfax

echo -e "Installation complete\n\n"

IP=`/sbin/ifconfig eth0 | grep "inet addr" | awk -F' ' '{print $2}' | awk -F':' '{print $2}'`

echo -e "Log into the Administrative interface at: http://$IP/admin/"
echo -e "Username: admin\nPassword: password"
# DONE #

###End############################################ ############

Install Avantfax. Code:

./debian-install.sh

Change /etc/apache2/sites-enabled/000-default. Code:

nano /etc/apache2/sites-enabled/000-default

Replace: DocumentRoot /var/www by: DocumentRoot /var/www/avantfax
Replace: <Directory /var/www/> by: <Directory /var/www/avantfax/>

Save file and quit

Change crontab. Code:

crontab -e

Add these line at bottom:

###Begin########################################

# runs once an hour to update the phone book
0 * * * * /var/www/avantfax/includes/phb.php
# runs once a day to remove old files
0 0 * * * /var/www/avantfax/includes/avantfaxcron.php -t 2

###End#########################################

Save file and quit

Reboot box. Code:

reboot

Logon root and setup hylafax users. Code:

/usr/sbin/faxadduser -f newhosts -a pwd www-data
/usr/sbin/faxdeluser localhost
/usr/sbin/faxdeluser 127.0.0.1
echo 127.0.0.1 >> newhosts
echo localhost >> newhosts
cat /etc/hylafax/hosts.hfaxd >> newhosts
cat newhosts > /etc/hylafax/hosts.hfaxd
rm -f newhosts

Reboot box. Code:

reboot

Now you can access fax server: http://192.168.1.10/admin
First time you have to change admin's password, then create Categories, create Modem (Example fax modem 1: Device*: ttySHSF0, Alias*: sale, Contact: abc@gmail.com, Category: Category1. Example fax modem 2: Device*: ttySHSF1, Alias*: support, Contact: def@gmail.com, Category: Category2).
Return dashboard if you see after sale and support say [Please wait], you get back server, logon root and run some code again (I don't know why):


/usr/sbin/faxadduser -f newhosts -a pwd www-data
/usr/sbin/faxdeluser localhost
/usr/sbin/faxdeluser 127.0.0.1
echo 127.0.0.1 >> newhosts
echo localhost >> newhosts
cat /etc/hylafax/hosts.hfaxd >> newhosts
cat newhosts > /etc/hylafax/hosts.hfaxd
rm -f newhosts

Get back web brownser, reload page, if you see after sale and support say [Idle] with blue color => good. Now you can send, recived fax and send fax via email

Thanks:
http://ubuntu.com
http://www.hylafax.org
http://www.avantfax.com
https://help.ubuntu.com/community/Di...Howto/Conexant
http://www.linuxant.com/alsa-driver/...ubuntu-x86.php
http://www.howtoforge.com/build-a-hy...on-debian-etch
http://www.zyxware.com/articles/641/...t-mta-sendmail
And thank you http://www.howtoforge.com very much. I learn alot from you.
Reply With Quote
The Following User Says Thank You to letsharehowto For This Useful Post:
falko (18th December 2009)
Sponsored Links
  #2  
Old 9th January 2010, 07:04
letsharehowto letsharehowto is offline
Junior Member
 
Join Date: Dec 2009
Location: Sai gon - Viet Nam
Posts: 12
Thanks: 0
Thanked 12 Times in 8 Posts
Default

Note:
When you run hsfconfig, hsfconfig ask you Please enter region name for modem unit 0, you choose USA. In my case, when I choose VIETNAM, fax modem card only answer fax on first call, the second call, fax modem only ring, don`t answer fax.
Do not install on cloud box, ex: vmware
Reply With Quote
The Following User Says Thank You to letsharehowto For This Useful Post:
falko (10th January 2010)
  #3  
Old 4th April 2010, 20:51
xiaoanri xiaoanri is offline
Junior Member
 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default email not working

thanks so much for the tutorial, i followed the instructions step by step, the server was set up and we are able to send and receive faxes without problem---well there is one problem: the email function is not working, we can send and receive faxes on the avantfax web page only. any ideas?
Reply With Quote
  #4  
Old 16th April 2010, 22:11
jongerard jongerard is offline
Junior Member
 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by xiaoanri View Post
thanks so much for the tutorial, i followed the instructions step by step, the server was set up and we are able to send and receive faxes without problem---well there is one problem: the email function is not working, we can send and receive rapidfax/ metrofax on the avantfax web page only. any ideas?


I've had the similar problem... any suggestions, anyone???
__________________
Fondly,
JG
Reply With Quote
The Following User Says Thank You to jongerard For This Useful Post:
Onn (5th August 2010)
  #5  
Old 3rd July 2011, 14:40
muneer26 muneer26 is offline
Junior Member
 
Join Date: Jun 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default Avant Fax

Can anybody tellme how to install Avant Fax on Centos Please help me Step by step because i dont know anything on Avant Fax
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
question about hylafax server with avantfax ichitakakin HOWTO-Related Questions 1 16th March 2008 14:13


All times are GMT +2. The time now is 08:29.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.