Elastix Addons


Elastix Addons

  • Apstel Visual Dialplan
  • Call Center
  • FOP2
  • SugarCRM
  • Surveillance
  • Web Conference

Apstel Visual Dialplan

Visual Dialplan for Elastix is a poweful platform for call flow development. It is intended for advanced Elastix users, consultants and Elastix professionals, is an innovative visual modeling platform that provides an easy, convenient and natural way to create, validate and deploy Elastix dialplan.

  • Drag, drop and connect building blocks.
  • Large component library.
  • Powerful validation engine.
  • Linux and extensions.conf knowledge is NOT required.
  • Specialized editors for every component.
  • Automatic dial plan upgrade.
  • Leverage full Asterisk dialplan capability.
  • Over 150 components and 60 functions.
  • Ready to use dialplan samples.
  • Grammars are automatically deployed with the dialplan.
  • Visual Dialplan validates: syntax, object connections, existence of used peers (SIP, IAX…), existence of used DAHDI/Zap channels, voice mail boxes, agents,
  • queues, MOH, conference bridges, etc.
  • Visual Dialplan reads Asterisk server configuration data and pre-populates library components with configuration objects
  • Visual Dialplan will warn if the dialplan use undefined SIP peer, or voicemail box, or agent, etc.
  • Asterisk professionals use it to develop and maintain large Asterisk dialplans.
  • Integrated help system.

Call Center

CallCenter module is a basic implementation of an administrator for a call center. A group of people (called agents) take calls managed by the software and fill forms with the results of their dialogue with the person contacted (contact).

  • Two modes of operation. In the outbound mode, load a list of phone numbers, and the system starts to generate calls to be connected with the agents through a line of Asterisk. In the way of incoming calls, prepares a queue to receive calls coming into the system.
  • Generating predictive outbound call: the system generates many calls as agents are idle, and also attempt to predict what will end soon calls to generate new calls in advance.
  • Web Console where agents are the associated campaign information.
  • Hours of operation associated with outbound campaigns.
  • Support for DNC (Do Not Call)
  • Start and end of the season for outbound and inbound campaigns.
  • You can define forms that will be used to gather information from the call. You can associate multiple forms with a single campaign.
  • You can define an external Web page must display associated with each call to an agent is embedded within a web console, or as a completely separate website. For advanced administrators also supports define a URL that provides JavaScript code to execute in the web console (via JSONP) for complete control of the console.
  • Charging of outgoing calls can include arbitrary attributes to be displayed as part of the information that the agent observes.
  • Agents can initiate pauses during which they will not receive calls.
  • Download the information collected through the forms in CSV format.
  • Ability to implement a custom console interface through the ECCP protocol.
  • Various reports.

FOP2

FOP2 lets you see detailed PBX activity, like who is talking and to whom, call durations, held calls, queued calls, etc. It lets you control your phone and perform transfers, launch call spying and whisper, monitor queue activity and more. This version shows 2 lines per phone and held call status, so you can see exactly what is going on.

  • See who is available or not.
  • Transfer directly to destination extension, voicemail or external numbers.
  • Ability to pickup ringing phones
  • Manage and visualiza parked calls.
  • Realtime search and filter of extensions (great for big companies with hundreds of extensions).
  • See agents logged into a queue
  • See agent status (paused, logged off, invalid).
  • See every call waiting on the queue with its timer.
  • Manage agents: add, remove or pause queue members.
  • Filter extension list to only queue members with one click.
  • Spy or whisper to your agents.
  • Initiate call recording to disk.
  • Call notifications (callerid number and name, call from queue).
  • Directory integration, live search or dial to any typed number.
  • Call control: transfer out, hangup, pickup, etc.
  • Conference control: lock, invite, kick & mute, talk detection.
  • Presence: set and visualize your presence status.
  • IM chat: Instant messaging and notes integrated, no need for extra software or daemons.
  • Voicemail explorer: lets you browse and hear your voicemail right from your browser.

SugarCRM

Sugar is an affordable and easy to use customer relationship management (CRM) platform, designed to help your business communicate with prospects, share sales information, close deals and keep customers happy. As an open-source, web-based CRM solution, Sugar is easy to customize and adapt to your changing needs. Ideal for small and medium-sized companies, large enterprises and government organizations.

  • SugarCRM offers an email integration, it provides email management within Sugar by integrating with Microsoft Outlook, IBM Lotus Notes, Gmail, Yahoo! Mail, and IMAP based email servers.
  • Sugar comes with a complete modern drag-and-drop calendar interface.
  • Sugar comes with a wide range of Google integrations right out of the box.
  • SugarCRM offers a multiple deployment options.
  • Create custom, calculated, dependent, and related fields, as well as custom modules.
  • Reveal and protect information based on user role and profile.
  • Simply drag-and-drop for easy configuration.
  • Create real-time reports and dashboards on any CRM metric, without having to rely on administrators for support.
  • Present user-specific information about sales opportunities and progress.

Surveillance

