Friday, February 23, 2007

These are step by step very simple instructions to help most people to build

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 below
and compiled SER from www.openser.org and it seams to be the same as the
following.

These are step by step very simple instructions to help most people to build
a 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.

  1. Follow the instructions at http://fedora.redhat.com/download/
    1. 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/
    2. Create three CDROMs using the three ISO images.
  2. Insert Fedora Core 1 CD 1 and boot from CD
    1. Press Enter at boot screen to start setup
    2. When prompted to do the Media Test you can select Skip if you are confident your media is OK
    3. On the Fedora Core welcome screen, select Next
    4. Select English (English) as your language and press Next
    5. Select your keyboard type and press Next
    6. Select your mouse type and press Next
    7. 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
  3. We want to do a Server installation of Fedora Core so select Server and press Next

  1. Select Manual partition with Disk Druid and press Next
    1. Delete any existing disk partitions so that your whole disk is Free Space
    2. For simplicity we will make 3 partitions, one swap partition, one boot partition and one big root partition
    3. Create a "Swap" partition to be 2 or 4 times the size of your available memory
      1. Click New
      2. Select swap as the File System Type
      3. 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
      4. Under Additional Size Options select Fixed Size
      5. Ensure Force to be a primary partition is not selected and press OK
    4. Create a "/boot" partition with a File System Type of etx3 with 100Mbytes
      1. Click New
      2. In the Mount Point text field enter /boot to be an ext3 type of 100Meg.
      3. Select ext3 as the File System Type
      4. 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.
      5. Under Additional Size Options select Fixed Size
      6. Select Force to be a primary partition and press OK
    5. Create a "/"
      root partition with the remained of the disk
      (Optional would be to create a /var partition for the logs to go)
      1. Click New
      2. In the Mount Point text field enter /
      3. Select ext3 as the File System Type
      4. Under Additional Size Options select Fill to maximum allowable size to use the remainder of the disk
      5. Ensure Force to be a primary partition is not selected and press OK
      6. Now you have setup your partitions press Next
  2. Select GRUB as the boot loader and press Next
  3. Next you will need to setup the network device of your machine. The information you enter here will vary depending on your environment
    1. Select eth0 device and press Edit
    2. Deselect Configure using DHCP - you want to configure a fixed ip address
    3. Select Activate on boot
    4. Enter your IP address
    5. Enter your Netmask
    6. Press OK
    7. Set the hostname manually
    8. Enter Gateway IP address.
    9. Enter Primary DNS IP address - For the Tutorial you may need to change it to simulate the SRV records, probably 169.222.239.2
    10. Enter Secondary DNS IP address if available
    11. Enter Tertiary DNS IP address if available
    12. Press Next
  4. Select No firewall and press Next
    1. Press Proceed on the warning screen about a firewall, you can setup a proper firewall later on
  5. Select the Default language for your system and press Next
  6. Select your timezone and press Next
  7. Enter your desired Root Password and Confirm and press Next
  8. 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)
  9. Under Desktops select X 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
  1. 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.
  2. Under Desktops select KDE Desktop Environment and click Details
    • Ensure only the following packages are installed (for a small installation
      although you can add more):
      kdeadmin
      kdenetwork
      kdeutils
  3. 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
  4. Under Applications select Graphic Internet and click Details
    • Ensure only the following packages are installled (for a small installation although you can add more):
      mozilla

  1. Under Applications deselect Text-based Internet
  2. 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

  3. Under Web Servers click Details for
    Web S
    • Ensure only the following packages are installed (for a small installation although you can add more):
      httpd-manual
      php
      php-mysql
  4. Under Servers deselect Windows File Server
  5. 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

  1. 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
  2. Under Development select Network Servers and click Details
    • Ensure only the following packages are installed (for a small installation
      although you can add more):
      freeradius
      tftp-server
  3. Under System deselect Administration Tools
  4. 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
  5. Under System deselect Printing Support
  6. We are now ready to continue with the installation.
    • Click Next
  7. The installation will now check for dependencies, but there shouldn't be any for our installation as above
    • Click Next again
  8. The required media will be listed in a popup dialog box, click Continue
  9. The installation will now proceed by formatting the required filesystems, transferring the install image to the hard drive, and then installing the
    selected packages.
  10. You will be prompted to insert the required media at different times throughout
    the installation. When prompted, insert the required media and press OK.
  11. When prompted to reboot, remove the installation media and press Reboot
  12. 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 SERVER
Use the programme "ntsysv"
# enable these:
# http
# mysql
# radiusd
# tftp

Step by Step Installation of SER on RedHad Fedora Core 1

The following has been tested on a RedHat Fedora Core 1 install as per instructions and is based on SER version 0.8.12

Key to the colours used:

Pink indicates a command or a filename
Red indicates something specific to your SER Server,
do not just put in the example

rpm -i ser-0.8.12-0.i386.rpm 

Start

/etc/rc.d/init.d/ser start

Do some environmental changes

export SIP_DOMAIN="aarnet.edu.au"

    • Edit /etc/profile and add the following line (same as above) onto the end of the file:

export SIP_DOMAIN="aarnet.edu.au"
Note I used an IP address here to make it work.

  • Get the SER mysql module, configure the install, install it, configure
    SER and restart SER

from SER or from this server

    • Install mysql
      rpm -i ser-mysql-0.8.12-0.i386.rpm
    • Start
      /etc/rc.d/init.d/mysqld start
    • 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

modparam("usrloc|other_modules_using_db", "db_url",
"mysql://ser:otherpassword@localhost/ser")


    • 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:
      mysql
      connect 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.cfg to 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 the password that will be used by the user, do not use password as a password!

  • Test the connection using two SIP UAs.
    • See the examples of how to configure UAs.
    • Use the this command to see who is logged in:
      serctl ul show
  • 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.sock
      set-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 it
      rm /tmp/ser_fifo

Step by Step Installation of WEBSER on RedHad Fedora Core 1

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.

  • Get the TAR, un-tar and place the files in the right directory
    • from SER or from this server
    • untar
      tar -xvzf serweb_2004-01-04.tar.gz
    • change directory to where the files were untared to
      cd serweb_2004-01-04
    • Create the directory and move the files there
      mkdir /var/www/phplib
      chown root /var/www/phplib
      chgrp root /var/www/phplib
      chmod 755 /var/www/phplib
      cp ./phplib/* /var/www/phplib/ -R

# Move the html files to the DocumentRoot directory
mkdir /var/www/html/serweb/
chown apache /var/www/html/serweb/
chgrp root /var/www/html/serweb/
chmod 755 /var/www/html/serweb/
cp ./html/* /var/www/html/serweb -R

  • edit these lines in /etc/php.ini
    and change short_open_tag = Off" to "On"

and change register_globals = Off" to "On"

· Create these files as part of the serweb module.

vi /var/www/html/serweb/prolog.html
AARNet SER SIP Server
vi /var/www/html/serweb/separator.html
vi /var/www/html/serweb/epilog.html
End of page text

  • ALL the files that follw are with respect to /var/www/html/serweb
    cd /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->prolog="/serweb/prolog.html";
    $this->separator="/serweb/separator.html";
    $this->epilog="/serweb/epilog.html";
    # /* email address for questions concerning registration */
    $this->root_uri.

$this->root_path."user_interface/my_account.php?#session#\n\n".
$this->root_uri.

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

  • Edit /var/www/phplib/db_mysql.inc
    # You need to add the following to /* public: connection parameters */
    var $Host = "192.94.63.28";
    var $Database = "ser";
    var $User = "ser";
    var $Password = "heslo";

The follwoing changes can be applied two ways:

1. Get and extract this tar file

get the file fixupserwebphp.tar from this server put it in the directory /usr/local/src/ser issue these commands

cd /var/www/html/serweb

tar -xvf fixupserwebphp.tar

OR


2. Manualy make all these changes

Generaly you have to add "../" to all these files so that they point correctly to where the phplib is.


Edit ./admin/prepend.php
# change $_PHPLIB["libdir"] = "../../../phplib/";

  • Edit ./user_interface/prepend.php
    # change $_PHPLIB["libdir"] = "../../../phplib/";
  • Edit ./user_interface/reg/prepend.php
    # change $_PHPLIB["libdir"] = "../../../../phplib/";
  • Edit ./admin/acl.php
    # change require "../../../phplib/oohforms.inc";
  • Edit ./admin/index.php
    # require "../../../../phplib/oohforms.inc";
  • Edit ./admin/users.php
    # require "../../../../phplib/oohforms.inc";
  • Edit ./user_interface/accounting.php
    # require "../../../../phplib/oohforms.inc";
  • Edit ./user_interface/find_user.php
    # require "../../../../phplib/oohforms.inc";
  • Edit ./user_interface/index.php
    # require "../../../phplib/oohforms.inc";
  • Edit ./user_interface/missed_calls.php
    # require "../../../phplib/oohforms.inc";
  • Edit ./user_interface/my_account.php
    # require "../../../phplib/oohforms.inc";
  • Edit ./user_interface/phonebook.php
    # require "../../../phplib/oohforms.inc";
  • Edit ./user_interface/send_im.php
    # require "../../../phplib/oohforms.inc";
  • Edit ./user_interface/notification_subscription.php
    # require "../../../phplib/oohforms.inc";
  • Edit ./user_interface/reg/finish.php
    # require "../../../../phplib/oohforms.inc";
  • Edit ./user_interface/reg/get_pass.php
    # require "../../../../phplib/oohforms.inc";
  • Edit ./user_interface/reg/index.php
    # require "../../../../phplib/oohforms.inc";

LAST STEP: START APACHE
/etc/rc.d/init.d/httpd start

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.au
    change password to the password that 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
  • Test the connection using two SIP UAs.
    • See the examples of how to configure UAs.
    • Use the this command to see who is logged in:
      serctl ul show
  • 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.

2 comments:

Anonymous said...

Hi, guantanamera121212

Anonymous said...

не факт