Rocket.Chat under own subdomain problems

apache
rocketchat
subdomain
problem

#1

Hello,

I want to make rocket.chat accessible under a subdomain. Unfortunately I only get one white page in my browser.

Currently I have created a new configuration file in the directory /etc/apache2/sites-enable/.

rocketchat-ssl.conf

<IfModule mod_ssl.c>

<VirtualHost *:443>
        ServerAlias rocketchat.domain.org

        SSLEngine on
        SSLProxyEngine on
        SSLProxyCheckPeerCN off
        SSLProxyCheckPeerName off
        SSLProxyCheckPeerExpire off
        SSLCertificateFile /etc/univention/letsencrypt/signed_chain.crt
        SSLCertificateKeyFile /etc/univention/letsencrypt/domain.key
        SSLCACertificateFile /etc/univention/ssl/ucsCA/CAcert.pem

        ProxyPass / http://127.0.0.1:40002/rocketchat/ retry=0
        ProxyPassReverse / http://127.0.0.1:40002/rocketchat/

</VirtualHost>
</IfModule>

In RocketChat I have adapted the website URL. Unfortunately the browser shows only a white page. Where do I have to change the settings?

Greeting
Christian


#2

Hello @CSchepelmann,

the Rocket.Chat app setup does not support a subdomain setup directly because Rocket.Chat is initialized with the default ROOT_URL: https://$hostname.$domainname/rocketchat.

Adding a new site to the Apache configuration on the UCS host is only one part of the necessary changes. I haven’t tested it, but I would next change this ROOT_URL for Rocket.Chat itself:

  1. Login as admin user to your Rocket.Chat app
  2. Go to AdministrationGeneral
  3. Change Site URL to the one you prefer and save the changes.

This way you could also remove the subfolder configuration with /rocketchat in the Site URL. Of course, you need to change your apache site configuration accordingly.

Changing the settings in Rocket.Chat should also be update save for the app, because the setting is stored in the Rocket.Chat database and thus survives the exchange of Docker containers.

I’m curious if it worked for you. Please let me know.

Best regards,
Nico