MirrorNest
← Tutte le guide

ABillS

ABillS (AsmodeuS Billing System) is a mature, open-source ISP billing and subscriber-management platform for dialup, PPPoE/PPTP/L2TP, hotspot, VoIP and IPTV services, built around Perl, MySQL, and FreeRADIUS.

Sistema: Ubuntu (also FreeBSD, Debian, CentOS)ISP BillingRADIUSSito ufficiale ↗Documentazione ufficiale ↗
Questa guida è redatta a partire dalla documentazione ufficiale di ABillS, linkata sopra — verifica sempre lì i nomi esatti di pacchetti/versioni prima di eseguire questi comandi su un server di produzione, poiché le versioni della distribuzione e del progetto cambiano nel tempo.
  1. 1Two official install paths exist

    ABillS also ships an official automated installer (AInstall) that detects your OS and installs MySQL, Apache, and FreeRADIUS for you in one run. This guide covers the full manual install instead, since it's the one that actually shows every component being set up.

    wget https://github.com/nabat/AInstall/archive/master.tar.gz
    tar xvf master.tar.gz
    cd AInstall-master && ./install.sh

    If you'd rather not run every step by hand below, use this instead and skip to the login step at the end.

  2. 2Install prerequisites and add the Percona MySQL repository

    ABillS' own docs specifically use Percona Server 5.7, not stock MySQL/MariaDB.

    sudo apt install curl gnupg2 -y
    cd /tmp
    wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
    sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
    sudo apt update
  3. 3Install MySQL, Apache, and required libraries

    sudo apt-get install -yq percona-server-server-5.7 percona-server-client-5.7 libmysqlclient-dev apache2 apache2-utils libexpat1 ssl-cert
  4. 4Download and configure ABillS

    cd /usr
    wget https://sourceforge.net/projects/abills/files/abills/0.92/abills-0.92.05.tgz
    sudo tar zxvf abills-0.92.05.tgz
    sudo cp /usr/abills/libexec/config.pl.default /usr/abills/libexec/config.pl

    Check SourceForge for the current release number before downloading — 0.92.05 may be outdated by the time you read this. Edit config.pl afterward with your database credentials, admin email, domain, and a unique secret key.

  5. 5Create log directories and set permissions

    sudo mkdir -p /var/log/httpd/
    sudo mkdir -p /usr/abills/var/log
    sudo touch /usr/abills/var/log/abills.log
    sudo chown -Rf www-data:www-data /usr/abills/cgi-bin
    sudo chown -Rf www-data:www-data /usr/abills/Abills/templates
    sudo chown -Rf www-data:www-data /usr/abills/backup
    sudo touch /usr/abills/var/log/sql_errors
    sudo chown nobody /usr/abills/var/log/sql_errors
    sudo chmod 666 /usr/abills/var/log/sql_errors
  6. 6Configure Apache

    sudo cp /usr/abills/misc/apache/abills_httpd.conf /etc/apache2/sites-enabled/
    sudo /usr/abills/misc/certs_create.sh apache
    sudo a2enmod ssl
    sudo a2enmod rewrite
    sudo a2enmod suexec
    sudo a2enmod include
    sudo a2enmod cgi
    sudo /etc/init.d/apache2 restart
  7. 7Create the database and import the schema

    sudo mysql --default-character-set=utf8 -u root -p

    Inside the MySQL prompt: GRANT ALL ON abills.* TO `abills`@localhost IDENTIFIED BY "sqlpassword"; CREATE DATABASE abills DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; quit; Then import the schema: mysql --default-character-set=utf8 -u root -p -D abills < /usr/abills/db/abills.sql

  8. 8Install required Perl modules

    cd /usr/abills/misc/ && sudo perl perldeps.pl apt-get -batch
    sudo apt-get install -yq cpanminus aptitude

    The perldeps.pl script reports any modules it couldn't install automatically — install those individually with 'cpanm <ModuleName>'.

  9. 9Compile FreeRADIUS from source

    ABillS' own FreeRADIUS integration config targets a source build, not the distro's freeradius package.

    sudo aptitude install libmysqlclient-dev libgdbm-dev make gcc libtalloc-dev libperl-dev libhiredis-dev
    cd /tmp
    wget ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-3.0.25.tar.gz
    tar zxvf freeradius-server-3.0.25.tar.gz
    cd freeradius-server-3.0.25
    ./configure --prefix=/usr/local/freeradius --with-rlm-perl-lib-dir=/usr/lib/x86_64-linux-gnu/ --with-dhcp=yes --with-openssl=no
    make && sudo make install
    sudo ln -s /usr/local/freeradius/bin/* /usr/bin/
    sudo ln -s /usr/local/freeradius/sbin/* /usr/sbin/

    Check freeradius.org for the current 3.0.x release before downloading — 3.0.25 may be outdated by the time you read this.

  10. 10Install ABillS' own FreeRADIUS configuration

    This replaces the compiled default config with ABillS' matching sites/modules, and creates the freerad system user FreeRADIUS runs as.

    sudo rm /usr/local/freeradius/etc/raddb/sites-enabled/*
    sudo cp /usr/abills/misc/freeradius/v3/mods-enabled/perl /usr/local/freeradius/etc/raddb/mods-enabled/perl
    sudo cp /usr/abills/misc/freeradius/v3/mods-enabled/sql /usr/local/freeradius/etc/raddb/mods-enabled/sql
    sudo cp /usr/abills/misc/freeradius/v3/sites-enabled/abills_default /usr/local/freeradius/etc/raddb/sites-enabled/abills_default
    sudo cp /usr/abills/misc/freeradius/v3/sites-enabled/control-socket /usr/local/freeradius/etc/raddb/sites-enabled/control-socket
    sudo cp /usr/abills/misc/freeradius/v3/users /usr/local/freeradius/etc/raddb/users
    echo '' | sudo tee /usr/local/freeradius/etc/raddb/clients.conf
    sudo groupadd freerad
    sudo useradd -g freerad -s /bin/bash freerad
    sudo chown -R freerad:freerad /usr/local/freeradius/etc/raddb
    sudo mkdir /var/run/radiusd/
    sudo chown -R freerad:freerad /var/run/radiusd/

    Edit /usr/local/freeradius/etc/raddb/mods-enabled/sql with the same database credentials you set in config.pl.

  11. 11Start FreeRADIUS

    Run this first in debug mode to confirm it starts cleanly against your database, then stop it (Ctrl+C) and start it as a normal background service.

    sudo radiusd -X

    ABillS' docs describe creating an /etc/init.d/radiusd autostart script, then: chmod +x /etc/init.d/radiusd; update-rc.d radiusd defaults; update-rc.d radiusd enable; service radiusd start

  12. 12Add the billing cron jobs

    ABillS relies entirely on cron for billing runs and periodic maintenance — nothing charges customers or expires accounts without these.

    sudo touch /usr/abills/var/log/sql_errors && sudo chmod 666 /usr/abills/var/log/sql_errors

    Add to /etc/crontab: */5 * * * * root /usr/abills/libexec/billd -all 1 0 * * * root /usr/abills/libexec/periodic daily 1 1 * * * root /usr/abills/libexec/periodic monthly

  13. 13Log in

    ABillS serves its admin and subscriber-facing interfaces on a dedicated HTTPS port.

    Admin panel: https://your-server:9443/admin/ (default login abills / abills) — Subscriber portal: https://your-server:9443/ — change the default admin password immediately.