Build Low-cost Call Center using Elastix and Asterisk (Part 2)

This post is continuation of the previous post:

Now we should have our PBX ready to receive call. But we are not yet configure on how to manage calls and agents. We should have a system to monitor agent’s activities. We can achieve this by using Call Center module inside Elastix. Install it by go to Elastix > Addons > Call Center > Install. Wait for a while until the process finish.

Configure Call Center

1. Create agent. Agent is the person who will need to login into the call center system and answer the call in queue. Go to Elastix > Call Center > Agent Options > Show Filter > New Agent. Enter agent’s details, example as below:

Agent Number: 501
Agent Name: Mark Derp
Password: 123456
Retype Password: 123456

Click Save and add another agent details:

Agent Number: 502
Agent Name: Karim Benz
Password: 121212
Retype Password: 121212

2. Create Group. We need to allow agents to login into our Elastix system to view the agent’s console. This console will tell the agent which incoming queue coming from, how long is the call durations, what type of calls that coming in and much more. This will be configured later. Go to Elastix > System > Users > Groups > Create New Groups. Enter information as below:

Group: Agent
Description: Call Center Agents

3. Assign Agent Console to Agent group. Go to Elastix > System > Users > Group Permissions > go to page 4 > tick on Agent Console > Save Selected as Accessible.

4. Create user. This will be used by call center agents to login into Elastix system to view campaign, calls and also view the phone book. Go to Elastix > System > Users > Create New User and enter agent #1 details as below:

Login: mark
Name: Mark Derp
Password: q1w2e3
Retype Password: q1w2e3
Group: Agent
Extension: 201

Click Save and create another user for Agent #2 as below:

Login: karim
Name: Karim Benz
Password: hgp4ss
Retype Password: hgp4ss
Group: Agent
Extension: 202

5. Create Form. This form will be used to enter customer’s details when they call in. This is required for reporting. We will do this so agent can fill up some details on the call description and remark. Go to Elastix > Call Center > Forms > Show Filter > Create New Form. Enter details as screenshot below:


6. Select Queue. We need to select which queue that will be used inside our call center and activate it. I will activate my SalesCallQueue which has been created on previous post. Go to Elastix > Ingoing Calls > Queues > Show Filter > Select Queue > Select Queue > 301 SalesCallQueue and click Save.

7. Now we can create campaign. Every incoming calls and outgoing calls that agents will call/receive need to be through a campaign. Inside this campaign, we will insert which queue, which form and some description for the caller’s type. Go to Elastix > Call Center > Ingoing Calls > Ingoing Campaigns > Show Filter > Create New Campaign and enter required details as screenshot below:

Click Save and you are done on configuring call center agents, call route, IVR and call queue. We can now proceed to this call center with our call center agents.


Install & Configure Softphone (SIP Client)

There will be a lot of SIP clients available which you can used for this purpose. I am going to use X-Lite. You can download the software here:

1. Login into the call center agent’s PC and proceed to download and install the software. We will be using this application to connect to PBX server which it will route the call to your PC based on extension number. For agent #1 PC, login as extension 201 with password [email protected] as below:

For agent #2 laptop, login as extension 202 with password [email protected] similar to screen shot above. You should now has log into your extension (consider your phone) into the PBX system.

NOTES: You are not login as agent yet in this step! You just login your phone. Just think that this softphone as your normal phone.

2. Login into Elastix’s Agent Console at and use login as created in step #4 under Configure Call Center section.

3. Now select the Agent Number and Extension number that has been setup in the PC for agent #1 as screen shot as below:

4. After you click Enter, you should receive a call from the PBX server (the Caller ID will be Anonymous) and you will be asked to enter the agent’s password. Now enter the password that you have setup for this agent as in step #1 under Configure Call Center section by pressing the PC keyboard and press ‘#’ (shift + 3) button. You will now login as agent and will be redirected to the console as below:


Testing and Costing

Now call the number that associated with the direct line from mobile phone. You will then be entertained by a digital receptionist with IVR menu. Select the appropriate options and your call will be put on queue. Then automatically your call center agent will get the respective call and hear your voice. The ‘Hangup’ and ‘Transfer’ button in agent console will only available if the agent is having active calls.

As for total cost of this call center, here is my calculation:

Stuff                |   Cost (MYR)
Phone line setup fee |   50 x 4
Phone line rental    |   800/month (200/month x 4)
Server Hardware      |   1400
Telephony Card       |   1980
Agent's Phone        |   0
Agent's Headset      |   250 x 2
PBX system           |   0
Call center system   |   0
Total                |   4080

