Wednesday, August 6, 2014

Install A2billing on Debian Squeezy


 A long time ago I performed my first A2billing setup. At that time I was totaly involved with Asterisk and find that Asterisk billing was very important to turn Asterisk in a more atractive product for sale.
 I remember that at that time I had no enough skill to setup A2billing from scratch. And at that time I could find someone that nicely helped me.
 In the times that follows I successfully deployed two A2billing and did it by my self. Actually, A2billing changes a little bit the way to administrate Asterisk as it controlls the system as a whole and not only tickets. You don´t need to edit extensions.conf or sip.conf anymore and this make me disaprove the software once all I wanted was setup Asteisk system through command line interface.
 I found and still find really sex to control a such complex system using commands. It is amazing how Asterisk allows you control and administrate a so sensible application using only a few piece of texts.
 Besides that, A2billing, just like any other Billing software, is very difficult to tune. We have a very complex sistem of charging phone calls and setup that in a Billing software is very very challanger. Personaly I never liked it, although I did for such a long time.
 I still believe that the best way to work with Asterisk is write your own customization. A good knowledge about Mysql, PHP and Linux can allow you setup a really good system with all the necessary tools.
 But, so far, all I am willing to do is try to setup someone else´s software and maybe I will do that as long as I stay in this area.
 So, today I decided go farther and setup a brand new A2billing in the server I am playing. And, as I like to do, I will  put here some information about this experiences.
 It is mandatory to have LAMP up and running in you system. If you don´t know about LAMP, take some time to seach and read some material about. It is very simple and necessary.
 After download A2billing software and put it in /usr/local/src/a2billing, unpack it. Make sure that A2billing don´t create another folder inside /a2billing. As you will see, the INSTALL.rst file refers to /usr/local/src/a2billing only and to have another folder can produce differente results for some commands.
 If it creates a new forder and sure it is, just copy and paste that folder´s file into a2billing folder. Like that,
 In my case, after unpack, the folder a2billing-master have been created. What I did is:
 cp -rf a2billing-master* /usr/local/src/a2billing/

 The final result must be:

root@debian:/usr/local/src/a2billing# ls -la
total 11620
drwxrwsrwx 13 root   staff     4096 Aug  6 06:26 .
drwxrwsr-x  3 root   staff     4096 Aug  6 05:14 ..
-rwxr-xr-x  1 root   staff     1571 Aug  6 06:26 a2billing.conf
-rw-r--r--  1 root   staff   140451 Aug  6 06:26 a2billing_dashboard.png
drwxrwxr-x 12 root   root      4096 Jul  3 03:14 a2billing-master
-rw-r--r--  1 flavio staff 11422927 Aug  6 05:19 a2billing-master.tar.gz
-rwxr-xr-x  1 root   staff     7631 Aug  6 06:25 a2billing_monitoring.php
-rwxr-xr-x  1 root   staff    80828 Aug  6 06:25 a2billing.php
drwxr-sr-x  9 root   staff     4096 Aug  6 06:26 addons
drwxr-sr-x  5 root   staff     4096 Aug  6 06:26 admin
drwxr-sr-x  4 root   staff     4096 Aug  6 06:26 agent
drwxr-sr-x  2 root   staff     4096 Aug  6 06:26 AGI
-rw-r--r--  1 root   staff     1912 Aug  6 06:26 AUTHORS
drwxr-sr-x  3 root   staff     4096 Aug  6 06:26 CallBack
-rw-r--r--  1 root   staff   112842 Aug  6 06:26 CHANGELOG
drwxr-sr-x  8 root   staff     4096 Aug  6 06:26 common
-rw-r--r--  1 root   staff    33652 Aug  6 06:26 COPYING
drwxr-sr-x  2 root   staff     4096 Aug  6 06:26 Cronjobs
drwxr-sr-x  7 root   staff     4096 Aug  6 06:26 customer
drwxr-sr-x  4 root   staff     4096 Aug  6 06:26 DataBase
-rw-r--r--  1 root   staff    18112 Aug  6 06:26 INSTALL.rst
-rw-r--r--  1 root   staff     1262 Aug  6 06:26 README.rst
-rw-r--r--  1 root   staff      544 Aug  6 06:26 REQUIREMENTS.rst
drwxr-sr-x  4 root   staff     4096 Aug  6 06:26 webservice

Ensure that you have all the necessary files and folders.

As you can see, between this files we have one very important and usefull : INSTALL.rst
There you can find all the information you need to have A2billing up and running.
Follow all the steps and instructions and you will be ready to go. Maybe the only extra command you will need is that:
 chown www-data:www-data /var/www/a2billing/admin/templates_c

In case of you try to access the A2billing web page and you get nothing but a big white page.
But, more important then that, take a close look at /var/log/apache2  folder. There you will find at least two important files: access.log  error.log.
 They are your friends. tail -f error.log can give you a very good ideia about what is going wrong inside.

And that´s it. This is the nessary to have A2billing up and running. I will take a close look at its configurations after going any father. It was a long time I  handled  it  and I dont remember too much.
 As soon as  I learn something interesting I will write another article:



 Sorry for any typo and/or mistakes. If you are native in English and/or have a expert skill on it, please feel free to correct me. That´s the only way I have to improve.
 Thanks a lot.



Tuesday, August 5, 2014

APT-GET UPDATE behind Proxy


 Hi there!  Again we are here bringing one more article for you folks and, this time, we will play a little bit with Linux. Debian Wheezy to be more specific.

Ultimately I am playing with Asterisk again. Asterisk has inspired me to write down this Blog and I never forgot how amazing Asterisk is. So, as soon as my projets gives me a bit of time, I decided to look around and see how things are going on Asterisk world.
 Therefore, after successfully installed my Debian, I got stuck in a problem:


This error repeat after a lot of configuration. First, I realized that the DNS was resolving to an IPv6 address, so, I decide to disable IPv6, then, I fell in the error above.
 The problem is, here within  the company network, we use proxy and that´s the problem. Despite the fact that my source list was all ok, I was unable to access any site on 80 port.
The solution applied was to configure a file at /etc/apt/apt.conf.d called ´02proxy with the following script:

Acquire {

HTTP::proxy "http://proxy.xxxxx.local:8080";

}


Everything is fine!!

That´s it. A very simple solution but also very usefull if you need to setup a Linux server behind a web proxy.
 I hope this was informing for you as it was for me!