OpenSIPS and Control Panel Install Guide
Most of the install procedures for OpenSIPS assume Debian. I prefer working with RHEL which is the reason for this install procedure. This guide should work on Debian with some minor modifications but I haven't tried.
Linux commands executed at a command prompt are in courier font.
Let's get started
It's assumed you already have a server with a base CentOS installation before you begin. Do NOT install a GUI such as Gnome or KDE. We only want to be running in console text mode not GUI graphics mode. If you already have a desktop or server GUI installed you will want to exit to console mode. You do that by typing init 3 from a terminal or console window. You will need to be logged in as root in order to do this so if not you can su root. All instructions in this guide are assuming you are always logged in as root running in level 3 console text mode.
Get rid of all installed groups except 'Yum Utilities' so we are starting with a clean slate. Check the delete list before entering 'y' to make sure none of these remove 'sshd' or 'yum' (they don't but check just in case things change with newer revisions).
yum grouplist installed
DNS Name Server
Legacy Network Server
Windows File Server
yum groupremove 'DNS Name Server'
yum groupremove 'Editors'
yum groupremove 'Legacy Network Server'
yum groupremove 'Mail Server'
yum groupremove 'Network Servers'
yum groupremove 'System Tools'
yum groupremove 'Text-based Internet'
yum groupremove 'Web Server'
yum groupremove 'Windows File Server'
Now update the base install
yum -y update
Install OpenSIPS and OpenSIPS-CP required packages, other useful packages, and their dependencies
yum groupinstall core
yum groupinstall base
yum install nano gcc gcc-c++ bison flex zlib-devel openssl-devel mysql-server mysql-devel subversion pcre-devel php-mysql php-pear
Selinux is not required or recommended. This will create the required file if it does not already exist. If it already exists copy paste or edit the contents indicated here to be sure selinux never runs.
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted # SETLOCALDEFS= Check local definition changes SETLOCALDEFS=0
(Ctrl-x> y >Enter)
Make sure selinux is turned off for this session
OpenSIPS and xmlrpc
Thanks to the author of this post for the valuable information
Compile the library xmlrpc-c which is required for OpenSIPS-CP. If you forget to use --disable-abyss-threads the system will dump the core because OpenSIPS is multiprocess but not multithreaded. The newer versions of xmlrpc compile by default with threads enabled. This problem does not occur with Debian or Ubuntu because they use an older version of xml-rpc (0.9.1) that does not support threads.
If the --prefix=/usr is not used the sofware will install in /usr/local which will result in CentOS not able to find the xmlrpc libraries which will be in /usr/local/lib instead of /usr/lib. So you would have to copy/paste and then /sbin/ldconfig -v. Or you would have to create a symbolic link. Using the --prefix=/usr so it is put in the expected place to begin with is simpler IMHO.
tar -xzvf xmlrpc-c-1.16.36.tgz
./configure --disable-abyss-threads --prefix=/usr
Download the latest OpenSIPS v6 source
svn co https://opensips.svn.sourceforge.net/svnroot/opensips/branches/1.6 opensips
Remove from the “Exclude=” (line 52) the modules db_mysql and mi_xmlrpc so that they are included in the compilation process.
remove the db_mysql and mi_xmlrpc in the section starting on line 52 and then save.
Now compile OpenSIPS
make prefix=/ all
make prefix=/ install
uncomment (#) DBENGINE=MYSQL
service mysqld start
Create OpenSIPS database. NOTE: when it asks for a root password it will be blank unless you have previously set it to something else.
Answer 'y' to both questions
edit the opensips.cfg file
uncomment the following lines:
modparam("usrloc", "db_mode", 2)
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
Check if OpenSIPS starts
you should see
Install the admin privileges table schema.
mysql -D opensips -p
>INSERT INTO ocp_admin_privileges (username,password,ha1,available_tools,permissions) values ('admin','admin',md5('admin:admin'),'all','all');
mysql -D opensips -p
mysql -D opensips -p < tables.mysql
mysqladmin -u root password 'abcdef'