As what I stated in the subject of this post, I have achieved my objective in building a call center/centre with lowest cost possible using mostly open-source tools. My total setup cost is only MYR 4080 or around ~USD $1330 with monthly cost for calls by telco which is MYR 800/month or around ~USD $261/month.

Build Low-cost Call Center using Elastix and Asterisk (Part 1)

My company requires me to build a simple call centre whereby:

  • It can receive incoming call from customers
  • Digital receptionist with interactive voice response (IVR)
  • Make outgoing call
  • Call queue
  • 2 call center agents workings to attend all calls

In order to achieve this, we need to know how many concurrent calls that we usually get during peak hours. In my case, we will usually get/make 3 concurrent calls in a same time. We will require 4 direct line from the Telco provider. The steps will be as below:

  1. Apply 4 direct phone lines from the Telco provider.
  2. Apply another toll-free number to be mapped to this 4 direct phone lines. Example: 1-800-88-1919.
  3. Prepare a server to control this communication aka PBX server.
  4. Buy a telephony interface card to be attached into PBX server.
  5. Install Elastix.
  6. Configure Elastix (extension, call route, IVR, queue).
  7. Install and configure Softphone in agents’ PC. This is the tool that call center agents used to communicate with customer.
  8. Buy a headphone set for call center agents usage.

I will not going to cover whole steps in this post. I am assume that step 1 and 2 has been done by your side. So I will start on step 3 and so on. The architecture that we are going to setup will be as below:


I will be using following variables:

Operating System: Elastix 2.3.0 Stable
PBX Server:
PBX Hostname:


Prepare the PBX Server

1. Get a server. I will be using simple Core i3 server with 250 GB HDD and 2GB RAM.

2. Download Elastix ISO from here: During this writing, I will download the 64bit version of Elastix 2.3.0 Stable.

3. Burn the ISO into a CD. We will use this CD to install the Elastix operating system.

4. Start the installation process by boot the CD. Follow all required steps until finish. Make sure you do not miss steps on setting up MySQL root password and Elastix administrator password.


Telephony Interface Card

After the installation finish and before we configure Elastix, we need to buy a telephony interface card which not usually available in normal IT store. This card usually being produced by PBX company like Digium, Sangoma and Rhino.

Make sure you understand the difference between FXO and FXS before you buy the telephony card. Since I will be using Softphone for all call agents, I will need to buy 4 FXO port (for direct line) with no FXS port (for station line). You may refer to here for further explanation:

For me I am going to buy this analog telephony card from Digium:


Configure Elastix

1. Now login into the Elastix server using web browser as admin. As for me, I will be login to .

2. We need to detect the telephony card before start configuring the PBX server. Make sure the direct phone lines has been attached to the back of the telephony card port. Go to Elastix > System > Hardware Detector > Detect New Hardware. You should see something like below:

This picture shows that only 1 direct phone line is detected and connected to the server. If you attached more than 1 line, you should see the respective port will turn into green.


3. Lets start configuring Elastix. The most basic things that we need to have is extension. Go to Elastix > PBX > PBX Configuration > Extensions. Select Generic SIP Device and click Submit. Fill up required data as below for Agent 1:

  • Under ‘Add Extension’
    • User Extension: 201
    • Display Name: Agent 1
  • Under ‘Device Options’
  • Under ‘Voicemail & Directory’
    • Status: Enabled

Click Submit. Now for Agent 2 repeat similar steps and add information as below:

  • Under ‘Add Extension’
    • User Extension: 202
    • Display Name: Agent 2
  • Under ‘Device Options’
  • Under ‘Voicemail & Directory’
    • Status: Enabled


4. Create queue. This will define the incoming call to be queue and which agent will required to communicate with them. I will need to create 2 group of queue which is Sales queue and CustomerService queue. Go to Elastix > PBX > PBX Configuration > Queues and enter following details:

  • Under ‘Add Queue’:
    • Queue Number: 301
    • Queue Name: SalesCallQueue
    • Static Agents: A201,0
Click Submit. Now for customer service queue, repeat similar steps and add information as below:
  • Under ‘Add Queue’:
    • Queue Number: 302
    • Queue Name: CustomerServiceCallQueue
    • Static Agents: A202,0


5. We need to create some recordings. We will use the voice recording to welcome every incoming call using IVR. You can refer to following video on how to use System Recordings:

As for me, I will be using Text to Wav features under Elastix > PBX > Tools > Text to Wav to create a simple welcoming voice.


6. From the voice recording on previous steps, we will need to configure IVR so our digital receptionist could route the call correctly. Go to Elastix > PBX > PBX Configuration > IVR and enter details as screen shot below:


7. We then need to configure the Inbound Routes. This will tell PBX on what is the first thing to do when receiving calls. Go to Elastix > PBX > PBX Configuration > Inbound Routes and enter following details:

  • Under ‘Add Incoming Route’:
    • Description: IncomingLine
  • Under ‘Options’:
    • CID name prefix: IncomingCall
  • Under ‘Set Destination’:
    • IVR: Welcome
Click Submit and also click the notification: Apply Configuration Changes Here.
This post continues at part 2 on how to install Call Center modules in Elastix and configure the call center agents’ PC to to use Softphone.

Install OpenFiler from USB Drive

We just received a new storage server from DELL which will be used to host web server cluster. We will use Openfiler, a free NAS/SAN operating system to manage our RAID-10 storage.

The problem we have now is our storage server has no optical drive and we do not have any external optical drive available here in office. Alternatively, we can use USB stick drive and make sure our server are able to boot from USB.

Server: DELL PowerEdge R510
OS version: Openfiler 2.99 64bit
USB flash drive: /dev/sdb
RAID 10 virtual disk: /dev/sda

Preparing the Flash Drive

1. Download the ISO from here into your local PC. In my case, I downloaded the x86_64 distribution ISO.

2. Download UNetbootin from here. We will use this application to burn our ISO into flash drive.

3. Prepare our flash drive. Format it to FAT32 or FAT file system. Since I am using Windows 7, just right click to the drive and click ‘Format’.

4. Launch UNetbootin and select ‘Diskimage’. Locate the ISO file in your PC and click OK as screenshot below:

5. Once ready, we need to copy the whole ISO into a directory called ‘root’. Navigate to your USB pendrive and create a directory ‘root’ at the parent directory:


Once the copy completed, verify and make sure the ISO is exist as screenshot below:


Installing into the Server

1. Plug into the server’s USB port and press F11 to show boot options as below:

2. Accept default value up until you see installation method page. Choose “Hard Drive” and you just need to select /dev/sdb1 (our flash drive) and enter “root/” (without quote) so the installer can try to find the Openfiler ISO file (which we have save it earlier):

3. The installer should loaded properly now and you can proceed with the Openfiler installation wizard. Up until you see Bootloader Configuration setting, select “/dev/sda1    First sector of boot partition” as screenshot below:

4. Proceed with the installation wizard until Finish. It will required a reboot after installation completed. REMOVE THE USB DRIVE AS WELL!


Post-Installation Configuration

1. By default, Openfiler will boot to “Other” because this is the disk partition that we have install from (see below screenshot). Make sure during the first boot after installation finish, select the Openfiler kernel manually and press Enter:

2. After sysinit complete, you should see the login page of Openfiler. Login as root user and open this text file:

$ vi /etc/bootloader.conf

And change following line from this:

default other0

To this:

default 2.6.32-71.18.1.el6-0.20.smp.gcc4.1.x86_64

3. Save the file and run following command to apply the new bootloader configuration:

$ bootman

If you see some error, ignore it. This error indicate that /dev/sdb1 (the USB flash drive) is not exist which is correct.

Done. You can try to reboot once more to make sure that the bootloader will automatically select Openfiler instead of other device when booting.

FreeBSD: Upgrade from 8.2 to 9.0

If you use this command to upgrade to latest release FreeBSD 9.0:

$ freebsd-update -r 9.0-RELEASE upgrade

You might see following error:

The update metadata is correctly signed, but
failed an integrity check.
Cowardly refusing to proceed any further.

This error indicate that it cannot accept % and @ characters which appear in FreeBSD 9 . To overcome this, run following command:

$ sed -i '' -e 's/=_/=%@_/' /usr/sbin/freebsd-update

Now start the upgrade process:

$ freebsd-update -r 9.0-RELEASE upgrade

Accept all prompted values and follow the wizard. This process downloads all files and patches required for upgrade so it takes time. You might need to press ‘Enter’ once to check /etc/hosts file. Once complete, run following command to start installing the updates:

$ freebsd-update install

After a while, you should see the system will prompt something as below:

Installing updates...rmdir: ///boot/kernel: Directory not empty
Kernel updates have been installed. Please reboot and run "/usr/sbin/freebsd-update install"
again to finish installing updates.

Reboot the server:

$ init 6

Once up, it will boot to FreeBSD 9. Run again the installation command:

$ freebsd-update install

After the process completed, the system will ask you to build back all your application which installed using ports. Once done, you need to rerun again the above command to complete the upgrade process and you should something like below:

