Friday, February 23, 2007

Tutorial on SIP and SIP SER server Installation of SER.

I would like to present three installation options:

·Follow the steps below using Red Hat Fedora Core 1 and rpm files. This is possibly getting a little old now (2006)

·FreeBSD comes with SER as an installable option, just tick the box.

·I have done some testing using Fedora Core 4 using the same steps as belowand compiled SER from www.openser.org and it seams to be the same as thefollowing.

These are step by step very simple instructions to help most people to builda SER Server starting with a PC.

Linux Kernal using RedHat's Open Source "Fedora

Core 1"

The following instructions are based on building a Unix server using typical PC Intel i386 based hardware.

IMPORTANT NOTE: Fedora Core 1 does not support Intel PCs using Serial ATA Harddisks, and recent testing shows that SER does not run on Fedora Core 2.

Follow the instructions at http://fedora.redhat.com/download/

Download the three ISO images for Fedora Core 1 (not 2), also called "yarrow" from Red Hat. http://download.fedora.redhat.com/pub/fedora/linux/core/1/

Create three CDROMs using the three ISO images.

Insert Fedora Core 1 CD 1 and boot from CD

Press Enter at boot screen to start setup

When prompted to do the Media Test you can select Skip if you are confident your media is OK

On the Fedora Core welcome screen, select Next

Select English (English) as your language and press Next

Select your keyboard type and press Next

Select your mouse type and press Next

If you have an existing Redhat Linux installation on the computer the Fedora installer will find this installation and ask you if you want to Upgrade the existing installation or perform a refresh installation of Fedora Core. If this is the case, select Install Fedora Core and press Next

We want to do a Server installationof Fedora Core so select Server and press Next

Select Manual partition with Disk Druid and press Next

Delete any existing disk partitions so that your whole disk is Free Space

For simplicity we will make3 partitions, one swap partition, one boot partition and one big root partition

Create a "Swap" partition to be 2 or 4 times the size of your available memory

Click New

Select swap as the File System Type

In the Size (MB) text field enter the size of your swap partition.As a guide, set the swap partition to be 2 or 4 times the size of your available memory. As an example, my computer has 256Meg RAM, so I will set a 1Gig swap

Under Additional Size Options select Fixed Size

Ensure Force to be a primary partition is not selected and press OK

Create a"/boot" partition with a File System Type of etx3 with 100Mbytes

Click New

In the Mount Point text field enter /boot to be an ext3 type of 100Meg.

Select ext3 as the File System Type

In the Size (MB) text field enter the size of your boot partition. This partition should be at least 50Meg, and a good size is usually 100Meg.

Under Additional Size Options select Fixed Size

Select Force to be a primary partition and press OK

Create a"/" root partition with the remained of the disk (Optional would be to create a /var partition for the logs to go)

Click New

In the Mount Point text field enter /

Select ext3 as the File System Type

Under Additional Size Options select Fill to maximum allowable size to use the remainder of the disk

Ensure Force to be a primary partition is not selected and press OK

Now you have setup your partitions press Next

Select GRUB as the boot loader and press Next

Next you will need to setup the network device of your machine. The information you enter here will vary depending on your environment

Select eth0 device and press Edit

Deselect Configure using DHCP - you want to configure a fixed ip address

Select Activate on boot

Enter your IP address

Enter your Netmask

Press OK

Set the hostname manually

Enter Gateway IP address.

Enter Primary DNS IP address - For the Tutorial you may need to change it to simulate the SRV records, probably 169.222.239.2

Enter Secondary DNS IP address if available

Enter Tertiary DNS IP address if available

Press Next

Select No firewall and press Next

Press Proceed on the warning screen about a firewall, you can setup a proper firewall later on

Select the Default language for your system and press Next

Select your timezone and press Next

Enter your desired Root Password and Confirm and press Next

This document assumes that this server will be dedicated to be your SIP server and so we will remove some packages that are not needed by your SIP server. For the purposes of the APAN SIP tutorial we will install Xwindows so you have a graphical interface with a browser to access the serweb tool. (Xwindows is not normally needed for your SIP server)

