Installation instruction for Trabas VoIP Billing (voip-billing) $Id: INSTALL,v 1.7 2002/07/08 09:55:57 hasant Exp $ This file explains how to install, configure and prepare voip-billing step by step. While the process may be cumbersome, I believe someday we will have a way to automate this. And as you get here, I assume you alread read the README file and understand the file structure. There are two explanations on the installation procedure. The first is the short version as explained in the section QUICK VERSION. It's meant to be summary and reminder, although it will just work fine to follow. However, if this is the first time you install voip-billing, it's highly encouraged to follow the detail procedure as explained in the section THE FULL STEPS. There are some little things need your attention. Either way, please take a closer look at section REQUIREMENT. Please make sure your system has all the required items installed. *REQUIREMENT* A working Linux box (isn't it strange?). Apache Web Server version 1.3.12 Of course you can use higher version. The version above only notes that it works with that old version. We're not ready for 2.0 yet. RDBMS Tested with MySQL and Oracle. But this version only provides connectivity to MySQL. It's trivial to make it works with other RDBMS. Perl 5.6.1 No tested with older version. Perl modules We need a number of Perl modules but listed here are only those not included in standard distribution. HTML::Template DBI DBD::* (depends on your RDBMS) Apache::Session Storable Time::HiRes Time::ParseDate groff 1.17.2 To generate PDF output. Browser MSIE 5.0 or higher, Netscape 4.76. Some part doesn't display correctly in Galeon and Mozilla. Not tested yet with Konqueror (please send me note how's it going with this if you're using Konqueror.) *QUICK VERSION* 1. Unpack distribution tar xjf __DIST_NAME-x.yy.zz.tar.gz cd voip-billing-x.y.z 2. Define and initiate database mysqladmin create voip_system mysqladmin create voip_business ./bin/sqlinit 3. Generate virtual host conf ./bin/genvhost.pl -s= -e= /path/to/where/src/located vim /etc/httpd/conf/httpd.conf reload httpd 4. Launch Just open your browser and point to the URL http:// *THE FULL STEPS* The entire file tree of voip-billing must be put together under one path. You can set whatever path suit your situation. Later we call this path as 'prefix'. Here, we use '/usr/local/dataweb' as example. 1. Unpack the distribution The distribution file comes in voip-billing-x.y.z.tar.gz where x.y.z indicates the version/release number. Unpack the the distribution using the following command and move the directory to the prefix. tar xzf voip-billing-x.y.z.tar.gz mv voip-billing /usr/local/dataweb Or, tar xzf voip-billing-x.y.z.tar.gz -C /usr/local/dataweb Move to directory newly created, cd /usr/local/dataweb/voip-billing From now on, you are assumed to be in directory voip-billing. Don't change directory unless explicitly told so, or, you know what you're doing. 2. Initiate the database NOTE: This instruction for MySQL only. voip-billing requires two kinds of data spaces: one for system data (used for internal operation) and one for business data (to contain your, well, business data). The distribution comes with predefined database names: `voip_system' for the system database, and `voip_business' for the business data. If you set different names, see also the section Changing Database Names. So first create two databases, mysqladmin create dw_amrita mysqladmin create dw_voip Have a user and password to access these databases, e.g. `db_user' and `db_pass' respectively. See also the section Setting Connect Parameters. The easiest way to create user and its password to access database is probably by issueing command, grant all privileges on DB_NAME.* to DB_USER@localhost \ identified by 'DB_PASS' either from the mysql shell or via the -e switch of mysql command line. Be sure to change DB_NAME, DB_USER and DB_PASS to their actual values. Now, load the tables and data for both databases, ./bin/sqlinit *Changing Database Names* If you decide to use different names for the databases, you have to change the names in all places over the tree. You don't have to do it manually. Use the following command, ./bin/change-db.pl Replace with the current name and with your prefered database name. For example, you want to name the system database and business database with `db_sys' and `db_bsn', respectively: ./bin/change-db.pl voip_system db_sys ./bin/change-db.pl voip_system db_bsn Next, initiate the database: ./bin/sqlinit *Setting Connect Parameters* Along with the database name, the connect parameters are also hardcoded. This is of course very cumbersome but we're currently working on the centralised database access to be included in the next release. If you set different username and password, you have to adjust the setting in lib/Module.pm. You also need to adjust the same setting in the system database. Adjust the data after you initiate the database and look at the table ENTSQL. *Setting Web Account* The application is pre-configured with default user admin and password. You MUST change the password for the user 'root'. Login to mysql and do the change from there. Change ROOT_PWD to whatever you want. Also, change DB_USER, DB_PASS, and DB_NAME appropriately. DB_NAME is the name of system database. mysql -u DB_USER -pDB_PASS DB_NAME mysql> update ENTDWAC set ATRDWACCPWD=encrypt('ROOT_PWD') where ATRDWACLGIN='root'; 3. Configure VirtualHost There's a template in directory `etc' to create the virtual host configuration. You may put the virtual host configuration in the global httpd conf (usually located in /etc/httpd/conf/httpd.conf). Or, you can also put it in its own file. We recommend the latter and put the file in directory `etc' as well. You can copy the template file, etc/vhost-tmpl.conf, and change all tokens (identified by the format __TOKEN_NAME__) accordingly. But the easy way is by executing the following command in the top directory source, ./bin/genvhost.pl -s= -e= Change to however you want your application to be called from the browser. If you set it as voip.mycompany.com (we use this for example for the rest of the document), then the URL will be http://voip.mycompany.com. Change to the email address of your sysadmin's email. And , as we set as example above is /usr/local/dataweb. ./bin/genvhost.pl -s=voip.mycompany.com -e=admin@mycompany.com \ /usr/local/dataweb > etc/vhost.conf Take a look at file etc/vhost.conf, and change whatever you need to change. It's likely that you need to change the value of , I mean the asterix part. The asterix is used to match any IP address, but you better you use the fix IP address as set in directive NameVirtualHost in the global httpd.conf. Next, edit the global httpd.conf. If you use standalone file for the vhost conf, as in etc/vhost.conf, you need to include it using directive Include. Don't forget to use the full path to the vhost.conf. Include /usr/local/dataweb/voip-billing/etc/vhost.conf The last thing you need to do here is reloading the Apache daemon, httpd. You can use the 'restart' command instead of 'reload', if you really want to. /etc/rc.d/init.d/httpd reload 4. Launch Finally, fire up your browser, and type in the URL: http://voip.mycompany.com Login with username 'root' and password you set in section Setting Web Account. If you have any problem regarding the installation process, don't hesitate to contact me. Suggestions are very welcome, as well. I'd like to thank Andy Darmawan for suggesting that all commands are better done from the top level of source directory so no need to change forth and back between directories. -- Hasanuddin Tamir http://www.trabas.com