Zimbra – Changing server hostname

If you are using local dns then configure DNS for new hostname and make changes in resolv.conf and hosts file… confirm dns is resolving your queries…
use dig,nslookup and host commands…Reboot the system…

Note – Before Processding for next step make sure that your dns server is resolving you hostname A record and MX record.

Login with root.
follow the below instructions.

# su – zimbra

$ zmcontrol stop

$ /opt/zimbra/libexec/zmsetservername -force -n new.hostname.com
(you will receive some errors but ignore them)

$ /opt/zimbra/libexec/zmsetservername -o old.hostname.com -n new.hostname.com

(it will not show any error and work fine)

Set Default Domain-
$ zmprov -l mcf zimbraDefaultDomainName newdomain.com

Generate New ssh key for zimbra and update it

$ zmsshkeygen

$ zmupdateauthkeys

$ zmcontrol start

(it should start your zimbra successfully)

Now if you are using self signed certificate so you have to create new certificate following below instruction…but before that make sure you system
timezone and you zimbra server timezones are same.

$ exit

# su – zimbra -c ‘zmcontrol stop’

# rm -rf /opt/zimbra/ssl/*

# rm -rf /opt/zimbra/ssl/.rnd

# /opt/zimbra/java/bin/keytool -delete -alias my_ca -keystore /opt/zimbra/java/jre/lib/security/cacerts -storepass changeit

# /opt/zimbra/java/bin/keytool -delete -alias jetty -keystore /opt/zimbra/mailboxd/etc/keystore -storepass `su – zimbra -c ‘zmlocalconfig -s -m nokey mailboxd_keystore_password’`

# vim /opt/zimbra/bin/zmcertmgr

Find line
SUBJECT=”/C=US/ST=N\/A/L=N\/A/O=Zimbra Collaboration Suite/OU=Zimbra Collaboration Suite/CN=${zimbra_server_hostname}”
and change to your company name

then find and change you want value days expire cert validation_days=365 to validation_days=3650

(save & exit)

# /opt/zimbra/bin/zmcertmgr createca -new

# /opt/zimbra/bin/zmcertmgr deployca -localonly

# /opt/zimbra/bin/zmcertmgr createcrt self -new

# /opt/zimbra/bin/zmcertmgr deploycrt self

# su – zimbra -c ‘zmcontrol start’

It should start all the services successfully without any error.

# /opt/zimbra/bin/zmcertmgr deploycrt self

# /opt/zimbra/bin/zmcertmgr deployca

# su – zimbra -c ‘zmupdateauthkeys’

# /opt/zimbra/bin/zmcertmgr viewdeployedcrt

Login to Web link and check whether everything is working well or not.
Check newly installed certificates and running services.

Posted in Technology.