Hostnames

This one might be a little bit more tricky than previous as hostnames setting has to be changed in a few places. Don’t ask why now as this is the "Short configuration guide", you remember. Here we focus on how not on why.

The best way to find all places where hostnames should be changes execute following command:

./bin/config.sh -c etc/tigase-server.xml -print | grep hostnames

As a result you can see something like this:

tigase-xmpp-server/hostnames = yourhost, localhost
client_1/hostnames = yourhost, localhost
server_1/hostnames = yourhost, localhost
session_1/hostnames = yourhost, localhost

It may also look:

tigase-xmpp-server/hostnames = localhost
client_1/hostnames = localhost
server_1/hostnames = localhost
session_1/hostnames = localhost

Depending how successful was mechanism for automatic hostname detection. It of course does not depends on your luck. It depends on network configuration on your server.

The first form is more useful as it includes also hostname recognized in network environment. If it is correct then you can just leave it as it is. If it is incorrect you have to change it. Please remember, if you want your server to be able to communicate with other Jabber/XMPP servers the hostname you put there must resolve in DNS to your Jabber server machine IP address. In other words. If you try to connect from the Internet to machine with this hostname the connection should reach your Jabber server.

And remember your Jabber server users' JIDs (Jabber IDs) can include only those hostnames which are included in the configuration. So for our case you can use only JIDs: "user2@your.hostname.com", "user1@your.hostname.com" and so on.

If you server have more Internet addresses (virtual domains) assigned to it your Jabber server can use them all. So your configuration may look ike:

tigase-xmpp-server/hostnames = yourhost, localhost, your.hostname.com, clien1.hostname.com
client_1/hostnames = yourhost, localhost, your.hostname.com, clien1.hostname.com
server_1/hostnames = yourhost, localhost, your.hostname.com, clien1.hostname.com
session_1/hostnames = yourhost, localhost, your.hostname.com, clien1.hostname.com

In such case users' JIDs on your Jabber server may include any of defined above domains like: "user1@your.hostname.com", "user1@clien1.hostname.com", "user1@yourhost". Each of these 3 sample JIDs refer to different user account.

Your server will accept connections only for domains defined in configuration file.

In majority cases it does not matter whether you leave "localhost" or remove it. It is sometimes better to leave it though. So if you are not sure if you can remove it in your environment just leave it as is.

Now it is a time to change hostnames. Assuming default configuration is not what you need than first you have to set all these settings to accept connections from localhost:

./bin/config.sh -c etc/tigase-server.xml -print -key tigase-xmpp-server/hostnames -value localhost -set
./bin/config.sh -c etc/tigase-server.xml -print -key client_1/hostnames -value localhost -set
./bin/config.sh -c etc/tigase-server.xml -print -key server_1/hostnames -value localhost -set
./bin/config.sh -c etc/tigase-server.xml -print -key session_1/hostnames -value localhost -set

Now we can add you "real" host name, let’s say it is yourhost:

./bin/config.sh -c etc/tigase-server.xml -print -key tigase-xmpp-server/hostnames -value yourhost -add
./bin/config.sh -c etc/tigase-server.xml -print -key client_1/hostnames -value yourhost -add
./bin/config.sh -c etc/tigase-server.xml -print -key server_1/hostnames -value yourhost -add
./bin/config.sh -c etc/tigase-server.xml -print -key session_1/hostnames -value yourhost -add

The same way you can add more virtual hosts to you configuration.