Ubuntu 16.04 Hylafax + Avantfax

Discussion in 'Installation/Configuration' started by Sheshman, Apr 17, 2017.

  1. Sheshman

    Sheshman New Member

  2. ahrasis

    ahrasis Active Member

    I did post that I managed to install and get them running in another thread. I am using Ubuntu 16.04 + Nginx. May I know what errors are you facing and at what steps?
     
  3. Sheshman

    Sheshman New Member

    after this command;
    apt-get install apache2-mpm-prefork apache2-utils apache2.2-common \
    libapache2-mod-php5 libapr1 libaprutil1 libpq4 libsqlite3-0 php5-cli php5-common \
    mysql-server imagemagick libtiff4-dev netpbm libnetpbm10-dev libungif-bin \
    libungif4-dev sudo postfix php-mail php-mail-mime php-file php-db php5-mysql \
    psutils wdiff

    i'm getting below error;
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Note, selecting 'giflib-tools' instead of 'libungif-bin'
    Package apache2.2-common is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    However the following packages replace it:
    apache2:i386 apache2

    Package libapache2-mod-php5 is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    Package libtiff4-dev is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    However the following packages replace it:
    libtiff5-dev:i386 libtiff5-dev

    Package php5-cli is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    However the following packages replace it:
    php7.0-cli:i386 php7.0-cli

    Package php5-common is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    Package php5-mysql is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    Package apache2-mpm-prefork is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'apache2-mpm-prefork' has no installation candidate
    E: Package 'apache2.2-common' has no installation candidate
    E: Package 'libapache2-mod-php5' has no installation candidate
    E: Unable to locate package libpq4
    E: Package 'php5-cli' has no installation candidate
    E: Package 'php5-common' has no installation candidate
    E: Package 'libtiff4-dev' has no installation candidate
    E: Unable to locate package libungif4-dev
    E: Unable to locate package php-file
    E: Package 'php5-mysql' has no installation candidate
     
  4. ahrasis

    ahrasis Active Member

    Ubuntu 16.04 is using php7.0. You must change that accordingly. If you are using apache2.4 make sure your apt install is referring to the same version.
     
  5. Sheshman

    Sheshman New Member

    real problem is,i'm very rookie about linux and trying to learn with articles :) As far as i understand that article is really old (2007) and packages has been upgraded or changed since, i really don't know how to find correct packages.

    I'm managing to install hylafax without any problem, i'm having trouble to install avantfax, do you have any step by step guide to install avantfax with nginx as you did ?
     
  6. ahrasis

    ahrasis Active Member

    Are you using Nginx? If you do, I can try to recall and post the steps in here later. I cannot write for apache since I haven't tested them in apache. And I didn't wrote them earlier as I don't think anybody would want this guide.
     
  7. Sheshman

    Sheshman New Member

    nope i don't use nginx but i can install, if you can post the steps for nginx i'll be appreciated, i really need to figure it out that fax thing.
     
  8. ahrasis

    ahrasis Active Member

    I think you better not do that. You should either use apache or nginx but not both. You can simply extend your minimal server or perfect server setup to use hylafax + avantfax if you've already built one.
     
  9. Sheshman

    Sheshman New Member

    i think i explained wrong :) I have fresh installed and fully updated ubuntu 16.04 and latest version of hylafax, i didn't installed apache or nginx yet, i'm just trying to figure it out how i can install avantfax with full necessary packages on Ubuntu 16.04.
     
  10. ahrasis

    ahrasis Active Member

    Are you going to use this as public webserver as well or just for personal use? If for personal use, I would suggest some third party install as well (i.e. ondrej ppa to enable multiple php in Ubuntu 16.04), to help you ease your installation because AvantFax is not yet compatible with php7 and above. Ubuntu 16.04 comes with php7.
     
  11. Sheshman

    Sheshman New Member

    ok here is what i'm trying to do, in my country fax still one of the popular communication way, windows fax server's licences are very expensive in here,i'm going to use hylafax+avantfax for my company, my target is receiving and sending faxes via hylafax on 1 analog fax line.
    Web gui will be open on secretary's computer all day and she will forward received faxes to related workers or she will send faxes via hylafax, she is using windows 7. I've tried to find some windows clients for hylafax but i couldn't find an easy one, and unfortunatelly our secretary not that smart to use those clients and also she doesn't know english (all clients in english.)

    I've installed hylafax and it works without any problem i can send and receive faxes via ssh terminal, what i'm looking for is an easy webgui or windows client is hylafax, as far as i know avantfax supports multi-language or i can edit php files of avantfax and translate them.
     
  12. ahrasis

    ahrasis Active Member

    May I suggest you look at this. It is YajHFC (Yet another Java HylaFAX client) - a client for the HylaFAX fax server written completely in Java. If you like you can download the latest package in here. There is also a link for translation there which you can help adding if yours is not available or finished yet.
     
  13. Sheshman

    Sheshman New Member

    i've allready tried that,even imported windows phonebook to it but that genious woman said it's really hard to use for her :( so still searching.
     
  14. ahrasis

    ahrasis Active Member

    Well, AvantFax is not so easy to use either but you can try. And since I don't have time to write a full guide, this is the general idea of it that I hope will work for you:

    1. Basically I already have an ISPC Ubuntu 16.04 Nginx server which you can build by following this tutorial.

    2. Since you already has HylaFax working, there is nothing you can do more with it except as required to make AvantFax working, if any.

    3. Install Ondrej PPA and php5.6:
    Code:
    sudo su
    add-apt-repository ppa:ondrej/php
    apt update && apt -y upgrade
    apt install php5.6 php5.6-common php5.6-gd php5.6-mysql php5.6-imap php5.6-cli php5.6-cgi php-pear php-auth php5.6-mcrypt mcrypt php5.6-imagick imagemagick  libruby php5.6-curl php5.6-intl php5.6-memcache php5.6-memcached php5.6-ps php5.6-pspell php5.6-recode php5.6-snmp php5.6-sqlite php5.6-tidy php5.6-xmlrpc php5.6-xsl memcached snmp php5.6-mbstring php-mbstring php-gettext postgrey php5.6-fpm
    

    4. Download AvantFax 3.3.5:
    Code:
    cd /tmp
    wget -O avantfax https://sourceforge.net/projects/avantfax/files/avantfax-3.3.5.tgz/download
    tar zvxf avantfax
    cd avantfax-3.3.5
    wget -O ubuntu-install.sh https://raw.githubusercontent.com/ahrasis/avantfax/master/debian-install.sh
    nano debian-prefs.txt
    

    5. The last part of the above script opens debian-prefs.txt which you should enter your root mysql password at ROOTMYSQLPWD= and then save it.

    6. Chmod the downloaded script and then run it.
    Code:
    chmod u+x ubuntu-install.sh
    ./ubuntu-install.sh
    

    7. Add these code (inside the downloaded script comment) to your ispconfig.vhost:
    Code:
            location /avantfax {
                    root /var/www/;
                    index index.php index.html index.htm;
                    location ~ ^/avantfax/(.+\.php)$ {
                            try_files $uri =404;
                            root /var/www/;
                            # include /etc/nginx/fastcgi_params;
                            fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
                            fastcgi_param HTTPS $fastcgi_https; # <-- add this line fastcgi_paramHTTPS on;
                            fastcgi_index index.php;
                            fastcgi_param SCRIPT_FILENAME $request_filename;
                            include /etc/nginx/fastcgi_params;
                            fastcgi_param PATH_INFO $fastcgi_script_name; # <-- disabled if causing access problem
                            fastcgi_buffer_size 128k;
                            fastcgi_buffers 256 4k;
                            fastcgi_busy_buffers_size 256k;
                            fastcgi_temp_file_write_size 256k;
                            fastcgi_intercept_errors on;
                    }
                    location ~* ^/avantfax/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                            root /var/www/;
                    }
            }
            location /fax {
                    rewrite ^/* /avantfax last;
    

    8. If nothing is missed, you should be able to open your AvantFax at the stated website (yourservername:8080/avantfax) with the username - admin and password - password.

    Good luck!
     
    Last edited: Apr 27, 2017
  15. Sheshman

    Sheshman New Member

    i'll try and will keep you informed.
     
    ahrasis likes this.
  16. Sheshman

    Sheshman New Member

    i've followed your instructions and now it works like a charm,thanks and may Allah bless you.
     
    ahrasis likes this.
  17. ahrasis

    ahrasis Active Member

    Thank you for updating. It's good to know that it is working.
     
  18. Linux_Newbie

    Linux_Newbie New Member

    Ahrasis,
    I am an Ubuntu newbie and doesn't have programming knowledge. I can read and follow directions very well. I followed ALL direction on Avantfax install and did not have errors during installation. I am stuck on Step 7 above and I just can't figure out where to find the below code so I can modify as instructed.
    location /avantfax {
    root /var/www/;
    index index.php index.html index.htm;
    location ~ ^/avantfax/(.+\.php)$ {
    try_files $uri =404;
    root /var/www/;
    # include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
    fastcgi_param HTTPS $fastcgi_https; # <-- add this line fastcgi_paramHTTPS on;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    include /etc/nginx/fastcgi_params;
    fastcgi_param PATH_INFO $fastcgi_script_name; # <-- disabled if causing access problem
    fastcgi_buffer_size 128k;
    fastcgi_buffers 256 4k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;
    fastcgi_intercept_errors on;
    }
    location ~* ^/avantfax/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
    root /var/www/;
    }
    }
    location /fax {
    rewrite ^/* /avantfax last;​
    I tried to launch Avantfax from (yourservername:8080/avantfax) but it is giving me error 404. Can you help please?
    I followed this post as well for my server https://www.howtoforge.com/tutorial/perfect-server-ubuntu-with-nginx-and-ispconfig-3/2/
    The Hylafax is installed and working fine.

    Thank you.
     
  19. ahrasis

    ahrasis Active Member

    You don't modify it. Just add it to ispc vhost inside server {} for usage with port 8080 or its app vhost for usage with port 8081. The files should be in /etc/nginx/sites-available/ folder.
     
  20. Linux_Newbie

    Linux_Newbie New Member

    Thank you with your help. I found etc/nginx/site-available/ folder and able to append the above code. Here is the screenshot. But I still can't log-in to Avant. What am i doing wrong?
    OS Ubuntu 16.04.02 TLS
    upload_2017-6-30_22-12-37.png

    upload_2017-6-30_22-27-30.png

    upload_2017-6-30_22-13-45.png
     

Share This Page