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/html/ and the OCP files are located in /var/www/html/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/html/opensips-cp/web> Options Indexes FollowSymLinks MultiViews AllowOverride None Require all granted </Directory> <Directory /var/www/html/opensips-cp> Options Indexes FollowSymLinks MultiViews AllowOverride None Require all denied </Directory> Alias /cp /var/www/html/opensips-cp/web <DirectoryMatch "/var/www/html/opensips-cp/web/tools/.*/.*/(template|custom_actions|lib)/"> Require all denied </DirectoryMatch>
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.
Do not forget 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.
Before trying to login into OCP, you must create the tables specific to OCP.
From the opensips-cp/ folder run:
mysql -Dopensips -p < config/db_schema.mysql or psql -h host_name -U postgres_username -d opensips < config/db_schema.pgsql
This will create the OCP specific tables into the opensips database and add a first access user, the admin user with the opensips password.
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.