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 squeeze main
deb-src squeeze main

deb squeeze/updates main
deb-src squeeze/updates main

deb squeeze-updates main
deb-src squeeze-updates main

deb testing main

deb 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

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
$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

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
#Extract it!
$tar -zxvf download
$mv download lame-3.99.4
#go to the lame directory
$cd /usr/src/lame-3.99.4
$make install


install Dahdi and Libpri for Meetme
1. Download dahdi and libri
$cd /usr/src/

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 install

4. Go to Dahdi directory and install
$cd /usr/src/dahdi-linux-complete-2.6.0+2.6.0
$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

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
#check if the meetme module is included
$make menuselect
#it should be under > application > app_meetme
$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
<VirtualHost *:80>
     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
#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
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

#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/ Kernel/
cp Kernel/Config/ Kernel/Config/

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

#8. we give the permissions to the folder otrs
bin/ --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