INSTALL
550bb8c3
 $Id$
 
cb7dae9d
 
ea828a39
      ===========================================
 
      SIP Express Router (ser) Installation Notes
 
              http://www.iptel.org/ser/
 
      ===========================================
b8bc4cf8
 
f9882aab
   This memo gives you hints how to set up SER quickly. To 
   understand how SER works and how to configure it properly,
   read admin's guide available from SER website. We also
6de5485d
   urge you to read latest ISSUES (available from SER website 
f9882aab
   too) and check for potential problems in this release.
f4f8f4c3
   Users of previous releases are encouraged to read NEWS to
   learn how to move to this new SER version.
f9882aab
   
 
b8bc4cf8
 TOC
 
 1. Supported Architectures and Requirements
 2. Howto Build ser From Source Distribution
 3. Quick-Start Installation Guide
    A) Getting Help
    B) Disclaimers
    C) Quick Start
    D) ser with Persistent Data Storage
ea828a39
 4. Troubleshooting
b8bc4cf8
 
 
 
 1. Supported Architectures and Requirements
 -------------------------------------------
550bb8c3
 
9d24a262
 Supported operating systems: Linux, FreeBSD, NetBSD, OpenBSD, Solaris, Darwin
 Supported architectures: i386, x86_64 (amd64), armv4l, sparc64, powerpc,
  powerpc64
 Experimental architectures: mips1, mips2, sparc32, alpha
 
6de5485d
 (for other architectures the Makefiles might need to be edited)
550bb8c3
 
628e3a5a
 There are various configuration options defined in the Makefile.
 
550bb8c3
 
9d24a262
 Requirements:
550bb8c3
 
5b0cb4c6
 - gcc or icc : gcc >= 2.9x; 3.[12] recommended (it will work with older version
   but it might require some options tweaking for best performance)
550bb8c3
 - bison or yacc (Berkley yacc)
 - flex
9d24a262
 - GNU make (on Linux this is the standard "make", on *BSD and Solaris is
5b9b8d2e
  called "gmake") version >= 3.79.
5b0cb4c6
 - sed and tr (used in the makefiles)
 - GNU tar ("gtar" on Solaris) and gzip if you want "make tar" to work
9d24a262
 - GNU install, BSD install or Solaris install if you want "make
5b0cb4c6
   install", "make bin", "make sunpkg" to work
f3f0a4de
 - libmysqlclient & libz (zlib) if you want mysql support (the mysql module)
aee4712e
 - libexpat if you want the jabber gateway support (the jabber module)
9d24a262
 - libxml2 if you want to compile the cpl-c (CPL support) or pa (presence) 
 modules
 - libradiusclient-ng (> 5.0) if you need radius support (the auth_radius,
 group_radius, uri_radius and avp_radius modules)
 - libpq if you need postgres support (the postgres module)
5b0cb4c6
 
550bb8c3
 
b2dec9c6
 OS Notes:
550bb8c3
 