$ freebsd-update install
Installing updates... Done

Your update should be completed now. To check the new version, run following command:

$ uname -r


Linux: Install and Configure PostgreSQL with pgAdmin

PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. People will usually comparing PostgreSQL with MySQL, and there are several key factors which let us choose PostgreSQL over MySQL:

  • Single storage engine – no hassle to choose which storage engine like MySQL
  • PostgreSQL aims for SQL standards compliance (the current standard is ANSI-SQL:2008)
  • High level of data integrity demanded by a serious transactional database application, the current generation PostgreSQL performs better than MySQL
  • Open source and run on GPL license – no licensing cost

I will be using standard CentOS 6 with and yum installer. Variable as below:

OS: Centos 6.2 64bit
Server IP:
Client IP:
Root user: postgres
Password: Bf44Ks#1

1. Install PostgreSQL using yum:

$ yum install -y postgresql*

2. Initialize the server database:

$ service postgresql initdb

3. By default, PostgreSQL will be installed under /var/lib/pgsql/data. Open the configuration file at /var/lib/pgsql/data/postgresql.conf using text editor and enable following line:

listen_addresses = '*'

4. Open client authentication configuration file at /var/lib/pgsql/data/pg_hba.conf to configure how user can access PostgreSQL via network or locally. User postgres is the super-user and I need to allow this user to be access from my Windows 7 laptop using pgAdminIII client. I need to add following line as below:

host    all    postgres       md5

Explanation: host = access via network, all = can access all database, postgres = user that I want to use to access, =  network address which the user used to access this server, md5 = authentication method

5. Start and enable the PostgreSQL service:

$ service postgresql start
$ chkconfig postgresql on

6. Now we need to reset the user postgres password so we can use md5 authentication when connecting through client later. We need to change to user postgres environment by ‘su’ command and then access the PostgreSQL database:

$ su - postgres
-bash-4.1$ psql
psql (8.4.9)
Type "help" for help.

Then run following command:

postgres=# ALTER USER postgres WITH ENCRYPTED PASSWORD 'Bf44Ks#1';
postgres=# \q

After quit from psql, reload the server:

$ psql_ctl reload

7. Add following line into /etc/sysconfig/iptables to allow port 5432 for PostgreSQL communication using text editor. Make sure you put the line before any REJECT (-j REJECT) rules:

-A INPUT -p tcp -m state --state NEW -m tcp --dport 5432 -j ACCEPT

Dont forget to restart IPtables:

$ service iptables restart

8. Now lets download and install pgAdminIII, a client which run on Windows for PostgreSQL database server at Once downloaded, unzip the compress file and run the installer. Follow the wizard by accepting default value and complete the installation.

9. Lets connect to the server and run the pgAdminIII client. It usually located under Windows > All Programs > pgAdmin III 1.8 > pgAdmin III. Enter required information as screenshot below:

Done! You may now manage your PostgreSQL server remotely!

CentOS: Enable CentOS GNOME Desktop

Mostly the CentOS servers that I am using is run on CLI (Command-Line Interface) mode. But in some cases, I need to have a desktop to install some applications with GUI (Grapich User Interface) mode. In this case, I will use GNOME, the most popular user-friendly desktop for any UNIX based system.

Variable that I used as below:

OS: CentOS 6.2 64bit
Desktop environment: GNOME

1. Using yum, we will need to install X Windows System  as the based for GUI and rich input device capability:

$ yum groupinstall -y 'X Window System'

2. Only then we can install GNOME desktop environment on top of it:

$ yum groupinstall -y 'Desktop'

3. Since previously the server is running on CLI mode, we need to change some value to tell CentOS to boot up in the GUI mode. Open /etc/inittab via text editor and change following line:




4. Start the GUI:

$ init 5

Note: You can switch from GUI to CLI mode manually by using following method:

GUI to CLI: Ctrl + Alt + F6
CLI to GUI: Ctrl + Alt + F1

If you want to start the desktop from CLI console (not SSH session), use following command:

$ startx

In some cases, when you login into the system via GUI, you will see some kind of weird boxes replacing the fonts. You can overcome this problem by installing fonts group via yum:

$ yum groupinstall -y Fonts

Done! We now have user-friendly interface like below:

Solaris: Setting Up Package Manager and Installer

Oracle Solaris 11 is one of the  most popular UNIX-based operating system which widely download to be used by enterprise user, after FreeBSD. If you have FreeBSD basic knowledge, you should able to play around with Solaris as well.

