INSTALL 17 KB

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