1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
|
$Id: INSTALL,v 1.8 2006/07/07 09:02:22 bogdan_iancu Exp $
===========================================
OpenSER Installation Notes
http://www.openser.org/
===========================================
This memo gives you hints how to set up OpenSER quickly. To
understand how OpenSER works and how to configure it properly,
read admin's guide available from OpenSER website. We also
urge you to read latest ISSUES (available from OpenSER website
too) and check for potential problems in this release.
Users of previous releases are encouraged to read NEWS to
learn how to move to this new OpenSER version.
TOC
1. Supported Architectures and Requirements
2. Howto Build openser From Source Distribution
3. Quick-Start Installation Guide
A) Getting Help
B) Disclaimers
C) Quick Start
D) openser with Persistent Data Storage
4. Troubleshooting
1. Supported Architectures and Requirements
-------------------------------------------
Supported architectures: Linux/i386, Linux/armv4l, FreeBSD/i386, OpenBSD/i386
Solaris/sparc64, NetBSD/sparc64
(for other architectures the Makefiles might need to be edited)
There are various configuration options defined in the Makefile.
Requirements:
- 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)
- bison or yacc (Berkley yacc)
- flex
- GNU make (on Linux this is the standard "make", on FreeBSD and Solaris is
called "gmake") version >= 3.79.
- sed and tr (used in the makefiles)
- GNU tar ("gtar" on Solaris) and gzip if you want "make tar" to work
- GNU install or BSD install (on Solaris "ginstall") if you want "make
install", "make bin", "make sunpkg" to work
- openssl if you want to compile the TLS support
- libmysqlclient & libz (zlib) -libs and devel headers- if you want mysql DB
support (the mysql module)
- libpq / postgresql -libs and devel headers- if you want postgres DB
support (the postgres module)
- unixodbc -libs and devel headers- if you want unixodbc DB
support (the unixodbc module)
- libexpat if you want the jabber gateway support (the jabber module)
- libxml2 if you want to use the cpl-c (Call Processing Language) and
PA (Presence Agent) modules
- libradius-ng -libs and devel headers- if you want to use functionalities
with radius support - authentication, accounting, group support, etc
OS Notes:
- FreeBSD/OpenBSD/NetBSD: make sure gmake, bison or yacc & flex are installed
- Solaris: as above; you can use Solaris's yacc instead of bison. You might
need also gtar and ginstall.
2. Howto Build openser From Source Distribution
-------------------------------------------
(NOTE: if make doesn't work try gmake instead)
- compile with default options (TLS support is by default configured):
make #builds only openser core, equivalent to make openser
make modules
or make all #builds everything
-compile debug mode version
make mode=debug all
-compile only the print module
make modules=modules/print modules
-compile all the "default" modules except textops and mysql
make skip_modules="textops mysql" 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 exec:
make exclude_modules=exec modules
or
make exclude_modules="" skip_modules=exec modules
-compile with gcc-3.2 instead of gcc
make CC=gcc-3.2 all
or
CC=gcc-3.2 make all
Make targets:
Clean:
make clean (clean the modules too)
make proper (clean also the dependencies)
make distclean (the same as proper)
make mantainer-clean (clean everything, including auto generated files,
tags, *.dbg a.s.o)
Compile:
make proper
make
(or gmake on non-Linux systems)
make modules
or make modules exclude_modules="CVS exec" etc.
Make tags:
make TAGS
Create a tar.gz with the sources (in ../):
make tar
Create a tar.gz with the binary distribution (in ../):
make bin
Create a gzipped solaris package (in ../):
make sunpkg
Create debian packages (in ../):
make deb
or
dpkg-buildpackage
Install:
make prefix=/usr/local install
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 OpenSER will look for the default
configuration file in a wrong directory, because the directory of the
default configuration file is hard coded into openser during compile time.
When you use a different prefix parameter when installing then the
directory hard coded in openser 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 openser).
For example, if you do the following:
make all
make prefix=/ install
Then the installation will put the default configuration file into
/etc/openser/openser.cfg (because prefix is /), but openser will look for the
file in /usr/local/etc/openser/openser.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").
3. Quick-Start Installation Guide
----------------------------------------------
A) Getting Help
This guide gives you instructions on how to set up the Open SIP Express
Router (openser) on your box quickly. In case the default configuration
does not fly, check documentation at openser site
http://www.openser.org/
to learn how to configure OpenSER for your site.
If the documentation does not resolve your problem you may try contacting
our user forum by E-mail at users@openser.org -- that is the mailing list
of openser community. To participate in the mailing list, subscribe at the
following web address:
http://www.openser.org/cgi-bin/mailman/listinfo/users
B) Disclaimers
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.)
C) Quick Start
The following step-by step guide gives you instructions how to install the
sql-free distribution of openser. If you need persistence and authentication,
then you have to install additional MySql support -- proceed to section D)
after you are finished with C).
1) Download an RPM or debian package from our site
http://openser.org/pub/openser/latest/packages/
If you don't use an rpm or debian based distribution, see if corresponding
packages are available or try our tar.gz'ed binaries.
If you use Gentoo Linux you do not have to download a package.
For debian, APT repositories are available for all versions at:
deb http://www.openser.org/debian etch main
deb http://www.openser.org/debian sarge main
deb http://www.openser.org/debian sid main
2) install the package
RPM:
rpm -i <package_name>
debian:
dpkg -i <package_name>
or if APT repository is used:
apt-get install <package_name>
gentoo:
emerge openser
(or if use only stable packets: ACCEPT_KEYWORDS="~x86" emerge openser)
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/openser/openser.cfg)
Solaris:
gunzip <package_name>.gz ; pkgadd -d <package_name>
*BSD:
pkg_add package_name
3) start the server
RPM + gentoo:
/etc/init.d/openser start
debian:
openser is started automatically after the install
(in case something fails you can start it with /etc/init.d/openser start)
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/openser.init.*, gentoo/openser.init)
You can start openser directly with /usr/local/sbin/openser.
Solaris:
see tar.gz.
4) optionally, watch server's health using the openserctl utility
- to do so, first set the environment variable SIP_DOMAIN to your domain
name, e.g., in Bourne shell, call
export SIP_DOMAIN="myserver.foobar.com"
- 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 openserctl script
- run the openserctl utility
/usr/sbin/openserctl moni
or
/usr/local/sbin/openserserctl moni (if you installed from a tar.gz
or solaris package)
- you can create a resource file for openserctl, name it .openserctlrc
and place it in your home directory. You can set there the values for
openserctl variables (e.g., SIP_DOMAIN, SQL_HOST, SQL_USER, SQL_DB ...)
5) Register with the server using your favourite SIP User Agent.
For example, users of Windows Messenger need to set
in Tools->Options->Accounts the following values:
Sign-in Name: <username>@<your_server_address>
Advanced->Configure Settings (on)
Advanced->Server: <your_server_address>
Connect Using: UDP
D) openser with Persistent Data Storage
The default configuration is very simple and features many simplifications.
In particular, it does not authenticate users and loses User Location database
on reboot. To provide persistence, keep user credentials and remember users'
locations across reboots, openser can be configured to use MySQL. Before you
proceed, you need to make sure MySQL is installed on your box.
1) Download the package containing mysql support for openser from:
http://www.openser.org/pub/openser/
(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).
For gentoo please include 'mysql' to your USE variable in /etc/make.conf
or give it as variable to the emerge command.
2) install the package
RPM based:
rpm -i <package_name>
DEB based:
dpkg -i <package_name>
or if APT repository is used
apt-get install <package_name>
Gentoo Linux:
emerge openser
(if do not want to put 'mysql' into your USE variable you can type:
USE="mysql" emerge openser)
3) create SQL tables
If you use MySQL support, use openser_mysql.sh. For Postgres use
openser_postgres.sh.
- if you have a previously installed OpenSER on your system, use
/usr/sbin/openser_mysql.sh reinstall
to convert your OpenSER database into new structures
- otherwise, if this is your very first installation, use
/usr/sbin/openser_mysql.sh create
to create OpenSER database structures
(you will be prompted for password of MySql "root" user)
4) configure openser to use SQL
uncomment all lines in configuration file openser.cfg which are related to
authentication:
- loadmodule "/usr/lib/openser/modules/mysql.so"
- loadmodule "/usr/lib/openser/modules/auth.so"
- loadmodule "/usr/lib/openser/modules/auth_db.so"
- modparam("usrloc", "db_mode", 2)
- modparam("auth", "calculate_ha1", yes)
- modparam("auth_db", "password_column", "password")
- if (!www_authorize("sip.org", "subscriber")) {
www_challenge("sip.org", "0");
break;
};
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
/etc/init.d/openser restart
7) you can now start managing the server using the openserctl utility;
you need to first set the environment variable SIP_DOMAIN to your
local SIP realm, e.g.,
export SIP_DOMAIN="myserver.foobar.com"
or you can configure via the resource file for openserctlrc. The default
file is insatlled in the etc/ directory of your installation (along with the
OpenSER config file). For per user configuration, create .openserctlrc
in your home directory.
You can set there the values for openserctl variables like:
SIP_DOMAIN - your SIP domain
DBENGINE - database type: MYSQL or PGSQL, by defaulte none is loaded
DBHOST - database host
DBNAME - database name
DBRWUSER - database read/write user
DBROUSER - database read only user
DBROPW - password for database read only user
DBROOTUSER - database super user
ALIASES_TYPE - type of aliases used:
DB - database aliases
UL - usrloc aliases
default none
CTLENGINE - control engine: FIFO or UNIXSOCK
OSER_FIFO - path to FIFO file
VERBOSE - verbose - debug purposes - default '0'
a) watch the server status using 'openserctl moni'
b) try to login with your SIP client as user 'admin' with
password 'openserrw'
c) try adding new users using
'openserctl add <name> <password> <email>'
8) default values (database url, users and passwords) are:
- DEFAULT_DB_URL="mysql://openser:openserrw@localhost/openser"
- r/w user: openser ; passwd: openserrw
- r/o user: openserro ; passwd: openserro
VERY IMPORTANT NOTE: for security reasons, do change the values of
passwords after installation
4. Troubleshooting
------------------
Q: SIP requests are replied by openser 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 openser.cfg: alias=domainname, where domainname shall be replaced
with name of domain, which you wish to server and which appears in
request-URIs.
|