Posts Tagged ‘ubuntu’

This is long time draft before being published,,,,

You may known that OpenSIPS is the project continuation of OpenSER, tough Kamailio is said to be closer to OpenSER. But after all, it’s all about taste,,lol 😀

OpenSIPS will be best deployed on Sun machine running Solaris OS to obtain it’s best performance. But installing on Debian or Ubuntu machine will much easier. OpenSIPS modules depend on various package which is hard to get for Solaris. Debian or Ubuntu will be the best OS for installing practice. To get familiar with OpenSIPS, you’ll may need to practice installing too :D.

OpenSIPS is recommended to install with DNS. So that you wouldn’t have a lot of changes to move the system from a machine to another. These steps I’ve used to build a presence system server with TLS enabled. If you don’t need any presence enabled, you may leave mi_xmlrpc, xcap_client, presence, presence_xml, presence_mwi, presence_dialoginfo, pua, pua_bla, pua_mi, pua_usrloc, pua_xmpp,  pua_dialoginfo, and TLS=1 commented.
It’s hard to find a good OpenSIPS installation tutorial, so I try to write these steps which is work for me. Hopefully these steps will help you much 😀

1. sudo apt-get install bison bison++ bisonc++
2. sudo apt-get install flex
3. sudo apt-get install libsctp1
4. sudo apt-get install mysql-server
5. sudo apt-get install libmysqlclient-dev
6. sudo apt-get install libxml2-dev
7. sudo apt-get install libexpat1-dev
8. sudo apt-get install libradius-ng2 libradius-ng-dev
9. sudo apt-get install libcurl3-dev
10. sudo apt-get install libxmlrpc-c3 libxmlrpc-c3-dev
11. sudo apt-get install libperl-dev
12. sudo apt-get install libsnmp-dev
13. sudo apt-get install libconfuse0 libconfuse-dev
14. sudo apt-get install build-essential
15. sudo tar xvfz opensips-1.5.0-tls_src.tar.gz
16. edit opensips-1.5.0-tls/Makefile/
change : #TLS=1
to : TLS=1
remove : – jabber
– cpl-c
– xmpp
– rls
– mi_xmlrpc
– xcap_client
– db_mysql
– presence
– presence_xml
– presence_mwi
– presence_dialoginfo
– pua
– pua_bla
– pua_mi
– pua_usrloc
– pua_xmpp
– pua_dialoginfo
– perl
– snmpstats
– peering
– carrierroute
from : exclude_modules=
17. sudo make
18. sudo make install
19. sudo cp opensips-1.5.0-tls/packaging/debian-etch/opensips.default /etc/default/opensips
sudo cp opensips-1.5.0-tls/packaging/debian-etch/opensips.init /etc/init.d/opensips
20. sudo nano /etc/default/opensips
change : RUN_OPENSIPS=no
to : RUN_OPENSIPS=yes
21. sudo nano /etc/init.d/opensips
change : DAEMON=/usr/sbin/opensips
RUN_OPENSIPS=no
to : DAEMON=/usr/local/sbin/opensips
RUN_OPENSIPS=yes
22. sudo chmod +x /etc/init.d/opensips
23. sudo groupadd opensips
sudo useradd -g opensips opensips
24. sudo mkdir /var/run/opensips
sudo chmod 777 /var/run/opensips
25. sudo chmod 777 /usr/local/etc/opensips/
26. sudo apt-get install bind9
27. sudo nano /etc/bind9/named.conf
add : zone “opensips.org” {
type master;
file “/etc/bind/db.opensips”;
};

zone “18.14.10.in-addr.arpa” {
type master;
file “/etc/bind/db.18.14.10″;
};
28. Create new RR file

sudo nano /etc/bind9/db.opensips
write :

;
; BIND data file for opensips.org
;
$TTL 604800
@ IN SOA opensips.org. root.opensips.org. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS opensips.org.
opensips.org. IN A 10.14.18.56
29.  Create new RR file

sudo nano /etc/bind9/db.18.14.10
add :

