在向大家详细介绍OpenSIPs安装之前,首先让大家了解下OpenSIPs安装,然后全面介绍OpenSIPs安装,希望对大家有用。OpenSIPs安装 mysql模块的安装。
1、安装CentOs 4.5,选custom安装,开发包及Mysql要装全:
- # rpm –qa | grep mysql 查看“mysql”、“mysql-devel”、 “mysql-server”三个是否完全安装否?
- # /etc/init.d/mysqld start 起动Mysql
2、上传OpenSIPs安装稳定版,opensips-1.4.4-tls_src.tar
[/usr/src] # tar zxvf opensips-1.4.4-tls_src.tar.gz
进入opensips-1.4.4-tls_src目录中,删除Makefile中的exclude_modules 的db-mysql ,为了使OpenSIPs安装支持mysql。
3、编译安装:
- # make all
- # make install
默认安装路径为/usr/local/sbin /usr/local/share……
4、OpenSIPs安装创建数据库
编缉:/usr/local/etc/opensips/opensipsctlrc
- ## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, or DBTEXT, by default none is loaded
- # If you want to setup a database with opensipsdbctl, you must at least specify
- # this parameter.
- DBENGINE=MYSQL
- ## database host
- DBHOST=localhost
- ## database name (for ORACLE this is TNS name)
- DBNAME=opensips
- # database path used by dbtext or db_berkeley
- DB_PATH="/usr/local/etc/opensips/dbtext"
- ## database read/write user
- DBRWUSER=opensips
- ## password for database read/write user
- DBRWPW="opensipsrw"
- ## database read only user
- DBROUSER=opensipsro
- ## password for database read only user
- DBROPW=opensipsro
- ## database super user (for ORACLE this is 'scheme-creator' user)
- DBROOTUSER="root"
- # user name column
- USERCOL="username"
OpenSIPs安装修改完后,在/usr/local/sbin/目录下执行:./opensipsdbctl create (生成opensips数据库)
- [root@localhost sbin]# ./opensipsdbctl create
- MySQL password for root:
- INFO: test server charset
- INFO: creating database opensips ...
- INFO: Core OpenSIPS tables succesfully created.
- Install presence related tables? (y/n): y
- INFO: creating presence tables into opensips ...
- INFO: Presence tables succesfully created.
- Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist? (y/n): y
- INFO: creating extra tables into opensips ...
- INFO: Extra tables succesfully created.
5、运行OpenSIPs安装:
- /usr/local/sbin/opensipsctl start 启动opensips
- 查看进程: ps –ef |grep opensips
- /usr/local/sbin/opensipsctl stop 停止opensips
6、OpenSIPs安装配置文件:
- vi /usr/local/etc/opensips/opensips.cfg
- loadmodule "db_mysql.so" 去掉#打开mysql模块
- loadmodule "auth.so" 去掉#
- loadmodule "auth_db.so" 去掉#
- loadmodule "alias_db.so"
- modparam("usrloc", "db_mode", 0) 0改为2
- modparam("auth_db", "calculate_ha1", yes) 去掉#
- modparam("auth_db", "password_column", "password") 去掉#
【编辑推荐】