If FreeBSD we have ports, the package manager and application installer, in Solaris, we can use pkgutil. It is rather simple to use and similar to apt-get and yum on how to use it. We will use OpenCSW, which aims to produce an easy to use open source software distribution installable on top of Solaris and Solaris-based systems, developed by a transparent and democratic community.

My Oracle Solaris version:

$ cat /etc/release
Oracle Solaris 11 11/11 X86
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
Assembled 18 October 2011

1. Run following command as root to install the pkgutil application:

$ pkgadd -d

2. We need to set some environment for CSW. Open ~/.profile using text editor:

$ nano ~/.profile

And append :/opt/csw/bin at the end of PATH line and add another line for XFILESEARCHPATH so it will be shown like below:

export PATH=/usr/bin:/usr/sbin:/opt/csw/bin
export XFILESEARCHPATH=/opt/csw/lib/X11/%T/%N%C:/usr/openwin/lib/X11/%T/%N%C

To check whether it is correctly inserted, use following command:

$ echo $PATH

3. Now we should able to use pkgutil. Lets update our catalog:

$ pkgutil -U

Note: If you unable to execute the command with error similar to ‘command not found’, you need to relogin your session or type su – command

4. It will download the list from this mirror: . To find available application in the catalog, we can use following command:

$ pkgutil -a mysql
libmysqlclient15   CSWlibmysqlclient15 5.0.92,REV=2011.10.05     1.4 MB
libmysqlclient_r15 CSWlibmysqlclient-r15 5.0.92,REV=2011.10.05   1.4 MB
mysql4             CSWmysql4 4.1.22,REV=2008.01.20              13.0 MB
mysql4bench        CSWmysql4bench 4.1.22,REV=2006.11.28        487.4 KB
mysql4client       CSWmysql4client 4.1.22,REV=2007.12.01         2.4 MB
mysql4devel        CSWmysql4devel 4.1.22,REV=2008.01.20          2.1 MB
mysql4rt           CSWmysql4rt 4.1.22,REV=2008.01.20             3.6 MB
mysql4test         CSWmysql4test 4.1.22,REV=2006.11.28           1.3 MB
mysql5             CSWmysql5 5.0.92,REV=2011.10.05              11.0 MB
mysql5client       CSWmysql5client 5.0.92,REV=2011.10.05         3.0 MB
mysql5devel_stub   CSWmysql5devel 5.0.92,REV=2011.10.05          7.9 KB
mysql5rt_stub      CSWmysql5rt 5.0.92,REV=2011.10.05             7.9 KB
mysql_dev          CSWmysql-dev 5.0.92,REV=2011.10.05          115.8 KB
php4_mysql         CSWphp4mysql 4.4.9,REV=2009.05.28            17.3 KB
php5_mysql         CSWphp5-mysql 5.3.8,REV=2011.09.04           22.6 KB
php5_mysqli        CSWphp5-mysqli 5.3.8,REV=2011.09.04          49.8 KB
php5_pdomysql      CSWphp5-pdomysql 5.3.8,REV=2011.09.04        17.3 KB
php5mysql_stub     CSWphp5mysql 5.3.8,REV=2011.09.04             2.5 KB
php5mysqli_stub    CSWphp5mysqli 5.3.8,REV=2011.09.04            2.5 KB
php5pdomysql_stub  CSWphp5pdomysql 5.3.8,REV=2011.09.04          2.5 KB
pm_dbdmysql        CSWpmdbdmysql 4.013,REV=2010.02.11          169.8 KB
py_mysql           CSWpy-mysql 1.2.3,REV=2011.03.13             41.0 KB
pymysql            CSWpymysql 1.2.3,REV=2011.03.13               1.8 KB
rb18_mysql_2_8_1   CSWrb18-mysql-2-8-1 2.8.1,REV=2011.08.14    217.0 KB

5. Now lets install application using pkgutil:

$ pkgutil -i -y mysql5

To update application:

$ pkgutil -u mysql5

To remove application:

$ pkgutil -r mysql5

To update all applications:

$ pkgutil -u

From here you may start to manage your applications and let your Solaris working!

Ubuntu: Install Windows Application using Winetricks

Ubuntu is surely good for end-user operating system but sometimes we still need to have Windows application more. Using Wine, we can run Windows applications in UNIX/LINUX environment. If you are using Ubuntu, installing Wine is just simple if you are using Ubuntu Software Center. Just search for ‘Wine’ and then install.

In order to run Windows application correctly, we need to install some of the Windows-only requirement like .NET Framework, windows-based fonts and some of Windows libraries (dll) file. We can achieve this by using Winetricks, an extension built for Wine to help installing Windows application in a better way (other than manually download and execute).

