INSTALL 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. $Id$
  2. ===========================================
  3. SIP Express Router (ser) Installation Notes
  4. http://www.iptel.org/ser/
  5. ===========================================
  6. This memo gives you hints how to set up SER quickly. To
  7. understand how SER works and how to configure it properly,
  8. read admin's guide available from SER website. We also
  9. urge you to read latest ISSUES (available from SER website
  10. too) and check for potential problems in this release.
  11. Users of previous releases are encouraged to read NEWS to
  12. learn how to move to this new SER version.
  13. TOC
  14. 1. Supported Architectures and Requirements
  15. 2. Howto Build ser From Source Distribution
  16. 3. Quick-Start Installation Guide
  17. A) Getting Help
  18. B) Disclaimers
  19. C) Quick Start
  20. D) ser with Persistent Data Storage
  21. 4. Troubleshooting
  22. 1. Supported Architectures and Requirements
  23. -------------------------------------------
  24. Supported operating systems: Linux, FreeBSD, NetBSD, OpenBSD, Solaris, Darwin
  25. Partially supported: Windows+Cygwin (core + static modules only, no IPv6,
  26. no TCP, no dynamic modules)
  27. Supported architectures: i386, x86_64 (amd64), armv4l, sparc64, powerpc,
  28. powerpc64
  29. Experimental architectures: mips1, mips2, sparc32, alpha
  30. (for other architectures the Makefiles might need to be edited)
  31. There are various configuration options defined in the Makefile.
  32. Requirements:
  33. - gcc or icc : gcc >= 2.9x; 3.[12] recommended (it will work with older version
  34. but it might require some options tweaking for best performance)
  35. - bison or yacc (Berkley yacc)
  36. - flex
  37. - GNU make (on Linux this is the standard "make", on *BSD and Solaris is
  38. called "gmake") version >= 3.79.
  39. - sed and tr (used in the makefiles)
  40. - GNU tar ("gtar" on Solaris) and gzip if you want "make tar" to work
  41. - GNU install, BSD install or Solaris install if you want "make
  42. install", "make bin", "make sunpkg" to work
  43. - libmysqlclient & libz (zlib) if you want mysql support (the mysql module)
  44. - libexpat if you want the jabber gateway support (the jabber module)
  45. - libxml2 if you want to compile the cpl-c (CPL support) or pa (presence)
  46. modules
  47. - libradiusclient-ng (> 5.0) if you need radius support (the auth_radius,
  48. group_radius, uri_radius and avp_radius modules)
  49. - libpq if you need postgres support (the postgres module)
  50. OS Notes:
  51. FreeBSD/OpenBSD/NetBSD: make sure gmake, bison or yacc & flex are installed.
  52. FreeBSD 5.4:
  53. If you want to compile all the modules, you will need the following packages:
  54. - mysql-client-* (any version, install one of the mysql*-client ports) for
  55. libmysqlclient
  56. - postgresql-libpqxx-2.4.2_1 (/usr/ports/databases/postgresql-libpqxx) for
  57. libpq
  58. - expat-1.95.8 (/usr/ports/textproc/expat2) for libexpat
  59. - libxml2-2.6.18 (/usr/ports/textproc/libxml2) for libxml2
  60. - radiusclient-0.4.7 (/usr/ports/net/radiusclient) for libradiusclient-ng
  61. NOTE: you'll need to add radiusclient_ng=4 to the gmake command line if you
  62. use the 0.4.* version.
  63. Compile example (all the modules and ser in a tar.gz):
  64. gmake bin radiusclient_ng=4 include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
  65. OpenBSD 3.7
  66. - mysql-client-4.0.23 (/usr/ports/databases/mysql) for libmysqlclient
  67. - expat-1.95.6 (/usr/ports/textproc/expat) for libexpat
  68. - libxml-2.6.16p0 (/usr/ports/textproc/libxml) for libxml2
  69. - radiusclient-ng-0.5.1 from
  70. http://download.berlios.de/radiusclient-ng/radiusclient-ng-0.5.1.tar.gz
  71. (you need to download and install it, since there is no "official"
  72. openbsd port for it) for libradiusclient-ng
  73. Compile example (all the modules and ser in a tar.gz):
  74. gmake bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius pa"
  75. NetBSD 2.0
  76. - mysql-client-4.1.12 (/usr/pkgsrc/databases/mysql4-client) for libmysqlclient
  77. - expat-1.95.8nb2 (/usr/pkgsrc/textproc/expat) for libexpat
  78. - libxml2-2.6.19 (/usr/pkgsrc/textproc/libxml2) for libxml2
  79. - radiusclient-ng-0.5.1 (see OpenBSD)
  80. Compile example (all the modules and ser in a tar.gz):
  81. gmake bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius pa"
  82. Solaris 10
  83. As above; you can use Solaris's yacc instead of bison. You might
  84. need also gtar and ginstall. If you don't have ginstall you can use Solaris
  85. install, just make sure it's in the PATH (it's usually in /usr/sbin) and
  86. add INSTALL=install either to the environment or to the make command line
  87. (e.g.: gmake INSTALL=install all).
  88. Needed packages:
  89. [TODO]
  90. Compile example (all the modules and ser in a tar.gz):
  91. gmake bin INSTALL=install include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
  92. Linux
  93. Needed packages for compiling all the modules:
  94. Debian:
  95. - libmysqlclient-dev for libmysqlclient
  96. - libpq-dev for libpq
  97. - libexpat1-dev for libexpat
  98. - libxml2-dev for libxml2
  99. - libradiusclient-ng-dev for libradiusclient (you can download the
  100. package from http://apt.sip-router.org/debian/dists/unstable/main/binary-i386/libradiusclient-ng-dev_0.5.1-0.5_i386.deb ).
  101. NOTE: you can get up-to-date ser packages or libradiusclient packages
  102. from http://apt.sip-router.org: add to your /etc/apt/sources.list the
  103. following lines:
  104. deb http://apt.sip-router.org/debian testing main contrib non-free
  105. deb http://apt.sip-router.org/debian unstable main contrib non-free
  106. and then: apt-get update; apt-get install libradiusclient-ng-dev
  107. (or, if you want to use the pre-built modules:
  108. apt-get install ser ser-cpl-module ser-jabber-module ser-mysq-module ser-pa-module ser-postgres-module ser-radius-modules )
  109. Cygwin (alpha state, partial support)
  110. make sure make, bison, flex, minires and minires-devel (needed for the resolver functions) are installed.
  111. Only building ser's core and some static modules is supported for now.
  112. Stuff known not to work:
  113. - IPv6 (cygwin doesn't support it yet)
  114. - TCP (the tcp code heavily depends on file descriptor passing
  115. between processes, which is not yet supported by cygwin)
  116. - dynamic modules (non statically linked -- not supported because
  117. backlinking doesn't work in windows by design)
  118. Compile example (all the modules and ser in a tar.gz):
  119. make bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
  120. 2. Howto Build ser From Source Distribution
  121. -------------------------------------------
  122. (NOTE: if make doesn't work try gmake instead)
  123. SER is split in four main parts: The core, the modules, the utilties, and scripts/examples
  124. When you build, you can decide to build only the core, the modules, both, or all.
  125. Compile SER core only:
  126. make #builds only ser core, equivalent to make ser
  127. Compile modules except some explicitly excepted (see below)
  128. make modules
  129. Compile all:
  130. make all
  131. Explicitly excepted modules (default in <=0.9.x):
  132. By default make all will not build modules that require external libraries or
  133. that are considered to be "experimental". The modules that have external
  134. dependencies are: mysql, jabber, cpl-c, auth_radius, group_radius, uri_radius,
  135. avp_radius, postgres, pa.
  136. Including groups of modules (available in >0.9.x):
  137. Instead of compiling the default modules only, you can specify groups of
  138. modules to include, according to their status:
  139. standard - Modules in this group are considered a standard part of SER (due to widespread usage)
  140. but they have no dependencies (note that some of these interplay with external systems.
  141. However, they don't have compile or link dependencies).
  142. standard-dep - Modules in this group are considered a standard part of SER (due to widespread usage)
  143. but they have dependencies that most be satisfied for compilation.
  144. NOTE! All presence modules (dialog, pa, presence_b2b, rls, xcap) have been included in this
  145. group due to interdependencies
  146. stable - Modules in this group satisfy specific or niche applications, but are considered
  147. stable for production use. They may or may not have dependencies
  148. experimental - Modules in this group are either not complete, untested, or without enough reports
  149. of usage to allow the module into the stable group. They may or may not have dependencies.
  150. To compile core with standard modules:
  151. make group_include="standard" all
  152. To compile all modules (provided you have all the required libraries installed) use:
  153. make group_include="standard standard-dep stable experimental" all
  154. There are also in addition some "convenience" groups:
  155. mysql - Include all modules dependent on mysql
  156. radius - Include all modules on radiusclient
  157. presence - Include all the presence modules
  158. Ex. to make a standard installation with mysql, use:
  159. make group_include="standard mysql" all
  160. In addition to group_include (or instead), you can use
  161. include_modules="modA modB"
  162. to specify exactly the modules you want to include, ex.
  163. make include_modules="mymodule" modules
  164. You can also explicitly skip modules using skip_modules. Let's say you want all the standard
  165. and standard-dep modules except domain:
  166. make group_include="standard standard-dep" skip_modules="domain" all
  167. NOTE!!! As this mechanism is very powerful, you may be uncertain which modules wwill be included.
  168. Just replace all (or modules) with print-modules and you will see which modules will be included
  169. and excluded, ex:
  170. make print-modules
  171. will show which modules are excluded by default.
  172. If you want to install or to build a binary package (a tar.gz with ser and
  173. the modules), substitute "all" in the above command with "install" or "bin".
  174. More compile examples:
  175. - compile with profiling
  176. make PROFILE=-pg all
  177. -compile debug mode version
  178. make mode=debug all
  179. -compile debug version with profiling
  180. make mode=debug PROFILE=-pg all
  181. -compile only the print module
  182. make modules=modules/print modules
  183. - compile by default only the print module, in debuging mode and with
  184. profiling:
  185. make cfg modules=modules/print mode=debug PROFILE=-pg
  186. make all
  187. - compile by default all the usual modules + mysql and postgres, optimized
  188. for pentium-m and for space
  189. make cfg include_modules="mysql postgres" CPU=pentium-m CC_EXTRA_OPTS=-Os
  190. make all
  191. -compile all the "default" modules except textops and vm
  192. make skip_modules="textops vm" modules
  193. - save the above option in the make config, so that all make commands
  194. will use it by default:
  195. make cfg skip_modules="textops vm"
  196. -compile all default modules and include uri_radius (not compiled by default):
  197. make include_modules="uri_radius" modules
  198. -compile all the modules from the modules subdirectory (even the one excluded
  199. by default):
  200. make exclude_modules="" modules
  201. -compile all the modules from the modules subdirectory excluding vm:
  202. make exclude_modules=vm modules
  203. or
  204. make exclude_modules="" skip_modules=vm modules
  205. -compile with the "tm" module statically linked and with profiling
  206. make static_modules=tm PROFILE=-pg all
  207. -compile with gcc-3.2 instead of gcc
  208. make CC=gcc-3.2 all
  209. or
  210. CC=gcc-3.2 make all
  211. Make targets:
  212. Configure:
  213. make cfg or make config (force config regeneration and store it in config.mak)
  214. Example: make cfg include_modules=mysql mode=debug (all future make
  215. invocations will include the mysql module and will build in debug mode)
  216. Note: if config.mak doesn't exist (e.g. initial checkout or after a make
  217. proper) or if Makefile.defs was changed, the config will be re-generated
  218. automatically by the first make command. For example:
  219. make cfg include_modules=mysql; make all is equivalent to
  220. rm config.mak; make include_modules=mysql.
  221. Clean:
  222. make clean (clean the modules too)
  223. make proper (clean also the dependencies and the config)
  224. make distclean (the same as proper)
  225. make mantainer-clean (clean everything, including auto generated files,
  226. tags, *.dbg a.s.o)
  227. Compile:
  228. make proper
  229. optional: make cfg <various cfg. options that should be saved>
  230. make
  231. (or gmake on non-Linux systems)
  232. make modules
  233. or make modules exclude_modules="CVS print" etc.
  234. Make tags:
  235. make TAGS
  236. Create a tar.gz with the sources (in ../):
  237. make tar
  238. Create a tar.gz with the binary distribution (in ../):
  239. make bin
  240. Create a gzipped solaris package (in ../):
  241. make sunpkg
  242. Create debian packages (in ../):
  243. make deb
  244. or
  245. dpkg-buildpackage
  246. Documentation:
  247. make README
  248. Regenerates the README for all the "default" modules (include_modules,
  249. skip_modules a.s.o can be used to alter the module list).
  250. make man
  251. Generates a manpage for all the modules that support it (.xml file in the
  252. module directory).
  253. Install:
  254. make prefix=/usr/local install
  255. Note: If you use prefix parameter in make install then you also need
  256. to use this parameter in previous make commands, i.e. make, make modules,
  257. or make all. If you fail to do this then SER will look for the default
  258. configuration file in a wrong directory, because the directory of the
  259. default configuration file is hard coded into ser during compile time.
  260. When you use a different prefix parameter when installing then the
  261. directory hard coded in ser and the directory in which the file will be
  262. installed by make install will not match. (You can specify exact location
  263. of the configuration file using -f parameter of ser).
  264. For example, if you do the following:
  265. make all
  266. make prefix=/ install
  267. Then the installation will put the default configuration file into
  268. /etc/ser/ser.cfg (because prefix is /), but ser will look for the file
  269. in /usr/local/etc/ser/ser.cfg (because there was no prefix parameter
  270. in make all and /usr/local is the default value of prefix).
  271. Workaround is trivial, use the same parameters in all make commands:
  272. make prefix=/ all
  273. make prefix=/ install
  274. or save the desired prefix in the make config (e.g.: make cfg prefix=/).
  275. That applies to other make parameters as well (for example parameters
  276. "modules" or "excluded_modules").
  277. 3. Quick-Start Installation Guide
  278. ----------------------------------------------
  279. A) Getting Help
  280. This guide gives you instructions on how to set up the SIP Express
  281. Router (ser) on your box quickly. In case the default configuration
  282. does not fly, check documentation at ser site
  283. http://www.iptel.org/ser/
  284. to learn how to configure SER for your site.
  285. If the documentation does not resolve your problem you may try contacting
  286. our user forum by E-mail at [email protected] -- that is the mailing list
  287. of ser community. To participate in the mailing list, subscribe at the
  288. following web address:
  289. http://mail.iptel.org/mailman/listinfo/serusers
  290. To participate in our commercial support program, contact [email protected].
  291. The support program will provide you with most timely and accurate help
  292. for configuration, integration, development and any other technical
  293. activity.
  294. B) Disclaimers
  295. Note well the default "quick-start" configuration is very simple in order
  296. to be easily installable. It provides minimum features. Particularly,
  297. authentication is by default disabled, which means anyone can register using
  298. any name with the server. (This is on purpose to avoid installation
  299. dependencies on MySQL which is needed for storing user credentials.)
  300. C) Quick Start
  301. The following step-by step guide gives you instructions how to install the
  302. sql-free distribution of ser. If you need persistence and authentication,
  303. then you have to install additional MySql support -- proceed to section D)
  304. after you are finished with C).
  305. 1) Download an RPM or debian package from our site
  306. http://www.iptel.org/ser
  307. If you don't use an rpm or debian based distribution, try our tar.gz'ed binaries
  308. (ser-$(version)_$(os)_$(arch).tar.gz, e.g: ser-0.8.8_linux_i386.tar.gz).
  309. If you use Solaris 8 you can try our solaris package.
  310. If you use Gentoo Linux you do not have to download a package.
  311. 2) install the package
  312. RPM:
  313. rpm -i <package_name>
  314. debian:
  315. dpkg -i <package_name>
  316. gentoo:
  317. emerge ser
  318. (or if use only stable packets:
  319. ACCEPT_KEYWORDS="~x86" emerge ser)
  320. tar.gz:
  321. cd /; tar zxvf <package_name>_os_arch.tar.gz
  322. (it will install in /usr/local/, and the configuration file in
  323. /usr/local/etc/ser/ser.cfg)
  324. Solaris:
  325. gunzip <package_name>.gz ; pkgadd -d <package_name>
  326. *BSD:
  327. pkg_add package_name
  328. 3) start the server
  329. RPM + gentoo:
  330. /etc/init.d/ser start
  331. debian:
  332. ser is started automatically after the install
  333. (in case something fails you can start it with /etc/init.d/ser start)
  334. tar.gz:
  335. the tar.gz does not include an init.d script, you'll have to create one of
  336. your own or adapt one from the source distribution (debian/init.d,
  337. rpm/ser.init.*, gentoo/ser.init)
  338. You can start ser directly with /usr/local/sbin/ser.
  339. Solaris:
  340. see tar.gz.
  341. 4) optionally, watch server's health using the
  342. serctl utility
  343. - to do so, first set the environment variable SIP_DOMAIN to your domain
  344. name, e.g., in Bourne shell, call
  345. export SIP_DOMAIN="myserver.foobar.com"
  346. - if you are using other than 'localhost' mysql server for maintaining
  347. subscriber database, change the variable 'SQL_HOST' to the proper
  348. host name in the serctl script
  349. - run the serctl utility
  350. /usr/sbin/serctl moni
  351. or
  352. /usr/local/sbin/serctl moni (if you installed from a tar.gz or solaris
  353. package)
  354. 5) Register with the server using your favorite
  355. SIP User Agent. You may want to look at configuration
  356. hints for use of iptel.org site at
  357. http://www.iptel.org/phpBB/viewforum.php?forum=1&8
  358. For example, users of Windows Messenger need to set
  359. in Tools->Options->Accounts the following values:
  360. Sign-in Name: <username>@<your_server_address>
  361. Advanced->Configure Settings (on)
  362. Advanced->Server: <your_server_address>
  363. Connect Using: UDP
  364. D) ser with Persistent Data Storage
  365. The default configuration is very simple and features many simplifications.
  366. In particular, it does not authenticate users and loses User Location database
  367. on reboot. To provide persistence, keep user credentials and remember users'
  368. locations across reboots, ser can be configured to use MySQL. Before you proceed,
  369. you need to make sure MySQL is installed on your box. Your MySQL server must be
  370. configured to deal with a large number of connection. To increase it, set the
  371. following line in [mysqld] section of your configuration file:
  372. set-variable = max_connections=500
  373. 1) Download the package containing mysql support for ser from:
  374. http://www.iptel.org/ser/
  375. (rpm and deb provided, most of the binary tar.gz distributions and the
  376. solaris package include it; if it is not present you'll have to rebuild
  377. from the source).
  378. For gentoo please include 'mysql' to your USE variable in /etc/make.conf
  379. or give it as variable to the emerge command.
  380. 2) install the package
  381. rpm -i <package_name>
  382. or
  383. dpkg -i <package_name>
  384. or
  385. emerge ser
  386. (if do not want to put 'mysql' into your USE variable you can type:
  387. USE="mysql" emerge ser)
  388. 3) create MySQL tables
  389. - if you have a previously installed SER on your system, use
  390. /usr/sbin/ser_mysql.sh reinstall
  391. to convert your SER database into new structures
  392. - otherwise, if this is your very first installation, use
  393. /usr/sbin/ser_mysql.sh create
  394. to create SER database structures
  395. (you will be prompted for password of MySql "root" user)
  396. 4) configure ser to use SQL
  397. uncomment all lines in configuration file ser.cfg which are related to
  398. authentication:
  399. - loadmodule "/usr/lib/ser/modules/mysql.so"
  400. - loadmodule "/usr/lib/ser/modules/auth.so"
  401. - loadmodule "/usr/lib/ser/modules/auth_db.so"
  402. - modparam("usrloc", "db_mode", 2)
  403. - modparam("auth", "calculate_ha1", yes)
  404. - modparam("auth_db", "password_column", "password")
  405. - if (!www_authorize("iptel.org", "subscriber")) {
  406. www_challenge("iptel.org", "0");
  407. break;
  408. };
  409. 5) be sure to replace realm, the first parameter in www_* actions,
  410. with name of your server; some broken UAC implementations don't
  411. authenticate otherwise; the authentication command in your
  412. configuration script should look then like this:
  413. if (!www_authorize("myserver.foobar.com", "subscriber")) {
  414. www_challenge("myserver.foobar.com", "0");
  415. break;
  416. }
  417. 6) restart the server
  418. /etc/init.d/ser restart
  419. 7) you can now start managing the server using the serctl utility;
  420. you need to first set the environment variable SIP_DOMAIN to your
  421. local SIP realm, e.g.,
  422. export SIP_DOMAIN="myserver.foobar.com"
  423. a) watch the server status using 'serctl moni'
  424. b) try to login with your SIP client as user 'admin' with password 'heslo'
  425. c) try adding new users using
  426. 'serctl add <name> <password> <email>'
  427. 4. Troubleshooting
  428. ------------------
  429. Q: Windows Messenger authentication fails.
  430. A: The most likely reason for this problem is a bug in Windows Messenger.
  431. WM only authenticates if server name in request URI equals authentication
  432. realm. After a challenge is sent by SIP server, WM does not resubmit the
  433. challenged request at all and pops up authentication window again. If you
  434. want to authenticate WM, you need to set up your realm value to equal server
  435. name. If your server has no name, IP address can be used as realm too.
  436. Q: SIP requests are replied by ser with "483 Too Many Hops" or
  437. "513 Message Too Large"
  438. A: In both cases, the reason is probably an error in request routing script
  439. which caused an infinite loop. You can easily verify whether this happens
  440. by watching SIP traffic on loopback interface. A typical reason for misrouting
  441. is a failure to match local domain correctly. If a server fails to recognize
  442. a request for itself, it will try to forward it to current URI in believe it
  443. would forward them to a foreign domain. Alas, it forwards the request to itself
  444. again. This continues to happen until value of max_forwards header field reaches
  445. zero or the request grows too big. Solutions is easy: make sure that domain matching
  446. is correctly configured. A quick way to achieve that is to introduce a config
  447. option to ser.cfg: alias=domainname, where domainname shall be replaced with
  448. name of domain, which you wish to server and which appears in request-URIs.