ZoneMinder is an integrated set of applications which provide a complete surveillance solution allowing capture, analysis, recording and monitoring of any CCTV or security cameras attached to a Linux based machine. It is designed to run on distributions which support the Video For Linux (V4L) interface and has been tested with video cameras attached to BTTV cards, various USB cameras and also supports most IP network cameras.

  • Supports video, USB and network cameras.
  • Support Pan/Tilt/Zoom cameras, extensible to add new control protocols.
  • High performance independent video capture and analysis daemons allowing high failure redundancy.
  • Multiple Zones (Regions Of Interest) can be defined per camera. Each can have a different sensitivity or be ignored altogether.
  • User friendly web interface allowing full control of system or cameras as well as live views and event replays.
  • Supports event replay in mpeg video, multi-part jpeg, stills formats, along with statistics detail.
  • Highly partitioned design allow other hardware interfacing protocols to be added easily for support of alarm panels etc.
  • Includes bi-directional X.10 (home automation protocol) integration allowing X.10 signals to control when video is captured and for motion detection to trigger X.10 devices.

Web Conference

WebConference addon is a module that implements a virtual conference through a web page in Elastix. The conferences are easily created and invitations can then be sent automatically via email. During the conference each user can select the video stream to display, chat, share files, and more; the administrator can also give/take control of the presentation.

  • Send a text document, image, PDF, or presentation to be visible and paged through the Web interface.
  • One of the speakers (default is the creator of the conference) can direct the conference from its web interface. By paginating the document, all other participants change page together.
  • The creation of the Web conference can optionally be created simultaneously with a conference call. This capability is integrated with the core module of Elastix “Conference”.
  • Chat Window and presence reporting integrated in the conference interface.
  • Video window allows speakers to see each other (requires Flash support in the browser).
  • Chat Log (in Elastix interface) can pick up what was discussed in the chat.

Migrate a DirectAdmin Server to a new DirectAdmin Server


01. Check the current versions of Apache, PHP and MySQL and then number of IPs on current running server. In my case versions are as following:

Apache/2.2.13 PHP 5.2.17 (cli) MySQL 5.0

IP details:

174.XXX.XX.XX1 174.XXX.XX.XX2 174.XXX.XX.XX3

  02. Install directadmin in custom mode on NEW server. On NEW server I installed the following versions:

Apache 2.2 [it is the latest version available via DA’s custombuild] PHP 5.2 [It is the latest version of PHP available via DA’s custombuild] MySQL 5.1 [It is the latest version of MySQL available via DA and also this version supports “TRIGGER”(5.0 does not support “TRIGGER” in each mysql user level)]

Make DA and all other services down on NEW server:

/etc/init.d/named stop && \ /etc/init.d/exim stop && \ /etc/init.d/proftpd stop && \ /etc/init.d/dovecot stop && \ /etc/init.d/httpd stop && \ /etc/init.d/mysqld stop && \ /etc/init.d/directadmin stop  && \ /etc/init.d/crond stop

  03. Upgrade MySQL on OLD server to 5.1 For upgrading MySQL do:   a. Change CWD to /usr/local/directadmin/custombuild/   b. Change mysql options in options.conf. So it should be like following.

mysql=5.1 mysql_inst=yes mysql_backup=yes

c. Update build script

./build update_script

d. Update mysql

./build mysql d

  04. Rsync all needed configuration files, /home and /var/lib/mysql from OLD server to NEW server. My rsync script for DA to DA migration:

rsync -avz –stats –progress –delete -e ssh /var/lib/mysql/ XX.XXX.XX.XXX:/var/lib/mysql rsync -avz –stats –progress –delete -e ssh /home/ XX.XXX.XX.XXX:/home rsync -avz –stats –progress -e ssh /etc/passwd XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/shadow XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/group XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/exim.conf XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/exim.pl XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/system_filter.exim XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/exim.crt XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/exim.key XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/proftpd.conf XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/proftpd.vhosts.conf XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/proftpd.passwd XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /etc/named.conf XX.XXX.XX.XXX:/etc rsync -avz –stats –progress -e ssh /root/.my.cnf XX.XXX.XX.XXX:/root rsync -avz –stats –progress –delete -e ssh /etc/virtual/  XX.XXX.XX.XXX:/etc/virtual rsync -avz –stats –progress –delete -e ssh /etc/httpd/conf/ XX.XXX.XX.XXX:/etc/httpd/conf rsync -avz –stats –progress –delete -e ssh /var/named/ XX.XXX.XX.XXX:/var/named rsync -avz –stats –progress –delete -e ssh /var/spool/virtual/ XX.XXX.XX.XXX:/var/spool/virtual rsync -avz –stats –progress –delete -e ssh /var/spool/mail/ XX.XXX.XX.XXX:/var/spool/mail rsync -avz –stats –progress –delete -e ssh /var/spool/cron/ XX.XXX.XX.XXX:/var/spool/cron rsync -avz –stats –progress –delete -e ssh /var/www/ XX.XXX.XX.XXX:/var/www rsync -avz –stats –progress –delete -e ssh /var/log/ XX.XXX.XX.XXX:/var/log rsync -avz –stats –exclude ‘custombuild* –progress –delete -e ssh /usr/local/directadmin/ XX.XXX.XX.XXX:/usr/local/directadmin