Variable that I used is:

OS: Ubuntu 10.04 (Lucid)
User: mikey
Wine location: /home/mikey/.wine or ~/.wine

1. Download and install Winetricks:

$ cd ~/Downloads
$ wget
$ chmod +x winetricks
$ sudo cp winetricks /usr/local/bin

2. We can browse around on categories that Winetricks could do for us:

$ winetricks apps list
$ winetricks benchmarks list
$ winetricks dlls list
$ winetricks fonts list
$ winetricks games list
$ winetricks settings list

3. In this case, I will start by installing .NET Framework 2.0:

$ winetricks dotnet20

4. To install many applications, we can run following command:

$ winetricks corefonts vcrun6 mfc40 vb6run msxml6

5. To remove all applications which has been installed by Winetricks and re-initialize Wine:

$ rm -Rf ~/.wine
$ wineboot


Linux: Install JAWStats – Beautiful Statistic using AWStats Core

If you are a webmaster, then you should know the well-known log analyzer software called AWStats (Advanced Web Statistics). AWStats will convert your Apache access logs into a statistic page with lot of graphs and infographics.

One thing lack of it is the way AWStats represent the data in HTML. So, we will use JAWStats, another extension created in conjunction with AWStats and produces clear and informative charts, graphs and tables about your website visitors.