9d24a262
  FreeBSD/OpenBSD/NetBSD: make sure gmake, bison or yacc & flex are installed.
   
   FreeBSD 5.4:
   
   If you want to compile all the modules, you will need the following packages:
   - mysql-client-* (any version, install one of the mysql*-client ports) for
   libmysqlclient
   - postgresql-libpqxx-2.4.2_1 (/usr/ports/databases/postgresql-libpqxx) for
   libpq
   - expat-1.95.8 (/usr/ports/textproc/expat2) for libexpat
   - libxml2-2.6.18 (/usr/ports/textproc/libxml2) for libxml2
   - radiusclient-0.4.7 (/usr/ports/net/radiusclient) for libradiusclient-ng 
   NOTE: you'll need to add radiusclient_ng=4 to the gmake command line if you
   use the 0.4.* version.
   
   Compile example (all the modules and ser in a tar.gz):
      gmake bin radiusclient_ng=4 include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
 
   OpenBSD 3.7
   - mysql-client-4.0.23 (/usr/ports/databases/mysql) for libmysqlclient
   - expat-1.95.6 (/usr/ports/textproc/expat) for libexpat
   - libxml-2.6.16p0 (/usr/ports/textproc/libxml) for libxml2
   - radiusclient-ng-0.5.1 from 
    http://download.berlios.de/radiusclient-ng/radiusclient-ng-0.5.1.tar.gz
    (you need to download and install it, since there is no "official" 
    openbsd port for it) for libradiusclient-ng 
   Compile example (all the modules and ser in a tar.gz):
      gmake bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius pa"
 
   NetBSD 2.0
   - mysql-client-4.1.12 (/usr/pkgsrc/databases/mysql4-client) for libmysqlclient
   - expat-1.95.8nb2 (/usr/pkgsrc/textproc/expat) for libexpat
   - libxml2-2.6.19 (/usr/pkgsrc/textproc/libxml2) for libxml2
   - radiusclient-ng-0.5.1 (see OpenBSD)
   
   Compile example (all the modules and ser in a tar.gz):
      gmake bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius pa"
 
  Solaris 10
  
   As above; you can use Solaris's yacc instead of bison. You might
   need also gtar and ginstall. If you don't have ginstall you can use Solaris
   install, just make sure it's in the PATH (it's usually in /usr/sbin) and
   add INSTALL=install either to the environment or to the make command line
   (e.g.: gmake INSTALL=install all).
   
   Needed packages:
   [TODO]
   
   Compile example (all the modules and ser in a tar.gz):
      gmake bin INSTALL=install include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
 
  Linux
 
  Needed packages for compiling all the modules:
   Debian:
       - libmysqlclient-dev for libmysqlclient
       - libpq-dev for libpq
       - libexpat1-dev for libexpat
       - libxml2-dev for libxml2
       - libradiusclient-ng-dev for libradiusclient (you can download the 
       package from http://apt.sip-router.org/debian/dists/unstable/main/binary-i386/libradiusclient-ng-dev_0.5.1-0.5_i386.deb ).
       NOTE: you can get up-to-date ser packages or libradiusclient packages
       from http://apt.sip-router.org: add to your /etc/apt/sources.list the
       following lines:
          deb http://apt.sip-router.org/debian testing main contrib non-free
          deb http://apt.sip-router.org/debian unstable main contrib non-free
       and then: apt-get update; apt-get install libradiusclient-ng-dev
       (or, if you want to use the pre-built modules:
        apt-get install ser ser-cpl-module ser-jabber-module ser-mysq-module ser-pa-module ser-postgres-module ser-radius-modules )
 
 
   Compile example (all the modules and ser in a tar.gz):
      make bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
 
550bb8c3
 
b8bc4cf8
 2. Howto Build ser From Source Distribution
 -------------------------------------------
247c2b65
 
9d24a262
 
247c2b65
 (NOTE: if make doesn't work try gmake  instead)
 
 - compile with default options:
 
 make   #builds only ser core, equivalent to make ser
 make modules
 
 or make all #builds everything
 
9d24a262
 By default make all will not build modules that require external libraries or
 that are considered to be "experimental". The modules that have external
 dependecies are: mysql, jabber, cpl-c, auth_radius, group_radius, uri_radius,
 avp_radius, postgres, pa.
 To build all of them (provided you have all the required libraries installed) 
 use:
     make all include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius avp_radius postgres pa"
 If you want to install or to build a binary package (a tar.gz with ser and
  the modules), substitute "all" in the above command with "install" or "bin".
 
 
 More compile examples:
 
247c2b65
 - compile with profiling
 
 make PROFILE=-pg all
 
 -compile debug mode version
 
 make mode=debug all
 
 -compile debug version with profiling
 
 make mode=debug PROFILE=-pg all
 
 -compile only the print module
 
 make modules=modules/print modules
 
fc50bc47
 -compile all the "default" modules except textops and vm
 
 make skip_modules="textops vm" modules
 
 -compile all default modules and include uri_radius (not compiled by default):
 
 make include_modules="uri_radius" modules
 
 -compile all the modules from the modules subdirectory (even the one excluded
 by default):
 
 make exclude_modules="" modules
 
 -compile all the modules from the modules subdirectory excluding vm:
 
 make exclude_modules=vm modules
 
 or
 
 make exclude_modules="" skip_modules=vm modules
247c2b65
 
 
b2dec9c6
 -compile with the "tm" module statically linked and with profiling
 
 make static_modules=tm PROFILE=-pg all
 
5b0cb4c6
 -compile with gcc-3.2 instead of gcc
 
 make CC=gcc-3.2 all
b2dec9c6
 
5b0cb4c6
 or
 
 CC=gcc-3.2 make all
b2dec9c6
 
247c2b65
 
 
 Make targets:
 
628e3a5a
 Clean:
247c2b65
 
628e3a5a
 make clean   (clean the modules too)
 make proper  (clean also the dependencies)
247c2b65
 make distclean (the same as proper)
 make mantainer-clean (clean everything, including auto generated files,
  tags, *.dbg a.s.o)
628e3a5a
 
550bb8c3
 Compile:
 
628e3a5a
 make proper
550bb8c3
 make
 (or gmake on non-Linux systems)
390bec9b
 make modules 
 or make modules exclude_modules="CVS print" etc.
550bb8c3
 
247c2b65
 Make tags:
 
 make TAGS
 
5b0cb4c6
 Create a tar.gz with the sources (in ../):
247c2b65
 
 make tar
 
5b0cb4c6
 Create a tar.gz with the binary distribution (in ../):
247c2b65
 
0294499f
 make bin
247c2b65
 
5b0cb4c6
 Create a gzipped solaris package (in ../):
bc5cc4ec
 
 make sunpkg
 
5b0cb4c6
 Create debian packages (in ../):
 
 make deb
 
 or
 
 dpkg-buildpackage
 
bc5cc4ec
 Install:
550bb8c3
 
 make prefix=/usr/local  install
 
6de5485d
 Note: If you use prefix parameter in make install then you also need
 to use this parameter in previous make commands, i.e. make, make modules,
 or make all. If you fail to do this then SER will look for the default
 configuration file in a wrong directory, because the directory of the
 default configuration file is hard coded into ser during compile time. 
 When you use a different prefix parameter when installing then the 
 directory hard coded in ser and the directory in which the file will be 
 installed by make install will not match. (You can specify exact location
 of the configuration file using -f parameter of ser).
 
 For example, if you do the following:
 make all
 make prefix=/ install
 
 Then the installation will put the default configuration file into
 /etc/ser/ser.cfg (because prefix is /), but ser will look for the file
 in /usr/local/etc/ser/ser.cfg (because there was no prefix parameter
 in make all and /usr/local is the default value of prefix).
 
 Workaround is trivial, use the same parameters in all make commands:
 make prefix=/ all
 make prefix=/ install
 
 That applies to other make parameters as well (for example parameters
 "modules" or "excluded_modules").
cb7dae9d
 
 
b8bc4cf8
 3. Quick-Start Installation Guide
cb7dae9d
 ----------------------------------------------
 
b8bc4cf8
 A) Getting Help
 
 This guide gives you instructions on how to set up the SIP Express 
 Router (ser) on your box quickly. In case the default configuration
cb7dae9d
 does not fly, check documentation at ser site
b8bc4cf8
   http://www.iptel.org/ser/
fd62444c
 to learn how to configure SER for your site.
b8bc4cf8
 
 If the documentation does not resolve your problem you may try contacting 
fd62444c
 our user forum by E-mail at serusers@iptel.org -- that is the mailing list 
 of ser community. To participate in the mailing list, subscribe at the 
 following web address:
b8bc4cf8
   http://mail.iptel.org/mailman/listinfo/serusers
 
fd62444c
 To participate in our commercial support program, contact info@iptel.org.
 The support program will provide you with most timely and accurate help
 for configuration, integration, development and any other technical
 activity.
 
b8bc4cf8
 
 B) Disclaimers