;
; BIND data file for opensips.org
;
$TTL 604800
@ IN SOA opensips.org. root.opensips.org. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS opensips.org.
opensips.org. IN A 10.14.18.56
30. sudo nano /etc/bind9/named.conf.option
add : recursion no;
in : option { }
31. sudo /etc/init.d/bind9 restart
32. sudo nano /usr/local/etc/opensips/opensipsctlrc
uncomment : # SIP_DOMAIN=opensips.org
# DBENGINE=MYSQL
# DBHOST=localhost
# DBNAME=opensips
# DBRWUSER=opensips
# DBRWPW=”opensipsrw”
# DBROUSER=opensipsro
# DBROPW=opensipsro
# DBROOTUSER=”root”
# USERCOL=”username”
# INSTALL_EXTRA_TABLES=ask
# INSTALL_PRESENCE_TABLES=ask
uncomment and change :
# PID_FILE=/var/run/opensips.pid
to : PID_FILE=/var/run/opensips/opensips.pid
33. sudo mysqladmin -u root password ‘root’
34. sudo opensipsdbctl create
35. sudo nano /usr/local/etc/opensips/opensips.cfg
uncomment : #loadmodule “db_mysql.so”
#loadmodule “auth.so”
#loadmodule “auth_db.so”

#modparam(“usrloc”, “db_mode”, 2)
#modparam(“usrloc”, “db_url”,
# “mysql://opensips:opensipsrw@localhost/opensips”)

#modparam(“auth_db”, “calculate_ha1”, yes)
#modparam(“auth_db”, “password_column”, “password”)
#modparam(“auth_db”, “db_url”,
# “mysql://opensips:opensipsrw@localhost/opensips”)

comment : modparam(“usrloc”, “db_mode”, 0)
36. sudo nano mysql -u root -p
mysql> GRANT ALL PRIVILEGES ON *.* TO opensips@localhost IDENTIFIED BY ‘opensipsrw’;
mysql> GRANT ALL PRIVILEGES ON *.* TO opensips@127.0.0.1 IDENTIFIED BY ‘opensipsrw’;
37. start opensips, choose one of these method:
1. sudo opensipsctl start
2. sudo /etc/init.d/opensips start
38. sudo opensipsctl add 1001 1001

You can use any kind of SIP client you have. These install will be default enable your SIP chat.

Comment me if you have any error on installation. Feel free to try 😀

Bingung sebenernya bikin judulnya 😀

Maksutnya disini adalah membuat file eksekusi untuk mengaktifkan dan mematikan repo lokal ubuntu. Sebelumnya, siapkan dulu repo lokalnya. Berikut langkah-langkahnya:

  • Untuk pembuatan repo lokal, saya lebih memilih mengkopikan seluruh image repo Ubuntu 8.10 berformat iso ke harddisk. Misal saya taruh di /home dengan nama file 1.iso untuk DVD-1, 2.iso untuk DVD-2, dan seterusnya.
  • Buat direktori repo1, repo2, hingga repo6 di /media. Direktori ini nantinya digunakan sebagai mounting point image repo.
  • Kemudian buat file /etc/apt/sources.list yang baru yang isinya:

deb file:///media/repo1 intrepid main restricted
deb file:///media/repo2 intrepid main restricted multiverse
deb file:///media/repo3 intrepid universe
deb file:///media/repo4 intrepid universe
deb file:///media/repo5 intrepid universe
deb file:///media/repo6 intrepid universe

(Jangan lupa backup dl sources.list yang asli :D)

Nah, sekarang saat nya membuat file eksekusi yang akan menggunakan bash shell programming. Buat file baru di /home dengan nama “aktifin_repo” yang isinya sebagai berikut:

#!/bin/sh

mount /home/1.iso /media/repo1 -t iso9660 -o loop
mount /home/2.iso /media/repo2 -t iso9660 -o loop
mount /home/3.iso /media/repo3 -t iso9660 -o loop

mount /home/4.iso /media/repo4 -t iso9660 -o loop
mount /home/5.iso /media/repo5 -t iso9660 -o loop
mount /home/6.iso /media/repo6 -t iso9660 -o loop

Buat juga file eksekusi untuk mematikan repo dengan nama “matiin_repo” yang isinya:ubuntu-logo

#!/bin/sh
umount /media/repo1
umount /media/repo2
umount /media/repo3
umount /media/repo4
umount /media/repo5
umount /media/repo6

Setelah semua beres, tinggal mengubah mode file “aktifin_repo” dan “matiin_repo” supaya dapat dieksekusi. Gunakan perintah chmod

$ cd /home

$ sudo chmod +x aktifin_repo matiin_repo

Untuk mengetes apakah sudah berhasil, ketikkan perintah

$ sudo /home/aktifin_repo

$ sudo apt-get update

Jika apt-get update berjalan dengan penuh kemenangan :D, berarti file eksekusi sudah berhasil dibuat.

Dengan dua file eksekusi ini, kita tinggal mengetikkan sudo /home/aktifin_repo untuk mengaktifkan repo dan sudo /home/matiin_repo untuk mematikan repo. Gampang kan?

Semoga bermanfaat 😀