Difference between revisions of "HowTos/ChangeFQDN"
(→Changing the FQDN of a Scalix Server) |
|||
Line 8: | Line 8: | ||
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. | 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. | ||
2. '''Use sxmodfqdn to correct user settings''' | 2. '''Use sxmodfqdn to correct user settings''' |
Revision as of 10:45, 17 October 2006
Changing the FQDN 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.
1. 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.
2. 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.
3. 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
4. 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.
5. 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.