前置準備:
先說明一下硬體方面的狀況:
一、一台CeleronD2.8G等級電腦 Ram:1G 、HD:40G,有Com Port的。
二、因為公司只剩外接式的數據機,因此主機不能找太新....,那找到的數據機型號是ZyXEL U-336S
作業系統方面:
使用的是Ubuntu Server 14.04 LTS X86版。
作業系統安裝我就不多說了。
手動設定網路:
編輯/etc/network/interfaces 這個檔案
sudo vi /etc/network/interfaces
加入以下的內容
# The Static network(這行其實是說明而已,可以自行打入內容)
auto eth0
iface eth0 inet static
address 192.168.x.x
netmask 255.255.255.x
network 192.168.x.0
broadcast 192.168.x.255
gateway 192.168.x.x
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 168.95.1.1
Modem判斷方法:
外接Modem:
網路上Google到的資料,是用一套叫wvdial的程式來判斷的。
安裝方式:
sudo apt-get install wvdial
安裝完後執行這個指令:
sudo wvdialconf /etc/wvdial.conf
它就會開始偵測你的Modem並把偵測到的資料寫入到/etc/wvdial.conf這個檔案裡。
再執行:
sudo gedit /etc/wvdial.conf -->主要是看偵測的modem設定
sudo wvdial
sudo chmod a+x /usr/sbin/pppd
內接Modem:
網路上Google到的資料,都會說可以用一個叫scanModem的程式來判斷你的內接Modem。
下載連結:
wget http://linmodems.technion.ac.il/packages/scanModem.gz
使用步驟:
一、解壓scanModem:gunzip scanModem.gz
二、執行指令:sudo chmod +x scanModem
三、執行指令:sudo ./scanModem
這時候會產生一個Modem的資料夾,進入之後可以看到一個叫ModemData.txt的文件,打開之後就是這個程式偵測到的Modem訊息
如果Modem已經設定好了,照之前在網路上查到的資料,接下來是用一套叫cu的程式去測試Modem是否ok。
安裝cu :
sudo apt-get install cu
安裝完成之後執行:
cu -l ttyS0
(此處要留意,是要輸入偵測到的Modem連接Port,因為我的是ComPort,所以是ttyS0)
如果有成功的話會出現如上圖的「Connected.」的訊息,再輸入這個指令:
at+fclass=?
就會出現一串數字,前面三個有出現0,1,2就可以了,代表的是Modem有支援Class0、1、2,這是HylaFax有支援的格式。
離開這個畫面就輸入:
~.
如果執行「cu -l ttyS0」之後有出現如下的錯誤訊息的話,可以這樣處理。
錯誤訊息:
cu: open (/dev/ttyS0): Permission denied
解決方法:
sudo chmod o+rw /dev/ttyS0
以上就是Modem的安裝測式,接下來就是到安裝HylaFax了。
HylaFax需要用到apache2、php5、mysql5,所以要安裝。
指令:
sudo apt-get install apache2 php5 mysql-server
安裝HylaFax。
指令:
sudo apt-get install hylafax-server hylafax-client
因為沒有要跟Mail結合,所以我選No configuration
安裝完之後,執行faxsetup設定hylafax的傳真設定。
指令:
sudo faxsetup
相關設定請參考以下資料:
Country code [1]?
電話國碼886(台灣)輸入886 enter
Area code []?
區碼(台北2)(就是02去掉0) 輸入2 enter
Long distance dialing prefix [1]?
長途碼 0 ,輸入0 Enter
International dialing prefix [011]?
國際電話前置碼002,輸入002 Enter
Dial string rules file (relative to /var/spool/hylafax)["etc/dialrules"]?
撥號規則檔設為/var/spool/hylafax/etc/dialrule,按enter
Tracing during normal server operation [1]?
啟動除錯選項按enter
Default tracing during send and receive session [0xfffffffff]?
收送傳真的除錯,我也不懂按enter吧
Continuation cover page (relative to /var/spool/hylafax) []?
設定封面的頁的所在目錄,enter
Timeout when converting PostScript documents (secs) [180]?
設定轉換為ps文件的逾時時間180秒,enter
Maximum number of concurrent jobs to a destination[1]?
最大同時傳送一個目的的工作數,當然是1了
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]
好像不使用了,按enter
Max number of pages to permit in an outbound job [0xffffffff]
外送傳真的最多頁數,enter
Syslog facility name for ServerTracing messages [daemon]?
相關於記錄檔是記錄在/var/log/messages中接著秀出你先前的設定問你要不要更改沒錯的話就按enter
Restarting Hylafax server process.
Should I restart the Hylafax server process [yes]?
要啟動hylafax了,按enter
You do not appear to have any modem configured for use. Modems are
ocnfigured for use with HylaFax with the faxaddmodem[8C] command.
Do you want to run faxaddmomdem to configure a modme [yes]?
你尚未指定任何數據機.現在是否要設定使用faxaddmodem命令(這個命令可以新增數據機),Enter
Serial port that modem is connected to []?
數據機的連接埠一般為ttyS0
country code[1]
886
Area code [415]?
(台北,基隆) 2
Phone number of fax modem [+1,9999.5555.1212]?
你數據機所接的電話號碼,+1是國碼(台灣+886)逗點後面就是區碼加電話號碼
Local Identifications string (for TS/CIG) ["NothingEtup"]?
傳真機的識別ID,一般使用電話號碼或是公司的英文縮寫不可太長 如 sony,當你傳真時顯示在對方傳真機LCD的字
Long distance dialing prefix [1]?
0
International dialing prefix [011]?
002
Dial string rules file (relative to /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 [0600]?
收到傳真的檔案權限,如果你要以samba開放目錄,讓使用者讀取請最好改為0644
Protection mode for session logs [0600]?
記錄檔的檔案權限
Protection mode for ttyS0 [0600]?
連接埠的存取權限
Rings to wait before answering [1]?
enter
Modem speaker volume [off]?
enter
Command line arguments to getty program ["-h %l dx_%s"]?
enter
Pathname of Tsi access control list file (relative to /var/spool/hylafax)[""]?
Tsi存取控制檔的目錄所在
Pathname of Caller-ID access control list file (relative to /var/spool/hylafax)[""]?
Caller-ID 存取控制檔的目錄所在
Tag line font file (relative to /var/spool/hylafax) [etc/lutRS18.pcf]?
所有的傳真最上面有一行包含了(送件人,收件人,日期,公司等)資料我們稱為tag line所使用的字型
Tag line form string ["From %%1|%c|Page %%P of %%T"]?
Tag line的格式
Time before purging a stale UUCP lock file (secs) [30]?
enter
Hold UUCP lockfile during inbound data calls [Yes]?
enter
Hold UUCP lockfile during inbound voice calls [Yes]?
enter
Percent good lines to accept during copy quality checking [95]?
enter
Max consecutive bad lines to accept during copy quality checking [5]?
enter
Max number of pages to accept in a received facsimile [25]?
(一次)傳真進來的最大可接收頁數
Syslog faxility name for ServerTracing messages [daemon]?
enter
Set UID to 0 to manipulate CLOCAL [""]?
enter
Use available proiority job scheduling mechanism [""]?
enter
Are these ok [yes]?
上述設定對不對
設定完之後,會偵測數據機,請選Class1,之後會再問:
Do you want to run faxaddmodem to configure another modem [yes]?
除非你主機上接了兩台以上的modem,不然請選no。
Should I run faxmodem for each configured modem [yse]?
enter
faxsetup指令的設定是參考下面這個連結的:
http://csc.ocean-pioneer.com/docum/csc_hylafax.html
安裝Avantfax。
我安裝時網路上最後的版本是3.3.3。
http://sourceforge.net/projects/avantfax/
http://www.avantfax.com/
解壓avantfax:
sudo tar zxvf avantfax-3.3.3.tgz
編輯 avantfax-3.3.3資料夾裡的debian-prefs.txt
sudo vi debian-prefs.txt
# DEFAULT INSTALL VALUES FOR Debian
#
# BEWARE: Only run the install script once or risk having duplicate
# settings in your sendmail, sudo, and other configuration files
#
# The debian-install.sh script refers to this file
#
# The domain name for configuring email to fax
FAXDOMAIN=fax.mydomain.com
# The installation directory for AvantFAX
INSTDIR=/var/www/avantfax
# The root directory where HylaFAX bin files are stored (typically, /usr or /usr/local)
HYLADIR=/usr
# HylaFAX $SPOOL directory (typically, /var/spool/hylafax or /var/spool/fax)
SPOOL=/var/spool/hylafax
# These are the database settings AvantFAX will create and use
USER=avantfax
PASS=d58fe49
DB=avantfax
# if the MySQL password for root is set, specify it here
ROOTMYSQLPWD=
這個地方輸入你Mysql的root密碼
# The user and group which Apache runs as (typically, apache, wwwrun, nobody, etc...)
HTTPDUSER=www-data
HTTPDGROUP=www-data
設定完之後,執行:
sudo sh debian-install.sh
修改/etc/apache2/sites-available/000-default.conf這個檔案
sudo vi /etc/apache2/sites-available/000-default.conf
將
DocumentRoot /var/www/html
修改成
DocumentRoot /var/www/avantfax
但是這樣作完網頁還是打不開,要再執行下面的動作。
Install MySQL package for MDB2:
sudo apt-get install php-mdb2-driver-mysql |
sudo apt-get install php-pear |
sudo pear install MDB2 |
sudo pear install MDB2_Driver_Mysql
備註:
除了apache2、php5、mysql之外,還可以裝一下phpmyadmin,會有幫助,因為avantfax可以下載資料庫備份,如果主機掛了,重建主機的話,就可以把備份的資料庫利用phpmyadmin把資料匯回。
HylaFax及Avantfax的安裝跟設定在網路上能找到很多文章,可以參考下面的連結:
http://blog.sina.com.cn/s/blog_4dda073c0101ac9q.html
http://a3.walkup.tw/?p=4616
沒有留言:
張貼留言