To do this, we need to have AWStats installed. JAWStats will use AWStats’s Data File (for example: as the database to generate a beautiful statistic page. I will use variable as below:

OS: CentOS 6.2 64bit
AWStats path: /var/www/html/awstats
AWStats CGI path: /var/www/cgi-bin
JAWStats path: /var/www/html/jawstats
Log location: /var/log/httpd/


1. Download AWStats from the main website:

$ cd /usr/local/src
$ wget
$ tar -xzf awstats-7.0.tar.gz

2. Install AWStats:

$ mv /usr/local/src/awstats-7.0/wwwroot/cgi-bin/* /var/www/cgi-bin
$ mv /usr/local/src/awstats-7.0/wwwroot/* /var/www/html/awstats

3. Configure AWStats to process our domain’s log file in cgi-bin folder:

$ cd /var/www/cgi-bin
$ cp awstats.model.conf

Open the domain’s configuration file and edit following line via text editor:

HostAliases=" REGEX[myseri\$]"

4. Let AWStats run to generate the statistic data:

/var/www/cgi-bin/ -update

Note: It might take some times for this process to complete depending on your log size

5. Once done, we need to allow AWStats to update the statistic automatically every 2 hours via cron job:

$ crontab -e

Add following line:

0 */2 * * * /var/www/cgi-bin/ -update


1. Download JAWStats:

$ mkdir -p cd /usr/local/src/jawstats
$ wget
$ tar -xzf jawstats-0.7beta.tar.gz

UPDATE: I received a lot of feedback that PHP 5.3 will cause a blank page to JAWStats. If you are using PHP 5.3 and above, you might need to download the latest version in GitHub here:

2. Copy the JAWStats folder to website directory and copy the configuration file as well:

$ mv /usr/local/src/jawstats /var/www/html
$ cd /var/www/html/jawstats
$ cp config.dist.php config.php

3. Configure JAWStats by editing config.php via text editor and add following line:

$aConfig[""] = array(
"statspath" => "/var/www/cgi-bin/",
"updatepath" => "/var/www/cgi-bin/",
"siteurl" => "",
"sitename" => "",
"theme" => "default",
"fadespeed" => 250,
"password" => "mypassword",
"includes" => "",
"language" => "en-gb"



To see the result, just go to the browser at (this is my web server main IP) and you should see something like below:

The data in this page is updated once every 2 hours depending on how you setup the cron job for AWStats to run. You might need to increate PHP memory_limit to higher depending on how big your data generated by AWstats.

Linux: Install LiteSpeed Web Server

Lets open our mind with another web server, which is 6x faster than Apache in handling static files and 50% faster in processing PHP, called LiteSpeed Web Server (LSWS). Variable as below:

OS: CentOS 6 64bit
LiteSpeed version: Standard Edition – Version 4.1.9
Root path: /usr/local/lsws/mydear
Web path: /usr/local/lsws/mydear/public_html

1. Download the installer at . As for this case, I will use Linux (x86) version:

$ cd /usr/local/src
$ wget

2. Install the requirement to be run in 64 bit environment:

yum install glibc -y

3. Extract the installer and install:

$ tar -xzf lsws-4.0.20-std-i386-linux.tar.gz
$ cd lsws-4*
$ ./

The installation wizard will guide us on how to install as below:

Please specify the destination directory. You must have permissions to
create and manage the directory. It is recommended to install the web server
at /opt/lsws, /usr/local/lsws or in your home directory like '~/lsws'.
ATTENTION: The user 'nobody' must be able to access the destination
Destination [/usr/local/lsws]:
Please specify the user name of the administrator.
This is the user name required to log into the administration web interface.
User name [admin]: admin
Please specify the administrator's password.
This is the password required to log into the administration web interface.
Retype password:
Please specify administrators' email addresses.
It is recommended to specify a real email address,
Multiple email addresses can be set by a comma
delimited list of email addresses. Whenever something
abnormal happened, a notificiation will be sent to
emails listed here.
Email addresses [[email protected]]: [email protected]
As you are the root user, you must choose the user and group
whom the web server will be running as. For security reason, you should choose
a non-system user who does not have login shell and home directory such as
User [nobody]:
Please choose the group that the web server running as.
User 'nobody' is the member of following group(s): nobody
Group [nobody]:
Please specify the port for normal HTTP service.
Port 80 is the standard HTTP port, only 'root' user is allowed to use
port 80, if you have another web server running on port 80, you need to
specify another port or stop the other web server before starting LiteSpeed
Web Server.
You can access the normal web page at http://:/
HTTP port [8088]: 80
Please specify the HTTP port for the administration web interface,
which can be accessed through http://:/
Admin HTTP port [7080]:
Cannot find RUBY installation, remember to fix up the ruby path configuration
before you can use our easy RubyOnRails setup.
You can setup a global script handler for PHP with the pre-built PHP engine
shipped with this package now. The PHP engine runs as Fast CGI which
outperforms Apache's mod_php.
You can always replace the pre-built PHP engine with your customized PHP
Setup up PHP [Y/n]: Y
Suffix for PHP script(comma separated list) [php]:
Installing, please wait...
Generating key pair for web console login page, please wait ...
Generating RSA private key, 512 bit long modulus
e is 65537 (0x10001)
AWStats Integration
AWStats is a popular log analyzer that generates advanced web server
statistics. LiteSpeed web server seamlessly integrates AWStats into
its Web Admin Interface. AWStats configuration and statistics update
have been taken care of by LiteSpeed web server.
Note: If AWStats has been installed already, you do not need to
install again unless a new version of AWStats is available.
Would you like to install AWStats Add-on module [y/N]? y
[INFO] Creating a symbolic link from './awstats-7.0' to './awstats'
[OK] AWStats 7.0 has been successfully installed as a litespeed
add-on module.
Congratulations! The LiteSpeed Web Server has been successfully installed.
Command line script - "/usr/local/lsws/bin/lswsctrl"
can be used to start or stop the server.
It is recommended to limit access to the web administration interface.
Right now the interface can be accessed from anywhere where this
machine can be reached over the network.
Three options are available:
1. If the interface needs to be accessed only from this machine, just
change the listener for the interface to only listen on the loopback
interface - localhost(
2. If the interface needs to be accessible from limited IP addresses or sub
networks, then set up access control rules for the interface accordingly.
3. If the interface has to be accessible via internet, SSL (Secure Sockets
Layer) should be used. Please read respective HOW-TOs on SSL configuration.
To change configurations of the interface, login and click
"Interface Configuration" button on the main page.
The administration interface is located at http://localhost:/
or http://:/
Would you like to have LiteSpeed Web Server started automatically
when the server restarts [Y/n]? Y
[OK] The startup script has been successfully installed!
Would you like to start it right now [Y/n]? Y
[OK] litespeed: pid=3314.
LiteSpeed Web Server started successfully! Have fun!

The sequence I press on the keyboard is:

Enter > Enter > mypassword > mypassword > [email protected] > Enter > Enter > 80 > Enter > Y > y > Y > Y

4. Lets check whether LSWS is running:

$ netstat -tulpn | grep lite
tcp   0   0*   LISTEN   3314/litespeed (lsh
tcp   0   0*   LISTEN   3314/litespeed (lsh

5. Allow the LSWS ports in IPtables:

$ iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
$ iptables -A INPUT -p tcp -m tcp --dport 7080 -j ACCEPT
$ service iptables save
$ service iptables restart

6. Open web browser and go to to access the administration console. Before we configure the virtual host, we need to configure the listeners so it learn to the correct IP:

Web administration > Configuration > Listeners > Default > General > Edit > Select the IP Address of the pointed website, in this case I will use > Save

Restart the LSWS:

Web administration > Action > Graceful Restart > OK

7. Lets configure our website to run. Create the directory via SSH and then configure the virtual host:

$ mkdir -p /usr/local/lsws/mydear/public_html

Web administration > Configuration > Virtual Host Templates > PHP_SuEXEC > Add and insert the website details as screenshot below:

8. Next we need to instantiate the domain from the template. Refer to screenshot below:

Click Instantiate > Yes.

9. Restart LSWS:

Web administration > Action > Graceful Restart > OK

Done! You can access the website via in the browser with PHP support. It is also easy to recompile PHP, Ruby and Python by using the web administration console of LSWS.

Install Pound as Web Load Balancer

One of our website host contents which can be downloaded by clients. Since this content is getting popular, our bandwidth usage and server load are getting higher everyday and we need something to balance this out. To solve this issue, I have using an application called Pound, which is a reverse proxy, load balancer, auto HTTP fail-over and HTTPS front-end for Web server.

The installation and implementation is very simple with help of RPMforge. Pound is open-source software which you can find out more information about it at .

I will use a simple kind of architecture as below:

Lets assume I already have the website hosted in both servers, which I already copied using cPanel copy account tools. Variable as below:

OS: CentOS 5.6 64bit
Website URL:

1. Install RPMforge repository for yum. Go to and choose which CentOS operating system you used. In this case, I will use CentOS 5 64bit packages:

$ cd /usr/local/src
$ wget
$ rpm --import 
$ rpm -Uhv rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

2. Install Pound via yum:

$ yum install pound -y

3. Rename original config file because we will use our configuration file:

$ mv /etc/pound.cfg /etc/pound.cfg.ori
$ touch /etc/pound.cfg

4. Copy and paste following configuration into /etc/pound.cfg using text editor:

User            "nobody"
Group           "nobody"
LogLevel        1
Alive           2
        Port    80
        HeadRequire "Host: .**"
                Port    80
		TimeOut 300
                Port 80
		TimeOut 300
                Type Cookie
                ID   "JSESSIONID"
                TTL  300

5. Make sure Pound is working at startup service and started:

$ chkconfig pound on
$ service pound start

6. Check whether Pound is listening to the correct value:

$ netstat -tulpn | grep pound
tcp        0      0     *                   LISTEN      29358/pound

7. To check the log files, you can monitor /var/log/messages using following command:

$ tail -f /var/log/messages

8. Last step is to point the subdomain to the load balancer IP. In this case, I need to login to my domain name server and change the A record for this subdomain. Example as below:     A

After DNS propagation is completed, you should notice that Pound has started to work and balancing your website!

Install VPN PPTP Server on CentOS 6

At this moment, my designer encounter problem to access, an online shopping website to see some of the stuff for their design work. only allowed connections from USA and Canada at this moment due to their website crash issue last couple of weeks. Since this is quite urgent, I need to setup a VPN server so they can use it as a jump point to access websites in USA and Canada. I will use my MySQL server to serve as VPN server as well.

In this tutorial, I will use pptp as protocol to connect to VPN server using a username and password, with 128 bit MPPE encryption. Variable as below:

OS: CentOS 6 64bit
VPN server:
VPN client IP: –
VPN username: vpnuser
Password: myVPN$99

1. Install ppp via yum:

$ yum install ppp -y

2. Download and install pptpd (the daemon for point-to-point tunneling). You can find the correct package at this website :

$ cd /usr/local/src
$ wget
$ rpm -Uhv pptpd-1.3.4-2.el6.x86_64.rpm

3. Once installed, open /etc/pptpd.conf using text editor and add following line:


4. Open /etc/ppp/options.pptpd and add  authenticate method, encryption and DNS resolver value:


5. Lets create user to access the VPN server. Open /etc/ppp/chap-secrets and add the user as below:

vpnuser pptpd myVPN$99 *

The format is: [username] [space] [server] [space] [password] [space][IP addresses]

6. We need to allow IP packet forwarding for this server. Open /etc/sysctl.conf via text editor and change line below:

net.ipv4.ip_forward = 1

7. Run following command to take effect on the changes:

$ sysctl -p

8. Allow IP masquerading in IPtables by executing following line:

$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$ service iptables save
$ service iptables restart

Update: Once you have done with step 8, check the rules at /etc/sysconfig/iptables. Make sure that the POSTROUTING rules is above any REJECT rules.

9. Turn on the pptpd service at startup and reboot the server:

$ chkconfig pptpd on
$ init 6

Once the server is online after reboot, you should now able to access the PPTP server from the VPN client. You can monitor /var/log/messages for ppp and pptpd related log. Cheers!