Hello
I set up openfire 4.5 on the same host nextcloud 17 is running. To do this I followed video on youtube. Under "server settings in openfire I enabled “allow BOSH clients …”. The whole set up runs in a Virtualbox test environment. In this Virtualbox host I also set up my own certificate environment.
in order to redirect URLs (www -> non-www / http -> https) I use in the port 80 apache vhost the rules
# redirect www to non-www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^/(.*) http://%1/$1 [L,R=301]
# redirect http requests to https
RewriteEngine On
RewriteCond %{HTTP_HOST} !^localhost
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}:443%{REQUEST_URI} [R=301,L]
The condition
RewriteCond %{HTTP_HOST} !^localhost
helps me to prevent localhost/phpmyadmin to be redirected. In the conf file for the nextcloud server I use the rewrite setting
# redirect www to non-www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^/?(.*) https://%1/$1 [R=301,L]
With these setting the cloud user could simply enter the URL cloud.test.dzn and they will be always redirected to https://cloud.test.dzn.
For running ojsxc/openfire I tried n apache in the port 80 apache vhost conf (before rewrite rules)
ProxyPass /http-bind/ https://localhost:7070/http-bind/
ProxyPassReverse /http-bind/ https://localhost:7070/http-bind/
in the ojsxc (nextcloud) settings I enabled “external (own XMPP server)” under “XMPP domain” I configured “localhost” in the field “BOSH url” i set “/http-bind/”. Doing so I get the message
BOSH server NOT reachable or misconfigured.
Invalid XML received. Maybe https://cloud.test.dzn/http-bind/ was redirected. You should use an absolute url.
Then I tried to follow the Collabora Online proxy configuration. So I added
ProxyPass /http-bind/ https://localhost:7443/http-bind/
ProxyPassReverse /http-bind/ https://localhost:7443/http-bind/
before the rewrite rules. Then I tried in the ojsxc settings https://cloud.test.dzn (xmpp domain) and /http-bind) (bosh url). This way I get the message
BOSH server NOT reachable or misconfigured.
500 Internal Server Error
I would prefer the localhost version!! Do I have to add a specific RewriteCond for the openfire localhost URL? How should this rule look like?
By the way nestat -nlp shows that openfire is listening on port 7070 and 7443.
So any hint is welcome!!
Kind regards, go4 ncloud