Agora vamos preparar o ambiente para que o
Hylafax possa ser acessado via web com o
AvantFax. Instale os seguinte pacotes e siga os passos:
# apt-get install apache2-mpm-prefork apache2-utils apache2.2-common
# apt-get install libapache2-mod-php5 libapr1 libaprutil1 libpq4 libsqlite3-0 php5-cli php5-common
# apt-get install mysql-server imagemagick libtiff4-dev netpbm libnetpbm10-dev libungif-bin
# apt-get install libungif4-dev sudo postfix php-mail php-mail-mime php-file php-db php5-mysql
# apt-get installpsutils wdiff
# cd /usr/src
# wget http://easynews.dl.sourceforge.net/sourceforge/avantfax/avantfax-2.3.0.tgz
# tar zvxf avantfax-2.3.0.tgz
# cd avantfax-2.3.0
Mova o AvantFax para o acesso web e dê permissão:
# mv /usr/src/avantfax-2.3.0/avantfax /var/www/
# chmod -R 777 /var/www/avantfax/tmp /var/www/avantfax/faxes
Renomeie o arquivo original
faxrcvd e siga os passos:
# cd /var/spool/hylafax/bin
# mv faxrcvd faxrcvd.old
# mv notify notify.old
# ln -s /var/www/avantfax/includes/faxrcvd.php /var/spool/hylafax/bin/faxrcvd
# ln -s /var/www/avantfax/includes/notify.php /var/spool/hylafax/bin/notify
# mv /usr/bin/faxcover /usr/bin/faxcover.old
# ln -s /var/www/avantfax/includes/faxcover.php /usr/bin/faxcover
Edite create_tables.sql para usar as tabelas no AvantFax:
# vi create_tables.sql
Adicione "USE avantfax;" no topo do arquivo editado acima.
Edite setup.sh para o dono "root.root":
# vi setup.sh
Mude apache.apache para "root.root".
Rode o script setup:
# ./setup.sh
Adicione dois scripts no root do crontab:
# crontab -e
# 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/remold.php
Mude suas configurações do Apache:
# vi /etc/apache2/sites-enabled/000-default
Apague tudo e cole isto dentro do arquivo:
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/avantfax
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/avantfax>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /phpmyadmin "/usr/share/phpmyadmin/"
<Directory "/usr/share/phpmyadmin/">
Options Indexes MultiViews FollowSymLinks
</Directory>
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Reinicie o Apache:
# /etc/init.d/apache2 restart