OpenSIPS Control Panel has been tested and developed mostly on Debian and Redhat Linux , but, being a web portal qualifies it to work also with other Linux distros and operating systems as well. Most of the paths and commands in this INSTALL guide are be debian/redhat specific.
What do you need for running OCP?
This tutorial assumes that your web directory is /var/www/ and the OCP files are located in /var/www/opensips-cp/ folder. Your web directory may depend on your Operating System or on the used web server.
Depending on your Linux distro, do:
Add the configuration below into one of Apache's existent VHOSTs or create a new one.
<Directory /var/www/opensips-cp/web> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> <Directory /var/www/opensips-cp> Options Indexes FollowSymLinks MultiViews AllowOverride None Order deny,allow deny from all </Directory> Alias /cp /var/www/opensips-cp/web
You can read more about Apache's VHOSTS here.
Apache is going to need write permissions on some files / folders in the opensips-cp directory, so you can do:
You must have PHP installed and enabled in the web server. In order to do that you will have to install php and some of it's extensions.
Check if these extensions are enabled :
Do not forget to set in your php.ini (usaully /etc/php5/apache2/php.ini ) :
short_open_tag = On ;
MDB2 pear needs to be installed with the appropriate DB driver (mysql / postgresql / mssql / sqlite etc.)
pear install MDB2 pear install MDB2#mysql //should you choose to go with the mysql database pear install log
Do not forge to restart Apache after all the php changes!!!
The OpenSIPS Control Panel requires access to database for two purposes:
The OpenSIPS Control Panel can connect to a remote database server, so the DB server can be used from the SIP Server machine or another machine in the network.
For the admin tools (create and list) you must add a new table. The admin users are the login users into OCP.
Install the ocp_admin_privileges table schema (we only provide the schema for mysql and pgsql). From the opensips-cp/ folder run:
mysql -Dopensips -p < config/tools/admin/add_admin/ocp_admin_privileges.mysql or psql -h host_name -U postgres_username -d opensips < config/tools/admin/add_admin/ocp_admin_privileges.pgsql
This will create the ocp_admin_privileges table into the opensips database. Next step is to insert a first login user into the table (user 'admin' with password 'admin' with full privileges):
INSERT INTO ocp_admin_privileges (username,password,ha1,available_tools,permissions) values ('admin','admin',md5('admin:admin'),'all','all');
For the Statistics Monitor (smonitor) tool you must add two tables to the OpenSIPS database:
mysql -Dopensips -p < config/tools/system/smonitor/tables.mysql or psql -h host_name -U postgres_username -d opensips < config/tools/system/smonitor/tables.pgsql
In order to allow OCP to sample the statistics from the OpenSIPS boxes, you need to install some cron jobs. First edit the config/tools/system/smonitor/opensips_stats_cron file and change/correct the path to your OpenSIPS Control Panel installation:
Now simply install the cron jobs by doing:
cp config/tools/system/smonitor/opensips_stats_cron /etc/cron.d/NOTE: you may need to restart the cron service at this point.