Chat server host name problem

Hello everyone,

i have correctly setup the ejabberd chat server. My problem is that i had to change host name in ejabberd.cfg because my server is hosted in office.example.com and the file only had example.com in the settings. After an update is stopped working and i went to check the file again and the office.example.com part was removed. There was only example.com. Is there a way to keep it permanently?

Thanks!

You can use a custom template, but if the domain is not properly detected there might be something else wrong.

For custom template: didn’t test it but should be something along the lines of:

mkdir -p /etc/e-smith/templates-custom/etc/ejabberd/

Then copy there the ejabberd config file and modify it.

1 Like

Excuse me but i’m not familiar with custom templates. What will it do exactly? Whenever i update it will keep this setting?

Me neither. But basically, the settings you set there will take prevalence, and remain after reboots and updates.

There is more detailed info on the Developers Manual, but first you can read http://docs.nethserver.org/en/latest/chat.html to make sure you didn’t miss some setting.

I get how it works but if there’s a better or different method i’d like to hear it.

There’s no mention in the docs about host name unfortunately.

What i noticed is in the Server Name module i have hostname set to office and domain to example.com. Maybe ejabberd gets the hostname from there?

1 Like

AFAIK, the Host name field is the domain name. Here’s my server:
% Host name:
{hosts, [“nethesis.it”]}.

And it works as expected with pidgin or empathy.
Maybe you need to adjust something on the xmpp client?

The thing is it should connect to office.example.com which is the server running nethserver and not example.com which is a different server. In the host name it defaults to example.com whenever i update/install/remove something and not to office.example.com.

Could this be related?

If NethServer is also the DNS server of the network, the client should automatically find the server’s address through special pre-configured DNS records. Otherwise, specify the server address in the advanced options.

In the DNS module where it says DNS Servers it’s set to 8.8.8.8, in the Hosts there’s office.example.com and Server Alias is empty. Where are the advanced settings that it says? In the chat server module i can only enable or disable ejabber.

It refers to the advanced settings on the client side.

Oh, i don’t think that’s the problem as the configuration file changes from having the host set to office.example.com to example.com. Not 100% but pretty sure it has something to do with this.

Not sure if this will be of help as your setup might be different, but did a quick test on a VM (first time config, without using a real domain).

NethServer acting as Gateway (DHCP, DNS server).
ejabberd installed without changing any file.
Users created on the server.

On LAN, xmpp (pidgin) clients configured with:

  • Username: userx
  • Domain: example.com
  • Password: userx-password

Anything else left as per defaults.
LAN clients were able to chat.

For external xmpp (pidgin) client used same settings but adding the server address on pidgin’s Advanced tab (connect server), and configuring my router to forward xmpp ports to the server.

Also tried from mobile phone with Conversations xmpp client, configuring it with the server address (used Public IP address, as had no real domain prepared). External client was able to chat.

With a real domain you might need to configure DNS SRV records. I think @filippo_carletti and @tzar can help you better on that. :wink:


Continuing the discussion from Ejabberd service won't start:

The ejabberd web interface is disabled by default, but can be enabled as per @giacomo indications:

config setprop ejabberd WebAdmin enabled
signal-event nethserver-ejabberd-save

Then you can access as admin@example.com, for instance, at https://ip-address-or-domain:5280/admin/

I get it but the problem is that example.com is a different server in a different place used to host the website. office.example.com leads to the server that has jabber so if the client uses example.com it will try to connect to a different server to no avail.

Also i used the commands to enable webadmin interface but i only get this written in the browser when i try to connect to it using LAN IP:

<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3195391253' from='pav-security.gr' version='1.0'><stream:error><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error></stream:stream>

I’m using office.example.com in pidgin to connect to the server and not an IP address. If i change the config file from example.com to office.example.com it works perfectly. Even further now that i run the commands for enabling the webadmin interface the config file was again changed to use example.com instead of the office.example.com and pidgin fails to connect.

I really appreciate your time and sorry for asking so many questions but i can’t seem to fix it.

@LamboLighting, did you sorted it out? If not, lets see if someone can help.

P.S. About the xml message you may have tried to access the wrong port number.