Under Desktops selectX Window System and click Details (far right side of X Window System

Ensure only the following packages are installed (for a small installation although you can add more):XFree86-twm Xfree86-xdm firstboot gdm rhgb xterm

To install a decent Window Manager, under Desktops select your Window Manager of choise, either GNOME or KDE and install your required packages. For the purposes of the APAN SIP tutorial we will install we will install KDE.

Under Desktops selectKDE Desktop Environmentand click Details

Ensure only the following packages are installed (for a small installation although you can add more):kdeadmin kdenetwork kdeutils

Under Applications select Editors and click Details

Ensure only the following packages are installed (for a small installation although you can add more):vim-enhanced

emacs

Under Applications select Graphic Internetand click Details

Ensure only the following packages are installled (for a small installation although you can add more):mozilla

Under Applications deselect Text-based Internet

Under Servers click Details for Server Configuration Tools

Ensure only the following packages are installed (for a small installation although you can add more):Xfree86-xauth

Under Web Servers click Details forWeb S

Ensure only the following packages are installed (for a small installation although you can add more):httpd-manual php php-mysql

Under Servers deselect Windows File Server

Under Servers select SQL Database Server and click Details

Ensure only the following packages are installed (for a small installation although you can add more):mysql-server

Under Development select Development Tools and click Details

Ensure only the following packages are installed (for a small installation although you can add more):rpm-build

Under Development select Network Servers and click Details

Ensure only the following packages are installed (for a small installation although you can add more):freeradiustftp-server

Under System deselect Administration Tools

Under System select System Tools and click Details

Ensure only the following packages are installed (for a small installation although you can add more):ethereal nmap screen

Under System deselect Printing Support

We are now ready to continue with the installation.

Click Next

The installation will now check for dependencies, but there shouldn't be any for our installation as above

Click Next again

The required media will be listed in a popup dialog box, click Continue

The installation will now proceed by formatting the required filesystems, transferring the install image to the hard drive, and then installing the selected packages.

You will be prompted to insert the required media at different times throughout the installation. When prompted, insert the required media and press OK.

When prompted to reboot, remove the installation media and press Reboot

You have now installed a system that will run as a SER SIP Server for the APAN SIP Tutorial

## ENABLE ALL THE FOLLOWING SERVICES TO START AUTOMATICLY ON RELOAD OF SERVERUse the programme "ntsysv"# enable these:# http# mysql# radiusd# tftp

If you wanted to you could make some changes, not recommended for first build, in the following file:

Edit /usr/sbin/ser_mysql.sh, the following may want to be changed, I just leave them as is DBHOST=localhost USERNAME=ser DEFAULT_PW=heslo ROUSER=serro RO_PW=47serro11 SQL_USER="root" DEFAULT_PW=heslo # DEFAULT_PW is the password used by serctl to add users etc! Note: If you change the DEFAULT_PW password then you must add something to ser.cfg add

Run the SER script to create the SER database in mysql. IMPORTANT NOTE : You need to change your path statement in your shell environmentals to find the HA1 programme, personally I just ssh on as root and it runs fine./usr/sbin/ser_mysql.sh create Notes: MySql password for root: BLANK Domain (Realm) is the domain name for the SIP users: aarnet.edu.au Second password: BLANK

Enter mysql and check that the tables have been created, follow these commands:mysqlconnect ser; show tables; select * from subscriber; exit

Copy the original SER configuration file and edit ser.cfg.

cp /etc/ser/ser.cfg /etc/ser/ser.cfg-original

Now edit the /etc/ser/ser.cfg /etc/ser/ser.cfgto make it do what you want it to. Here is a good guide: http://mit.edu/sip/sip.edu/ser.shtml.

Restart SER so that the changes take effect/etc/rc.d/init.d/ser restart

Create two users using serctl. IMPORTANT NOTE : YOU MUST BE LOGGED IN AS ROOT (NOT JUST sudo) or fix up the path statement in your shell. Format of the command is: serctl add <username> <password> <email> and you need to use the DEFAULT_PW=heslo as the password set in /usr/sbin/ser_mysql.sh/usr/sbin/serctl add srk password Stephen.Kingham@aarnet.edu.au /usr/sbin/serctl add caf password Clayton.Forbes@aarnet.edu.au

change password to thepassword that will be used by the user, do not use password as a password!

Configure mysql so that it only listens to local requests and increase the maximum number of sessions:

edit /etc/my.cnf Change the start of the file so that it has these extra lines: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sockset-variable = max_connections=500 bind-address=127.0.0.1

Restart mysql/etc/rc.d/init.d/mysql restart

Create a special user for SER to run as, rather than running it as root.

Use the following command to create the new user in Unix:/usr/sbin/useradd -c "SER" -u 494 -s /sbin/nologin -r -d /usr/lib/ser ser

Now tell SER to run as the user ser by adding these lines into /etc/ser/ser.cfg:uid=ser gid=ser

Delete the old fifo file otherwise the new user "ser" may not be able to use itrm /tmp/ser_fifo

When the original distribution is installed the directory locations do not match up with the typical apache file locations. These notes document all the changes needed. SUGGESTION: For the Tutorial we should develop a new install TAR so delegates do not spend 30 minutes editing all the files.

ALL the files that follw are with respect to /var/www/html/serwebcd /var/www/html/serweb

edit these lines in ./config.php In general replace all 192.168.2.16 with 192.94.63.28 #If you have changed the mysql username, dbname or password you need to change these: db_name="ser"; //database name db_user="ser"; //database conection user db_pass="heslo"; //database conection password # NOTE: The above relate to the mysql database, see /usr/sbin/ser_mysql.sh. $this->root_path="/serweb/"; #The above must match where the serweb html directory is put this user_pages_path = this root_path."user_interface/";

$this->root_path."user_interface/reg/confirmation.php?nr=#confirm#\n\n".# There is heaps more to customise in this file which we will leave to the user. These include more email references# and text used in emails to users who register. Here are some example which do not need to be changed for this tutorial:$this->mail_header_from="Stephen.Kingham@aarnet.edu.au";$this->web_contact="sip:Stephen.Kingham@aarnet.edu.au";$this->title="The AARNet IP Telephony Site";$this->infomail = "Stephen.Kingham@aarnet.edu.au";$this->regmail = "Stephen.Kingham@aarnet.edu.au";

Initial configuration of SER

Some key SER configuration commands

Create users:You must be root.sudo su - Format of the command is: serctl add username password email and you need to use the DEFAULT_PW=heslo as the password set in /usr/sbin/ser_mysql.sh/usr/sbin/serctl add srk password Stephen.Kingham@aarnet.edu.au /usr/sbin/serctl add caf password Clayton.Forbes@aarnet.edu.auchange password to thepasswordthat will be used by the user, do not use password as a password!

Give the User several aliases, such as a telephone number:/usr/sbin/serctl

Set up some permanent forking, so calls to the user also go through to telephone numbers:/usr/sbin/serctl

What places users can call are set by a flag for the user in mysql, the "acl" table. Use the serctl command to enable various flags for each user. You can create the flags by configuring the serctl programme it's self, ie vi /usr/sbin/serctl./usr/sbin/serctl acl grant srk free-pstn/usr/sbin/serctl acl grant srk ld/usr/sbin/serctl acl grant srk ld What the various flags do is done within the routing in ser.cfg.