cb7dae9d
  
b8bc4cf8
 Note well the default "quick-start" configuration is very simple in order 
 to be easily installable. It provides minimum features. Particularly, 
 authentication is by default disabled, which means anyone can register using
 any name with the server. (This is on purpose to avoid installation 
 dependencies on MySQL which is needed for storing user credentials.)
cb7dae9d
 
 
b8bc4cf8
 C) Quick Start
cb7dae9d
 
b8bc4cf8
 The following step-by step guide gives you instructions how to install the 
6de5485d
 sql-free distribution of ser. If you need persistence and authentication, 
b8bc4cf8
 then you have to install additional MySql support -- proceed to section D)
 after you are finished with C).
919e909c
 
5b0cb4c6
 1) Download an RPM or debian package from our site
     http://www.iptel.org/ser
6de5485d
 If you don't use an rpm or debian based distribution, try our tar.gz'ed binaries
5b0cb4c6
  (ser-$(version)_$(os)_$(arch).tar.gz, e.g: ser-0.8.8_linux_i386.tar.gz).
 If you use Solaris 8 you can try our solaris package.
e3b6d3cf
 If you use Gentoo Linux you do not have to download a package.
5b0cb4c6
 
cb7dae9d
 2) install the package
5b0cb4c6
 RPM:
     rpm -i <package_name>
 debian:
     dpkg -i <package_name>
