Configuring apache for Web Socket SSL Switchboard: Difference between revisions

From MiRTA PBX documentation
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
Unfortunately there is no available Server Websocket library supporting SSL out of the box. To allow Websocket connections over SSL, it is needed to configure a reverse proxy in Apache.
Unfortunately there is no available Server Websocket library supporting SSL out of the box. To allow Websocket connections over SSL, it is needed to configure a reverse proxy in Apache.


Unfortunately Apache shipped with CentOS 6 doesn't not support proxying Websocket protocol, so ad additional package needs to be installed. The package can be installed from the server repository:
While CentOS 7 supports proxying websocket directly, unfortunately Apache shipped with CentOS 6 doesn't not support proxying Websocket protocol, so ad additional package needs to be installed. The package can be installed from the server repository:


<pre>
<pre>
Line 19: Line 19:


The port needs to match the port specified in the Admin/Settings "Real Time Portal service - Listening Port"
The port needs to match the port specified in the Admin/Settings "Real Time Portal service - Listening Port"
Don't forget to add to your /etc/rc.local and to start manually the first time
<pre>
nohup /usr/local/bin/restartrtportal.sh &
</pre>


[[file:rtportalconfig.png|400px]]
[[file:rtportalconfig.png|400px]]

Revision as of 22:03, 12 October 2018

Unfortunately there is no available Server Websocket library supporting SSL out of the box. To allow Websocket connections over SSL, it is needed to configure a reverse proxy in Apache.

While CentOS 7 supports proxying websocket directly, unfortunately Apache shipped with CentOS 6 doesn't not support proxying Websocket protocol, so ad additional package needs to be installed. The package can be installed from the server repository:

yum -y install https://demo.mirtapbx.com/mirtapbx_support/mod_proxy_wstunnel-0.1-1.el6.fws.x86_64.rpm

Once this module is installed, you need to configure your reverse proxy by adding:

<IfModule mod_proxy.c>
    ProxyPass "/wsrtportal/" "ws://127.0.0.1:8081/" retry=0 timeout=5
    ProxyPassReverse "/wsrtportal/" "ws://127.0.0.1:8081/"
</IfModule>

If you prefer, you can just copy the wsproxy.conf file from MiRTA PBX protected folder in /etc/httpd/conf.d and restart your web server.

The port needs to match the port specified in the Admin/Settings "Real Time Portal service - Listening Port"

Don't forget to add to your /etc/rc.local and to start manually the first time

nohup /usr/local/bin/restartrtportal.sh &


Rtportalconfig.png

Updating libraries

It can be needed to upgrade some libraries used by the software, in this case you need to first install composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

then run

php composer.phar update