Note: For more details about DA’s paths goto this link[http://directadmin.com/paths.html]   05. After rsync, IPs in the various configuration files will be the OLD one, so swap it with IPs of NEW server. Configuration files which have IPs are following:

/etc/httpd/conf/httpd.conf /etc/httpd/conf/extra/httpd-vhosts.conf /etc/httpd/conf/ips.conf /etc/proftpd.conf /etc/proftpd.vhosts.conf /usr/local/directadmin/scripts/setup.txt /usr/local/directadmin/data/admin/ip.list /usr/local/directadmin/data/admin/show_all_users.cache /usr/local/directadmin/data/users/*/user.conf /usr/local/directadmin/data/users/*/httpd.conf /usr/local/directadmin/data/users/*/user_ip.list /usr/local/directadmin/data/users/*/domains/*.conf /usr/local/directadmin/data/users/*/domains/*.ftp /usr/local/directadmin/data/users/*/domains/*.ip_list /var/named/*.db

For editing these files, DA have a script named ipswap.sh. Path of the ipswap.sh script:

/usr/local/directadmin/scripts/ipswap.sh

Use ipswap.sh to swap OLD IP with NEW one:

sh /usr/local/directadmin/scripts/ipswap.sh 174.XXX.XX.XX1 135.XX.XX.XX3 sh /usr/local/directadmin/scripts/ipswap.sh 174.XXX.XX.XX2 135.XX.XX.XX5 sh /usr/local/directadmin/scripts/ipswap.sh 174.XXX.XX.XX3 135.XX.XX.XX4

  06. Go to /usr/local/directadmin/custombuild Perform a

./build all y

This is for data and configuration integrity   07. Start all services in NEW server.

/etc/init.d/named start && \ /etc/init.d/exim start && \ /etc/init.d/proftpd start && \ /etc/init.d/dovecot start && \ /etc/init.d/httpd start && \ /etc/init.d/mysqld start  && \ /etc/init.d/directadmin start  && \ /etc/init.d/crond start

  08. re-rsync /home and /var/lib/mysql

rsync -avz –stats –progress –delete -e ssh /var/lib/mysql/ XX.XXX.XX.XXX:/var/lib/mysql rsync -avz –stats –progress –delete -e ssh /home/ XX.XXX.XX.XXX:/home

  09. Go to OLD server and stop all services and make IP chnages in each zone files in order to point domains to NEW server. For that do: a. Stop all services

/etc/init.d/named stop && \ /etc/init.d/exim stop && \ /etc/init.d/proftpd stop && \ /etc/init.d/dovecot stop && \ /etc/init.d/httpd stop && \ /etc/init.d/mysqld stop && \ /etc/init.d/directadmin stop  && \ /etc/init.d/crond stop

b. Change IPs in each zone files

sed -i ‘s/174.XXX.XX.XX1/135.XX.XX.XX3/g’ *.db sed -i ‘s/174.XXX.XX.XX2/135.XX.XX.XX5/g’ *.db sed -i ‘s/174.XXX.XX.XX3/135.XX.XX.XX4/g’ *.db

c. Start named service

/etc/init.d/named start

  10. Update DirectAdmin License and restart Direct Admin on NEW server

sh /usr/local/directadmin/scripts/getLicense.sh UID LID service directadmin restart

  11. Ask the customers to change all the doamin’s nameserver to NEW server’s nameserver

UPGARDE PHP 4.X TO PHP 5.X ON DIRECTADMIN


To upgrade PHP to 5.x on a DirectAdmin Server, you can use following steps. PHP 5 runs only with apache 2. 

Steps to Upgarde PHP:

A) Installation of PHP:

1) Download the Latest PHP version from PHP site http://www.php.net/downloads.php

2) Untar it using command tar -zxvf php- 5.3.21.tar.gz

3) Go to PHP directory “cd php- 5.3.21

4) Edit and change the option –with-apxs to –with-apxs2 in the file /usr/local/directadmin/customapache/configure.php to configure PHP 5 with apache 2.

Run the Configure


5) /usr/local/directadmin/customapache/configure.php

6) Make

7) Make install


This will create a file /usr/lib/apache/libphp5.so

B) Configuring PHP5 with apache:

1. To configure the newly installed PHP with apache 2 you have to edit httpd.conf file, which is located at

/etc/httpd/conf/httpd.conf

and make following changes:

Search and Comment LoadModule php4_module /usr/lib/apache/libphp4.so. Now LoadModule part of the file should look like as

# Dynamic Shared Object (DSO) Support
#
#LoadModule php4_module /usr/lib/apache/libphp4.so
LoadModule frontpage_module /usr/lib/apache/mod_frontpage.so
LoadModule perl_module /usr/lib/apache/mod_perl.so
LoadModule php5_module /usr/lib/apache/libphp5.so

 

2. Restart Apache using the command

# /etc/init.d/httpd restart


Now create a phpinfo file as info.php in the default document root of the server.

# cd /var/www/html/

# vi info.php

 

Insert following code, save and exit

<?php

phpinfo();

?>

 

Now browse this file using http://ipaddress/info.php, if it shows PHP 5, than you have done it

UPDATING APACHE TO THE LATEST VERSION


You can check the current version of apache by running httpd -v

# httpd –v

Server version: Apache/2.2.21 (Unix)

Server built:   Sep 30 2011 04:23:52


If you wish to update your version of apache to the most recent, run the following:

# cd /usr/local/directadmin/customapache
# ./build clean
# ./build update
# ./build apache_mod_ssl


This should update both the configure options and the version of apache to the most recent version. Once the update has completed, you’ll need to restart apache:

RedHat:

# /sbin/service httpd restart

FreeBSD:

# /usr/local/etc/rc.d/httpd restart

Migrate a DirectAdmin Server to a new DirectAdmin Server


One day my client asked me to migrate a Direct Admin Server to NEW server with improved hardware. He wants this migration with minimum down time.

 

Below are the steps which I did for this migration.

 

01. Check the current versions of Apache, PHP and MySQL and then number of IPs on current running server.

 

In my case versions are as following:

Apache/2.2.13

PHP 5.2.17 (cli)

MySQL 5.0

IP details:

174.XXX.XX.XX1

174.XXX.XX.XX2

174.XXX.XX.XX3

 

02. Install directadmin in custom mode on NEW server.

 

On NEW server I installed the following versions:

Apache 2.2 [it is the latest version available via DA’s custombuild]

PHP 5.2 [It is the latest version of PHP available via DA’s custombuild]

MySQL 5.1 [It is the latest version of MySQL available via DA and also this version supports “TRIGGER”(5.0 does not support “TRIGGER” in each mysql user level)]

Make DA and all other services down on NEW server:

/etc/init.d/named stop && \

/etc/init.d/exim stop && \

/etc/init.d/proftpd stop && \

/etc/init.d/dovecot stop && \

/etc/init.d/httpd stop && \

/etc/init.d/mysqld stop && \

/etc/init.d/directadmin stop  && \

/etc/init.d/crond stop

 

03. Upgrade MySQL on OLD server to 5.1

For upgrading MySQL do:

 

a. Change CWD to /usr/local/directadmin/custombuild/

 

b. Change mysql options in options.conf. So it should be like following.

mysql=5.1

mysql_inst=yes

mysql_backup=yes

 

c. Update build script

./build update_script

 

d. Update mysql

./build mysql d

 

04. Rsync all needed configuration files, /home and /var/lib/mysql from OLD server to NEW server.

My rsync script for DA to DA migration:

rsync -avz –stats –progress –delete -e ssh /var/lib/mysql/ XX.XXX.XX.XXX:/var/lib/mysql

rsync -avz –stats –progress –delete -e ssh /home/ XX.XXX.XX.XXX:/home

rsync -avz –stats –progress -e ssh /etc/passwd XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/shadow XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/group XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/exim.conf XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/exim.pl XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/system_filter.exim XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/exim.crt XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/exim.key XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/proftpd.conf XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/proftpd.vhosts.conf XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/proftpd.passwd XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /etc/named.conf XX.XXX.XX.XXX:/etc

rsync -avz –stats –progress -e ssh /root/.my.cnf XX.XXX.XX.XXX:/root

rsync -avz –stats –progress –delete -e ssh /etc/virtual/  XX.XXX.XX.XXX:/etc/virtual

rsync -avz –stats –progress –delete -e ssh /etc/httpd/conf/ XX.XXX.XX.XXX:/etc/httpd/conf

rsync -avz –stats –progress –delete -e ssh /var/named/ XX.XXX.XX.XXX:/var/named

rsync -avz –stats –progress –delete -e ssh /var/spool/virtual/ XX.XXX.XX.XXX:/var/spool/virtual

rsync -avz –stats –progress –delete -e ssh /var/spool/mail/ XX.XXX.XX.XXX:/var/spool/mail

rsync -avz –stats –progress –delete -e ssh /var/spool/cron/ XX.XXX.XX.XXX:/var/spool/cron

rsync -avz –stats –progress –delete -e ssh /var/www/ XX.XXX.XX.XXX:/var/www

rsync -avz –stats –progress –delete -e ssh /var/log/ XX.XXX.XX.XXX:/var/log

rsync -avz –stats –exclude ‘custombuild* –progress –delete -e ssh /usr/local/directadmin/ XX.XXX.XX.XXX:/usr/local/directadmin

 

Note: For more details about DA’s paths goto this link[http://directadmin.com/paths.html]

 

05. After rsync, IPs in the various configuration files will be the OLD one, so swap it with IPs of NEW server.

Configuration files which have IPs are following:

/etc/httpd/conf/httpd.conf

/etc/httpd/conf/extra/httpd-vhosts.conf

/etc/httpd/conf/ips.conf

/etc/proftpd.conf

/etc/proftpd.vhosts.conf

/usr/local/directadmin/scripts/setup.txt

/usr/local/directadmin/data/admin/ip.list

/usr/local/directadmin/data/admin/show_all_users.cache

/usr/local/directadmin/data/users/*/user.conf

/usr/local/directadmin/data/users/*/httpd.conf

/usr/local/directadmin/data/users/*/user_ip.list

/usr/local/directadmin/data/users/*/domains/*.conf

/usr/local/directadmin/data/users/*/domains/*.ftp

/usr/local/directadmin/data/users/*/domains/*.ip_list

/var/named/*.db

 

For editing these files, DA have a script named ipswap.sh. 🙂

 

Path of the ipswap.sh script:

/usr/local/directadmin/scripts/ipswap.sh

Use ipswap.sh to swap OLD IP with NEW one:

sh /usr/local/directadmin/scripts/ipswap.sh 174.XXX.XX.XX1 135.XX.XX.XX3

sh /usr/local/directadmin/scripts/ipswap.sh 174.XXX.XX.XX2 135.XX.XX.XX5

sh /usr/local/directadmin/scripts/ipswap.sh 174.XXX.XX.XX3 135.XX.XX.XX4

 

06. Go to /usr/local/directadmin/custombuild

Perform a

./build all y

This is for data and configuration integrity

 

07. Start all services in NEW server.

/etc/init.d/named start && \

/etc/init.d/exim start && \

/etc/init.d/proftpd start && \

/etc/init.d/dovecot start && \

/etc/init.d/httpd start && \

/etc/init.d/mysqld start  && \

/etc/init.d/directadmin start  && \

/etc/init.d/crond start

 

08. re-rsync /home and /var/lib/mysql

rsync -avz –stats –progress –delete -e ssh /var/lib/mysql/ XX.XXX.XX.XXX:/var/lib/mysql

rsync -avz –stats –progress –delete -e ssh /home/ XX.XXX.XX.XXX:/home

 

09. Go to OLD server and stop all services and make IP chnages in each zone files in order to point domains to NEW server.

For that do:

a. Stop all services

/etc/init.d/named stop && \

/etc/init.d/exim stop && \

/etc/init.d/proftpd stop && \

/etc/init.d/dovecot stop && \

/etc/init.d/httpd stop && \

/etc/init.d/mysqld stop && \

/etc/init.d/directadmin stop  && \

/etc/init.d/crond stop

b. Change IPs in each zone files

sed -i ‘s/174.XXX.XX.XX1/135.XX.XX.XX3/g’ *.db

sed -i ‘s/174.XXX.XX.XX2/135.XX.XX.XX5/g’ *.db

sed -i ‘s/174.XXX.XX.XX3/135.XX.XX.XX4/g’ *.db

 

c. Start named service

/etc/init.d/named start

 

10. Update DirectAdmin License and restart Direct Admin on NEW server

sh /usr/local/directadmin/scripts/getLicense.sh UID LID

service directadmin restart

 

11. Ask the customers to change all the doamin’s nameserver to NEW server’s nameserver

Direct Admin Server Setup


Direct Admin Server Setup, to those techs who want to Setup a Direct Admin You can use the following code by simply copying one entire section and paste it on a shell. For example, if you need to install mod_security, you only need to copy mod_security section of this article and paste it in your shell. Doing so will do many jobs on one shot such as downloading mod_sec source, compilation, installation, addition of httpd configurations and rules. Hope this will help some one. 🙂

Server Environment:-

OS : CentOS

Control Panel : Direct Admin

 

Installing Direct Admin

### Direct Admin ###

yum -y install gcc gcc-c++ flex && \

wget http://www.directadmin.com/setup.sh && \

chmod 755 setup.sh && \

sh setup.sh

 

Installing MRTG

### GD ###

wget http://techtrunch.com/downloads/gd-2.0.35.tar.gz -O /root/gd-2.0.35.tar.gz && \

tar -xzvf gd-2.0.35.tar.gz && \

cd gd-2.0.35 && \

./configure && \

make && \

make check && \

make install

### MRTG###

wget http://oss.oetiker.ch/mrtg/pub/mrtg.tar.gz && \

tar -xzvf mrtg.tar.gz && \

cd mrtg-* && \

./configure –prefix=/usr/local/mrtg-2 && \

make && \

make install && \

mkdir /var/www/html/mrtg  && \

mkdir /var/www/html/mrtg/core && \

chmod 700 /var/www/html/mrtg/core && \

wget http://techtrunch.com/downloads/mrtg.cfg -O /var/www/html/mrtg/core/mrtg.cfg && \

wget http://techtrunch.com/downloads/system -O /var/www/html/mrtg/core/system && \

chmod +x /var/www/html/mrtg/core/system && \

ldconfig && \

env LANG=C /usr/local/mrtg-2/bin/mrtg /var/www/html/mrtg/core/mrtg.cfg && \

env LANG=C /usr/local/mrtg-2/bin/mrtg /var/www/html/mrtg/core/mrtg.cfg && \

echo “*/5 * * * * root /usr/local/mrtg-2/bin/mrtg /var/www/html/mrtg/core/mrtg.cfg” >> /etc/crontab

Installing mod_security

### Install Modsecurity in DA ###

wget http://nchc.dl.sourceforge.net/project/mod-security/modsecurity-apache/2.5.12/modsecurity-apache_2.5.12.tar.gz && \

tar -xzvf modsecurity-apache_* && \

cd modsecurity-apache_*/apache2 && \

./configure –with-apxs=/usr/sbin/apxs && \

make && \

make test && \

make mlogc && \

make install && \

echo “<IfModule mod_security2.c>

SecRuleEngine On

SecAuditEngine RelevantOnly

SecAuditLog /var/log/httpd/modsec_audit.log

SecDebugLog /var/log/httpd/modsec_debug_log

SecDebugLogLevel 0

SecDefaultAction “phase:2,deny,log,status:406”

SecRule REMOTE_ADDR “^127.0.0.1$” nolog,allow

Include conf/modsec/*.conf

</IfModule>” >> /etc/httpd/conf/extra/httpd-includes.conf && \

mkdir /etc/httpd/conf/modsec && \

cd /etc/httpd/conf/modsec && \

wget http://techtrunch.com/downloads/rules_of_cpanel.conf && \

touch /var/log/httpd/modsec_audit.log && \

touch /var/log/httpd/modsec_debug_log && \

chmod 777 /var/log/httpd/modsec* && \

/etc/init.d/httpd restart

Installing CSF, IPtable’s front end

### CSf ###

yum -y install perl-libwww-perl && \

wget http://www.configserver.com/free/csf.tgz && \

tar -xzf csf.tgz && \

cd csf && \

sh install.sh

If you followed default configuration, i.e. CLI, for apache – php while installing you need not follow below steps. But if you followed suphp, you need to follow below given steps.

### SuPhP ###

cd /usr/local/directadmin/scripts/custom && \

wget http://techtrunch.com/downloads/user_destroy_pre.sh && \

wget http://techtrunch.com/downloads/user_create_post.sh && \

chmod 755 /usr/local/directadmin/scripts/custom/*.sh && \

chown diradmin:diradmin /usr/local/directadmin/scripts/custom/*.sh && \

cp /usr/local/directadmin/data/templates/virtual_host2* /usr/local/directadmin/data/templates/custom/

and open each file in /usr/local/directadmin/data/templates/custom/ and insert following

SetEnv PHP_INI_SCAN_DIR /usr/local/directadmin/data/users/|USER|/php/

between

|*if SUPHP=”1″|

and

|*endif|

Make following function modifications in php.ini [first one is only for SuPHP server and second one is to secure php and so can apply to both CLI and SuPHP server]

open_basedir = /var/www/html/:/tmp/:/etc/virtual/

disable_functions = passthru, shell_exec, escapeshellarg, escapeshellcmd, proc_close, proc_open, ini_alter, popen, show_source, proc_nice, proc_terminate, proc_get_status, proc_close, pfsockopen, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid,dl, virtual,exec,system

 

Installing SNMP

yum install net-snmp net-snmp-utils net-snmp-devel -y

Secure the /tmp and /dev/shm

Managing the Apache Server


Download and Install The Apache Package

_______________________________________________________________________________

Most RedHat and Fedora Linux software products are available in the RPM format. When searching for the file, remember that the Apache RPM’s filename usually starts with the word httpd followed by a version number, as in httpd-2.0.48-1.2.rpm. It is best to use the latest version of Apache.

When searching for the file, remember that the Redhat / Fedora Apache RPM package’s filename usually starts with the word httpd followed by a version number, as in httpd-2.0.48-1.2.rpm. With Ubuntu / Debian the package name will have the apache prefix instead.

Managing Apache’s httpd daemon is easy to do, but the procedure differs between Linux distributions. Here are some things to keep in mind.

  1. Firstly, different Linux distributions use different daemon management systems. Each system has its own set of commands to do similar operations. The most commonly used daemon management systems are SysV and Systemd.
  2. Secondly, the daemon name needs to be known. In this case the name of the daemon is httpd.

Armed with this information you can know how to:

A. Start your daemons automatically on booting :

Example :

The chkconfig command can be used to adjust which applications start at each runlevel.

[root@ tmp]# chkconfig --list
keytable 0:off 1:on  2:on  3:on 4:on  5:on 6:off
atd      0:off 1:off 2:off 3:on 4:on  5:on 6:off
syslog   0:off 1:off 2:on  3:on 4:on  5:on 6:off
gpm      0:off 1:off 2:on  3:on 4:on  5:on 6:off
httpd    0:off 1:off 2:off 3:on 4:off 5:on 6:off
...
...

1. Use chkconfig to get a listing of sendmail’s current startup options :

[root@ tmp]# chkconfig --list | grep httpd
httpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
[root@ tmp]#

2. Switch off sendmail starting up in levels 3 and 5 The chkconfig command with the –level switch indicates that some action needs to be done at the runlevels entered as its values. In this case we want sendmail not to be started when entering runlevels 3 and 5 :

[root@ tmp]# chkconfig --level 35 httpd off
[root@ tmp]#

By not specifying the runlevels with the –level switch, chckconfig will make the changes for runlevels 3 and 5 automatically:

[root@ tmp]# chkconfig httpd off
Because the intention is to permanently shutdown sendmail permanently, we might also have to stop it from running now. 

[root@ tmp]# service httpd stop
Shutting down httpd: [  OK  ]
Shutting down httpd: [  OK  ]
[root@ tmp]#

3. Double-check that sendmail will not start up We can then use chkconfig to double-check our work.

[root@ tmp]# chkconfig --list | grep httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@ tmp]#

4. Turn on sendmail again To reactivate sendmail, we can use chkconfig once more, but with the on argument. Start sendmail again to get it running immediately, not just after the next reboot.

[root@ tmp]# chkconfig httpd on
[root@ tmp]# chkconfig --list | grep httpd
httpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
[root@ tmp]# service httpd start
Starting httpd: [  OK  ]
Starting httpd: [  OK  ]
[root@ tmp]#

B. Stop, start and restart them later on during troubleshooting or when a configuration file change needs to be applied :

[root@ tmp]# service httpd stop
Shutting down httpd: [  OK  ]
Shutting down httpd: [  OK  ]
[root@ tmp]# service httpd start
Starting up httpd: [  OK  ]
Starting up httpd: [  OK  ]
[root@ tmp]# service httpd restart

How to migrate a Addon domain in cPanel


On the old server

#cd /home/usename/public_html/

#du -sch Addon domain
XXMB

home/usename/public_html # tar -cvzf Addon domain.tar.gz Addon domain
home/usename/public_html # cp Addon domain.tar.gz /usr/local/apache/htdocs
home/usename/public_html # cd /usr/local/apache/htdocs
usr/local/apache/htdocs # chmod 644 Addon domain.tar.gz
usr/local/apache/htdocs # hostname
server.xxxx.xxx

Now login in to the new server where you have already created the new cpanel account
***Note the new account should have the same user name as the old account

# cd /home/usename/public_html

home/usename/public_html # wget http:server.xxxx.xxx/Addon domain.tar.gz
home/usename/public_html # tar -xvzf Addon domain.tar.gz

Now check if document root set corretly if not you may have to change it

To change the document root this changes need to be done in two files

home/usename/public_htm # vi /var/cpanel/userdata/usename/Addon domain
Change the line where it says documentroot:
home/usename/public_htm # vi /etc/httpd/conf/httpd.conf
find the Addon domain in this file and change the document root
Now All the data is copied on the new server But this not it now you need to migrat the data base and also the mails and the etc folder.
So go back to old server find the Data Base NAME to fine the it Data Base NAME you can check the config.php file
For eg if it is wordpress site you can get that info from wp-config.php

home/usename/public_htm # mysqldump Data Base NAME > Data Base NAME.sql
home/usename/public_htm # cp Data Base NAME.sql /usr/local/apache/htdocs
/usr/local/apache/htdocs # chmod 644 Data Base NAME.sql

Now login in to the new server

home/usename/public_html # wget http:server.xxxx.xxx/Data Base NAME.sql
Now the you have got the Data Base backup on the new server but the data base is not present on the server so you will have to creat the data base

So loging to cPanel and create the Data Base with the same name and also the usename and the password for that

Ones you have created the Data Base

home/usename/public_html # mysql Data Base NAME < Data Base NAME.sql

NOw the database is migrated so onlt mails and etc is left

Go back to old server

home/usename/public_html # cd home/usename/mail
home/usename/mail # tar -cvzf Addon domain.tar.gz Addon domain
home/usename/mail # cp Addon domain.tar.gz /usr/local/apache/htdocs
home/usename/mail # cd /usr/local/apache/htdocs
usr/local/apache/htdocs # chmod 644 Addon domain.tar.gz

Now login in to the new server

home/usename/public_html # wget http:server.xxxx.xxx/Addon domain.tar.gz
home/usename/public_html # cd /mail
home/usename/public_html/mail # mv ../pensiontransferoptions.co.uk .
home/usename/public_html/mail # chown usename:usename * -R

Now the last thing is /etc

Go back to old server

home/usename/public_html # cd home/usename/etc
home/usename/etc # tar -cvzf Addon domain.tar.gz Addon domain
home/usename/mail # cp Addon domain.tar.gz /usr/local/apache/htdocs
home/usename/mail # cd /usr/local/apache/htdocs
usr/local/apache/htdocs # chmod 644 Addon domain.tar.gz

Now login in to the new server

home/usename/public_html # wget http:server.xxxx.xxx/Addon domain.tar.gz
home/usename/public_html # cd /etc
home/usename/public_html/etc # mv ../pensiontransferoptions.co.uk .
home/usename/public_html/etc # chown usename:mail * -R

Now you can logging to the new server cPanel and check

how to install Elastix on centos5 using Yum


Get Elastix ISO, install kernel

Because the structure is subject to change, it is more reliable to go to http://sourceforge.net/projects/elastix/ and get a reliable mirror download link.

cd /
wget http://voxel.dl.sourceforge.net/sourceforge/elastix/Elastix-1.5.2-stable-i386-bin-31mar2009.iso
mkdir /mnt/elastix-cd
mount -o loop /Elastix-1.5.2-stable-i386-bin-31mar2009.iso /mnt/elastix-cd
for 1.6: wget http://sourceforge.net/projects/elastix/files/Elastix%20PBX%20Appliance%20Software/1.6/Elastix-1.6.0-i386-bin-29Oct2009.iso In OpenVZ you will have to mount using fuse-iso. Further the hard node (the primary server) must be enabled to run fuse and the container must be restarted.

As of writing, the Elastix kernel is 2.6.18-92.1.22.el5. You should verify this:

ls /mnt/elastix-cd/Elastix/kernel-2.*
rpm -ivh –oldpackage /mnt/elastix-cd/Elastix/kernel-2.6.18-92.1.22.el5.i686.rpm
This should set the elastix kernel as the default in grub but you can check the /etc/grub.conf to be sure.

Add the elastix CD as a yum repo

Note: DO NOT create the elastix updates repo because it will conflict with the dependents required by the RPMs in the elastix-cd. This repo will be created automatically upon installation.

Create a file elastix-cd.repo in /etc/yum.repos.d :

# nano /etc/yum.repos.d/elastix-cd.repo
Now paste the follow without a space before each line in:

[elastix-cd]
name=Elastix RPM Repository for CentOS CD
baseurl=file:///mnt/elastix-cd/Elastix/
gpgcheck=0
enabled=1

for Elastix 2.0.3 on Centos 5.7
[elastix-cd]
name=Elastix RPM Repository for CentOS CD
baseurl=file:///mnt/elastix-cd/
gpgcheck=0
enabled=1
note: Don’t leave a space before each line in the text in elastix-cd.repo

On 1.6, I had to remove the /Elastix for repo to work.

baseurl=file:///mnt/elastix-cd
Everything from above in .repo file the same other than this one line. Don’t know if this is same for other ones.

You will need to remove or disable the elastix-CD repo when you are done as the CD image will not auto mount on boot.

Install elastix using yum

It is very important that you’re in the ”/mnt/elastix-cd/Elastix” folder before you start the installation.

# cd /mnt/elastix-cd/Elastix
# yum -y –nogpgcheck install asterisk* elastix-* freeze fxload kernel-module-rhino* libmfcr2 lzop perl-HTML-TokeParser-Simple perl-WWW-Mechanize
# cd /
# yum -y update
Install webmin

wget http://sourceforge.net/projects/webadmin/files/webmin/1.610/webmin-1.610-1.noarch.rpm
rpm –install webmin-1.610-1.noarch.rpm
In your browser, go to 127.0.0.1:10000 and “Webmin-Webmin Configuration-Webmin Modules” and then
install 3rd party Modules: SSH2 Login
Reboot

# reboot

Restart your server and you should be able to see elastix login at http://yourserver-ip-or-domain.com/

Get Asterisk Call Notifications On-mIRC Server


Now My Asterisk server always reports me How many calls I get and when I get them.

# /etc/asterisk

For Incoming calls

#  vi extensions_custom.conf

Add following to the end of extensions_custom.conf

[macro-user-callerid-custom]
exten => s,1,system( echo “Incoming call from ${CALLERID(num)}” >> /var/log/asterisk/calls)

This will concat all incoming calls to a file in /var/log/asterisk/calls

Now for outgoing calls

open extensions_additional.conf

#  vi extensions_additional.conf

goto section [macro-user-callerid] and insert following line. Mine looks like

[macro-user-callerid]
include => macro-user-callerid-custom
exten => s,1,system( echo “Incoming call from ${CALLERID(num)}” >> /var/log/asterisk/calls)
exten => s,2,Set(AMPUSER=${IF($[“foo${AMPUSER}” = “foo”]?${CALLERID(number)}:${AMPUSER})})
exten => s,n,GotoIf($[“${CHANNEL:0:5}” = “Local”]?report)
Now do an Asterisk Reload from Terminal Console
# asterisk -r
trixbox*CLI> reload
trixbox*CLI> exit

Now check whether you are getting call logged into /var/log/asterisk/calls by placing calls to any destinations by

# tail -f /var/log/asterisk/calls

So half of the part is done. :D
Now we need to send this log file to an IRC channel.
So now we will use a Perl program which will send IRC messages. It will run like a daemon

#!/usr/bin/perl

while(1)
{
open FILE , “<” , “/var/log/asterisk/calls” or die $! ;
my @lines = <file> ;
if ($lines[0] )
{
close FILE ;
open FILE , “>” , “/var/log/asterisk/calls” or die $! ;
close FILE ;
$server = “YOUR IRC SERVER NAME”;  # you change everything from server to pass
$port = PORT NO;
$ident = “asterisk”;
$realname = “asterisk” ;
$nick = “asterisk”;
$chan = “#aster”;
use IO::Socket;
print ” Trying to connect” ;
$irc=IO::Socket::INET->new(PeerAddr=>$server,PeerPort=>$port,Proto=>’tcp’)or die “DEAD!” ;
print “Socket created” ;
print $irc “NICK asteriskn” ;
print $irc “USER $ident 8 * :$realnamen” ;
sleep(5) ;
print $irc “JOIN #astern”;
while(defined($in=<$irc>))
{
if($in=~/PING(.*)/){print $irc “PONG :$1n”;}
foreach $line (@lines){
if($test ne $line)  # Avoid duplicate logs
{
$test = $line ;
print $irc “PRIVMSG #aster :$linen” ;
}
}
last ;
}
close($irc);
}
else
{
close FILE ;
}
sleep 5 ;
}

Make The Perl file executable and execute. It will run as daemon in your system with 5 seconds sleep. :)

# chmod 775 perl_irc.pl
# ./perl_irc.pl