e3b6d3cf
 gentoo:
     emerge ser
 	(or if use only stable packets:
 	 ACCEPT_KEYWORDS="~x86" emerge ser)
5b0cb4c6
 tar.gz:
     cd /; tar zxvf <package_name>_os_arch.tar.gz
     (it will install in /usr/local/, and the configuration file in
      /usr/local/etc/ser/ser.cfg)
 Solaris:
     gunzip <package_name>.gz ; pkgadd -d <package_name>
5dcfb23d
 *BSD:
     pkg_add package_name
5b0cb4c6
     
cb7dae9d
 3) start the server
e3b6d3cf
 RPM + gentoo:
5b0cb4c6
     /etc/init.d/ser start
 debian:
     ser is started automatically after the install
6de5485d
     (in case something fails you can start it with /etc/init.d/ser start)
5b0cb4c6
 tar.gz:
     the tar.gz does not include an init.d script, you'll have to create one of
     your own or adapt one from the source distribution (debian/init.d,
     rpm/ser.init.*, gentoo/ser.init)
     You can start ser directly with /usr/local/sbin/ser.
 Solaris:
     see tar.gz.
     
cb7dae9d
 4) optionally, watch server's health using the
    serctl utility
b11ee5d8
     - to do so, first set the environment variable SIP_DOMAIN to your domain 
5b0cb4c6
       name, e.g., in Bourne shell, call
b8bc4cf8
         export SIP_DOMAIN="myserver.foobar.com"
b11ee5d8
 	- if you are using other than 'localhost' mysql server for maintaining
 	  subscriber database, change the variable 'SQL_HOST' to the proper
 	  host name in the serctl script
5b0cb4c6
     - run the serctl utility
         /usr/sbin/serctl moni
       or
         /usr/local/sbin/serctl moni (if you installed from a tar.gz or solaris
         package)
fd62444c
 
cb7dae9d
 5) Register with the server using your favorite
    SIP User Agent. You may want to look at configuration
    hints for use of iptel.org site at
      http://www.iptel.org/phpBB/viewforum.php?forum=1&8
    For example, users of Windows Messenger need to set
6de5485d
    in Tools->Options->Accounts the following values:
cb7dae9d
      Sign-in Name: <username>@<your_server_address>
      Advanced->Configure Settings (on)
      Advanced->Server: <your_server_address>
      Connect Using: UDP
 
 
 
b8bc4cf8
 D) ser with Persistent Data Storage
ea828a39
 
b8bc4cf8
 The default configuration is very simple and features many simplifications. 
fd62444c
 In particular, it does not authenticate users and loses User Location database 
6de5485d
 on reboot. To provide persistence, keep user credentials and remember users' 
fd62444c
 locations across reboots, ser can be configured to use MySQL. Before you proceed, 
 you need to make sure MySQL is installed on your box. Your MySQL server must be 
 configured to deal with a large number of connection. To increase it, set the 
 following line in [mysqld] section of your configuration file:
 
    set-variable    = max_connections=500
b8bc4cf8
 
 1) Download the package containing mysql support for ser from: 
