[SOLVED] Mattermost webapp server and mattermost go server on separate IP addresses

Are there any resources for configuring Mattermost to run the webapp and go server on separate servers with separate IP’s?

Hi @johncoleman83,

I don’t believe that’s supported right now. You can run the server without the web app by setting the ServiceSettings.WebserverMode to "disabled" in the config.json, but the web app assumes it’s running on the same machine as the server.

If you want, you can make a post on our Feature Ideas forum so other people can vote and show support for it, and we can prioritize accordingly. I’m actually surprised there isn’t one for this already

1 Like

Hi @hmhealey,

Thanks for looking into that! My reason for wondering is because I’m going to be managing traffic. The alternative is to have multiple instances of both web server and go app server running on separate IP’s with load balancer and a primary / replica MySQL DB. I think I will go that route because I wouldn’t want to hack an alternative that I would have to deal with after updates.

hey! did anyone make it any further with this effort?

i’m still investigating options on how to do this – I believe it is possible.

in the mattermost-webap, there’s a file, configuration_settings.jsx, that draws some configuration items from the mattermost-server – chief among them is SiteURL. i believe is related to telling the webapp where to look for the server API.

getConfigFromState(config) {
this.handleSamlUrlChange(config, this.state.siteURL);

config.ServiceSettings.SiteURL = this.state.siteURL;
config.ServiceSettings.ListenAddress = this.state.listenAddress;
config.ServiceSettings.WebserverMode = this.state.webserverMode;
config.ServiceSettings.ConnectionSecurity = this.state.connectionSecurity;
config.ServiceSettings.TLSCertFile = this.state.TLSCertFile;
config.ServiceSettings.TLSKeyFile = this.state.TLSKeyFile;
config.ServiceSettings.UseLetsEncrypt = this.state.useLetsEncrypt;
config.ServiceSettings.LetsEncryptCertificateCacheFile = this.state.letsEncryptCertificateCacheFile;
config.ServiceSettings.Forward80To443 = this.state.forward80To443;
config.ServiceSettings.ReadTimeout = this.parseIntNonZero(this.state.readTimeout);
config.ServiceSettings.WriteTimeout = this.parseIntNonZero(this.state.writeTimeout);
config.ServiceSettings.EnableAPIv3 = this.state.enableAPIv3;

return config;
}

getStateFromConfig(config) {
return {
    siteURL: config.ServiceSettings.SiteURL,
    listenAddress: config.ServiceSettings.ListenAddress,
    webserverMode: config.ServiceSettings.WebserverMode,
    connectionSecurity: config.ServiceSettings.ConnectionSecurity,
    TLSCertFile: config.ServiceSettings.TLSCertFile,
    TLSKeyFile: config.ServiceSettings.TLSKeyFile,
    useLetsEncrypt: config.ServiceSettings.UseLetsEncrypt,
    letsEncryptCertificateCacheFile: config.ServiceSettings.LetsEncryptCertificateCacheFile,
    forward80To443: config.ServiceSettings.Forward80To443,
    readTimeout: config.ServiceSettings.ReadTimeout,
    writeTimeout: config.ServiceSettings.WriteTimeout,
    enableAPIv3: config.ServiceSettings.EnableAPIv3
};
}

handleSaved(newConfig) {
if (newConfig.ServiceSettings.SiteURL) {
    ErrorStore.clearError(ErrorBarTypes.SITE_URL);
}
}

handleSamlUrlChange(config, siteURL) {
if (config.SamlSettings.AssertionConsumerServiceURL.length > 0 && siteURL.length > 0) {
    config.SamlSettings.AssertionConsumerServiceURL = this.state.siteURL + '/login/sso/saml';
}
}

This seems to be drawing these variables from mattermost-server/config/default.json