Difference between revisions of "HowTos/ChangeFQDN"

From Scalix Wiki
Jump to: navigation, search
m (Changing the FQDN of a Scalix Server)
m
Line 1: Line 1:
==Changing the FQDN of a Scalix Server==
+
==Changing the Hostname of a Scalix Server==
  
 
If for some reason you absolutely need to change the fully qualified domain name of a Scalix server please follow these steps.
 
If for some reason you absolutely need to change the fully qualified domain name of a Scalix server please follow these steps.

Revision as of 10:40, 18 October 2006

Changing the Hostname of a Scalix Server

If for some reason you absolutely need to change the fully qualified domain name of a Scalix server please follow these steps.

For this example we will change the hostname from old.scalix.demo to new.scalix.demo.

Change the server's name

The procedure for doing this will vary based on your linux distribution, the basic idea is to change /etc/hosts so that your server can resolve its own IP, as well as changing whichever file your distribution uses to store the hostname, such as /etc/default/hostname, /etc/sysconfig/network or similar.

When you are done the command hostname --fqdn should output the new hostname correctly.

Use sxmodfqdn to correct user settings

Output of sxmodfqdn

[root@new ~]# sxmodfqdn 
usage:/opt/scalix/bin/sxmodfqdn -o oldfqdn -n newfqdn

The syntax in our example would then be sxmodfqdn -o old.scalix.demo -n new.scalix.demo

This command will rewrite the relevant parts of the user configuration to tell Scalix where to look for existing users' directory entries.

Change the configuration in /opt/scalix/

The file /opt/scalix/global/config contains the lines:

OMNAME=old
OMHOSTNAME=old.scalix.demo

These can be changed by hand to read:

OMNAME=new
OMHOSTNAME=new.scalix.demo

Change the configuration in /etc/opt/scalix

There are several files to be changed in /etc/opt/scalix.

Grepping over the directory reveals that the following files currently contain the old hostname:

[root@new ~]# grep -iRl old.scalix.demo /etc/opt/scalix
/etc/opt/scalix/caa/scalix.res/config/ubermanager.properties
/etc/opt/scalix/platform/platform.properties
/etc/opt/scalix/webmail/swa.properties
/etc/opt/scalix/webmail/swa.properties.bak
/etc/opt/scalix/res/config/res.properties

Each of these files needs to have the domain name changed. You can either do this by hand, or, if you're lazy like me, with a vi macro.

Use the following command:

grep -iRl old.scalix.demo /etc/opt/scalix | while read line; do vim $line -c ':% s/old.scalix.demo/new.scalix.demo/g' -c ':wq'; done; reset

Replace both instances of old.scalix.demo with your old FQDN and the single instance of new.scalix.demo with your new FQDN.

What this does, is find each file with the old FQDN, globally replace each instance of the old FQDN with the new FQDN and save the file. The reset on the end is necessary, as your terminal will more than likely be fubared after vi is done.

Reboot and enjoy your server

After you have finished this procedure please reboot. Everything should be working just like before.

Do remember, however, that this discussion only covered Scalix. Things like apache VirtualHost declarations or other parts of the server which depend on the hostname will still need to be changed.