5b0cb4c6
     http://www.iptel.org/ser/
74a565c7
     (rpm and deb provided, most of the binary tar.gz distributions and the 
      solaris package include it; if it is not present you'll have to rebuild
      from the source).
e3b6d3cf
 	For gentoo please include 'mysql' to your USE variable in /etc/make.conf
 	or give it as variable to the emerge command.
cb7dae9d
 2) install the package
5b0cb4c6
     rpm -i <package_name>
     or
     dpkg -i <package_name>
e3b6d3cf
 	or
 	emerge ser
 	(if do not want to put 'mysql' into your USE variable you can type:
 	 USE="mysql" emerge ser)
92307808
 3) create MySQL tables
1ecf596e
 	- if you have a previously installed SER on your system, use
5b467862
     	/usr/sbin/ser_mysql.sh reinstall 
1ecf596e
 	  to convert your SER database into new structures
 	- otherwise, if this is your very first installation, use
     	/usr/sbin/ser_mysql.sh create
 	  to create SER database structures
6de5485d
    (you will be prompted for password of MySql "root" user)
92307808
 4) configure ser to use SQL
b8bc4cf8
     uncomment all lines in configuration file ser.cfg which are related to 
cb7dae9d
     authentication:
     - loadmodule "/usr/lib/ser/modules/mysql.so"
     - loadmodule "/usr/lib/ser/modules/auth.so"
e3b6d3cf
     - loadmodule "/usr/lib/ser/modules/auth_db.so"
cb7dae9d
     - modparam("usrloc", "db_mode", 2)
     - modparam("auth", "calculate_ha1", yes)
9ae9ab4d
     - modparam("auth_db", "password_column", "password")
cb7dae9d
     - if (!www_authorize("iptel.org", "subscriber")) {
         www_challenge("iptel.org", "0"); 
         break;
b8bc4cf8
       }; 
 5) be sure to replace realm, the first parameter in www_* actions, 
    with name of your server; some broken UAC implementations don't 
    authenticate otherwise; the authentication command in your
    configuration script should look then like this:
       if (!www_authorize("myserver.foobar.com", "subscriber")) {
         www_challenge("myserver.foobar.com", "0"); 
         break;
       }
 6) restart the server
5b0cb4c6
     /etc/init.d/ser restart
b8bc4cf8
 7) you can now start  managing the server using the serctl utility; 
    you need to first set the environment variable SIP_DOMAIN to your 
    local SIP realm, e.g.,
        export SIP_DOMAIN="myserver.foobar.com"
f770a896
 
92307808
    a) watch the server status using 'serctl moni'
b8bc4cf8
    b) try to login with your SIP client as user 'admin' with password 'heslo'
92307808
    c) try adding new users using 
        'serctl add <name> <password> <email>'
ea828a39
 
f9882aab
 
ea828a39
 4. Troubleshooting
 ------------------
 
 Q: Windows Messenger authentication fails. 
 
 A: The most likely reason for this problem is a bug in Windows Messenger. 
 WM only authenticates if server name in request URI equals authentication 
 realm. After a challenge is sent by SIP server, WM does not resubmit the 
 challenged request at all and pops up authentication window again. If you 
 want to authenticate WM, you need to set up your realm value to equal server 
 name. If your server has no name, IP address can be used as realm too.
 
 Q: SIP requests are replied by ser with "483 Too Many Hops" or 
    "513 Message Too Large"
 
 A: In both cases, the reason is probably an error in request routing script 
    which caused an infinite loop. You can easily verify whether this happens 
    by watching SIP traffic on loopback interface. A typical reason for misrouting 
    is a failure to match local domain correctly. If a server fails to recognize 
    a request for itself, it will try to forward it to current URI in believe it 
    would forward them to a foreign domain. Alas, it forwards the request to itself 
    again. This continues to happen until value of max_forwards header field reaches 
    zero or the request grows too big. Solutions is easy: make sure that domain matching 
    is correctly configured. A quick way to achieve that is to introduce a config
    option to ser.cfg: alias=domainname, where domainname shall be replaced with
    name of domain, which you wish to server and which appears in request-URIs.