Wednesday, June 13, 2012

Asterisk 1.8 on Debian Squeeze 6.0


System requirements:
Operating System: debian Squeeze 6.0

1. Install Debian Squeeze 6.0
2. Edit the debian source list.
$nano /etc/apt/sources.list
deb http://ftp.de.debian.org/debian/ squeeze main
deb-src http://ftp.de.debian.org/debian/ squeeze main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

deb http://ftp.de.debian.org/debian/ squeeze-updates main
deb-src http://ftp.de.debian.org/debian/ squeeze-updates main

deb http://www.debian-multimedia.org testing main

deb http://backports.debian.org/debian-backports squeeze-backports main

3. Update it!
$apt-get update

OPTIONAL: Incase you encounter a GPG error.
$apt-cache search keyring | grep debian
$apt-get install debian-multimedia-keyring
$apt-get update

4. install the dependencies
$apt-get install build-essential gcc make linux-headers-2.6.32-5-686 libxml2-dev libncurses5-dev libgtk2.0-dev libnewt0.52 libnewt-dev libssl-dev


5. Download the asterisk package. I used asterisk 1.8.3
$wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.3.3.tar.gz

6. Extract it!
$tar -zxvf asterisk-1.8-current.tar.gz

7. go to the directory and install it.
$ cd /usr/src/asterisk-1.8.3
$./configure
$make
$make install
$make samples
$make config
$make install-logrotate

8.Run the asterisk to see if the installation works!
$asterisk -vvvvvvvvvvc


9. Automate the asterisk service on startup
$update-rc.d asterisk defaults


10. Change your date and time.
$dpkg-reconfigure tzdata

Current default time zone: 'Asia/Manila'
Local time is now:      Fri Feb 17 08:22:36 PHT 2012.
Universal Time is now:  Fri Feb 17 00:22:36 UTC 2012.

11. update your date and time.
$apt-get install ntpdate
$ntpdate time.nist.gov
$ntpdate time.windows.com



12. install "screen"
$apt-get install screen


13. install sox
$apt-get install sox

14. install lame
#go to /usr/src and download the latest version of lame
$wget http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.4.tar.gz/download
#Extract it!
$tar -zxvf download
$mv download lame-3.99.4
#go to the lame directory
$cd /usr/src/lame-3.99.4
$./configure
$make
$make install




******************************************************************

install Dahdi and Libpri for Meetme
1. Download dahdi and libri
$cd /usr/src/
$wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
$wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz

2. Extract it
$tar -zxvf libpri-1.4-current.tar.gz
$tar -zxvf dahdi-linux-complete-current.tar.gz

3. Go to libri directory and install
$cd /usr/src/libpri-1.4.12
$make
$make install


4. Go to Dahdi directory and install
$cd /usr/src/dahdi-linux-complete-2.6.0+2.6.0
$make
$make install
$make config


5. open /etc/dahdi/modules and remove all the devices that you don't have
$nano /etc/dahdi/modules
#uncomment all the devices you don't have

6. check if dahdi is working
$dahdi_genconf

7. rebuild asterisk with meetme. install the dependencies for the GUI of menuselect.
$apt-get install libnewt0.52 libnewt-dev
$cd asterisk-1.8.3
$./configure
#check if the meetme module is included
$make menuselect
#it should be under > application > app_meetme
$make
$make install
$make samples
$make config

OTRS 3.1.5 on debian squeeze 6.0


1. install all depencies/packages
apt-get install apache2 perl mysql-server libnet-ldap-perl libgd-graph-perl libapache2-mod-perl2 libsoap-lite-perl libnet-dns-perl libpdf-api2-perl libdigest-md5-perl make gcc


2. configure apache2
#enable rewrite abilities
a2enmod rewrite

#create a file in the /etc/apache2/sites-available/
cd /etc/apache2/sites-available/
nano otrs
#inside the otrs file
#----start-----
<VirtualHost *:80>
     ServerAdmin lgarcia@wegcs.com
     ServerName otrs.local
     ServerAlias www.otrs.local
     DocumentRoot /srv/www/otrs.local/public_html/
     ErrorLog /srv/www/otrs.local/logs/error.log
     CustomLog /srv/www/otrs.local/logs/access.log combined
</VirtualHost>
#----end-------
#All of the files for the sites that you host will be located in directories that exist underneath /srv/www. You can symbolically link these directories to other locations if you need them to exist in other places.
#ErrorLog and CustomLog entries are suggested for more fine-grained logging, but are not required. If they are defined (as shown above), the logs directories must be created before you restart Apache.

#create the site with public_html and logs inside the folder /srv/www
mkdir -p /srv/www/otrs.local/public_html
mkdir /srv/www/otrs.local/logs

#enable site
a2ensite otrs.local

#reload apache2
/etc/init.d/apache2 reload


ln -s /opt/otrs /srv/www/otrs.local/public_html/otrs

3. download the otrs package and extract
#go to the site
cd /opt/otrs

#download the OTRS installer package from source
wget http://ftp.otrs.org/pub/otrs/otrs-3.1.5.tar.gz
#extract
tar xvf otrs-3.1.5.tar.gz

#move the extracted folder to otrs
mv otrs-3.1.5 otrs
ln -s /opt/otrs /srv/www/otrs.local/public_html/otrs

#4. verify that all perl modules are working
./bin/otrs.CheckModules.pl

#5. create user and group for OTRS
useradd -d /opt/otrs/ -c 'OTRS user' otrs
usermod -G www-data otrs


#6 copy the configuration files
cp Kernel/Config.pm.dist Kernel/Config.pm
cp Kernel/Config/GenericAgent.pm.dist Kernel/Config/GenericAgent.pm

#7. check that all modules required for running otrs are installed
perl -cw /opt/otrs/bin/cgi-bin/index.pl #should see "syntax ok"
perl -cw /opt/otrs/bin/otrs.PostMaster.pl #should see "syntax ok"



#8. we give the permissions to the folder otrs
bin/otrs.SetPermissions.pl --otrs-user=otrs --web-user=www-data --otrs-group=www-data --web-group=www-data /opt/otrs


#9 edit the configuration of apache for the otrs site
#create a symoblic link on the apache2 httpd conf
ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/conf.d/otrs.conf