Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-10-2006, 06:49 AM
Intermediate Member
 
Posts: 22
Default Changing server name

I've set up several mail domains on my Zimbra server successfully and everything's about to go live when one of the decision makers stumbled on something really stupid and needless (IMHO) that he just can't live with.

Our company domain name is mycompany.com (actual names have been changed) but while I was setting up the server I didn't have access to the DNS records of the mycompany.com so I set up the server with a sub-hostname under my personal domain name "zimbra.mypersonal.com". So right now when I log into the admin panel, the server list would be displayed as zimbra.mypersonal.com. That's fine, but the pointy-haired guy in question noticed that in all mails sent through the Zimbra MTA had "zimbra.mypersonal.com" in the mail headers, he flipped, saying that it was unprofessional to have a personal domain name in corporate emails etc.

I tried to change the server hostname to zimbra.mycompany.com but logging in via webmail just throws an exception and I can't fetch any mailbox via webmail. Changing the webmail MTA hostname doesn't give any effect either.

I read through the posting here explaining how to migrate users to different hostnames but that's not what I'm trying to achieve. The domain names of each user is correct, it's just the SMTP server hostname that I'm trying to change. Changing the server hostname in /etc/sysconfig/network doesn't seem to do anything. Anyway, I tried to do some of the stuff advised in the article above and I seem to have screwed up something worse. Now, I see TWO servers in my server list: zimbra.mypersonal.com and zimbra.mycompany.com. Mails seem to still work ok but I'm rather concerned about what's going on behind the scenes here. Can anybody help? I would like to avoid having to reinstall anything as a couple of the domains create are already live and in use. It's just the main holding company's one that's holding out now.

Thanks!
Reply With Quote
  #2 (permalink)  
Old 07-10-2006, 02:23 PM
Zimbra Employee
 
Posts: 515
Default

there is a command "zmsetservername <new-zmhostname>" which changes hostname settings in zimbra. it may not catch everything, but you can check manually. use zmlocalconfig and zmprov to check the global config, server configs, user settings, etc.

zmprov gacf | grep zimbra.personal.com
etc...

these are changes i made manually after zmsetservername:

zmprov mcf zimbraLogHostname zimbra.company.com
zmlocalconfig -e zimbra_server_hostname=zimbra.company.com
zmlocalconfig -e ldap_master_url=ldap://zimbra.company.com:389
zmlocalconfig -e ldap_url=ldap://zimbra.company.com
zmlocalconfig -e snmp_trap_host=zimbra.company.com
zmlocalconfig -e av_notify_user=admin@company.com
zmlocalconfig -e smtp_destination=admin@company.com
zmlocalconfig -e smtp_source=admin@company.com

also regenerate the certs

it doesn't hurt to back everything up before starting this process
__________________
Search the Forums - Bugzilla - Wiki - Downloads
Reply With Quote
  #3 (permalink)  
Old 08-10-2006, 08:13 AM
Member
 
Posts: 12
Default Same issue on 3.2

I have this very same issue on a 3.2 demo. but the command you mentioned is not there "zmsetservername ". Furthermore.. may i just change the server host name in the MTA and nothing else?
Reply With Quote
  #4 (permalink)  
Old 08-11-2006, 07:19 PM
Zimbra Employee
 
Posts: 4,792
Default

It should be in libexec.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #5 (permalink)  
Old 11-28-2006, 01:14 PM
Loyal Member
 
Posts: 79
Default Zimbra does not restart after servername change.

Hello,

I'm struggling with a server name change here.

What I'm trying to do is to get a copy of my running install working under test.mydomain.com instead of courriel.mydomain.com to test the upgrade process from 3.1.4 to 4.0.4.

So I installed a new fresh Debian 3.1 install, I installed 3.1.4 on it and then I restored the backup of my main server wich runs the same os and the same zimbra version.

Then I tried to make the name change with zmsetservername.

Then I started having problems.

When I did as zimbra : zmcontrol start, I only was getting,

Host test.mydomain.com
Starting ldap...Done.

And nothing else.

I searched this forums for ints and I found this thread.

I read it andthe other one mentionned in here and after doing all of what bobby suggested, I'm still unable to restart the server still getting the same behavior.

In zimbra.log I get:

Attempted reconnect 3 times. Giving up.
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2749)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager .java:525)
at java.sql.DriverManager.getConnection(DriverManager .java:140)
at org.apache.commons.dbcp.DriverManagerConnectionFac tory.createConnection(DriverManagerConnectionFacto ry.java:97)
at org.apache.commons.dbcp.PoolableConnectionFactory. makeObject(PoolableConnectionFactory.java:300)
at org.apache.commons.pool.impl.GenericObjectPool.bor rowObject(GenericObjectPool.java:816)
at org.apache.commons.dbcp.PoolingDriver.connect(Pool ingDriver.java:171)
at java.sql.DriverManager.getConnection(DriverManager .java:525)
at java.sql.DriverManager.getConnection(DriverManager .java:193)
at com.zimbra.cs.db.DbPool.getConnection(DbPool.java: 274)
... 8 more
2006-11-28 09:54:59,914 WARN [Timer-0] [] DbStats - An error occurred while getting current database stats
com.zimbra.cs.service.ServiceException: system failure: getting database connection
at com.zimbra.cs.service.ServiceException.FAILURE(Ser viceException.java:131)
at com.zimbra.cs.db.DbPool.getConnection(DbPool.java: 283)
at com.zimbra.cs.db.DbUtil.executeQuery(DbUtil.java:1 69)
at com.zimbra.cs.db.DbUtil.executeQuery(DbUtil.java:1 96)
at com.zimbra.cs.db.DbStats.getStatus(DbStats.java:87 )
at com.zimbra.cs.db.DbStats.getStatData(DbStats.java: 58)
at com.zimbra.cs.stats.RealtimeStats.getData(Realtime Stats.java:75)
at com.zimbra.cs.stats.ZimbraPerf$ZimbraStatsDumper.r un(ZimbraPerf.java:534)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.sql.SQLException: Server connection failure during transaction. Due to underlying exception: 'java.net.SocketException: java.net.ConnectException: Connection refused'.

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused

STACKTRACE:

java.net.SocketException: java.net.ConnectException: Connection refused
at com.mysql.jdbc.StandardSocketFactory.connect(Stand ardSocketFactory.java:156)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2680)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager .java:525)
at java.sql.DriverManager.getConnection(DriverManager .java:140)
at org.apache.commons.dbcp.DriverManagerConnectionFac tory.createConnection(DriverManagerConnectionFacto ry.java:97)
at org.apache.commons.dbcp.PoolableConnectionFactory. makeObject(PoolableConnectionFactory.java:300)
at org.apache.commons.pool.impl.GenericObjectPool.bor rowObject(GenericObjectPool.java:816)
at org.apache.commons.dbcp.PoolingDriver.connect(Pool ingDriver.java:171)
at java.sql.DriverManager.getConnection(DriverManager .java:525)
at java.sql.DriverManager.getConnection(DriverManager .java:193)
at com.zimbra.cs.db.DbPool.getConnection(DbPool.java: 274)
at com.zimbra.cs.db.DbUtil.executeQuery(DbUtil.java:1 69)
at com.zimbra.cs.db.DbUtil.executeQuery(DbUtil.java:1 96)
at com.zimbra.cs.db.DbStats.getStatus(DbStats.java:87 )
at com.zimbra.cs.db.DbStats.getStatData(DbStats.java: 58)
at com.zimbra.cs.stats.RealtimeStats.getData(Realtime Stats.java:75)
at com.zimbra.cs.stats.ZimbraPerf$ZimbraStatsDumper.r un(ZimbraPerf.java:534)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)


** END NESTED EXCEPTION **


Attempted reconnect 3 times. Giving up.
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2749)
at com.mysql.jdbc.Connection.<init>(Connection.java:1 485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager .java:525)
at java.sql.DriverManager.getConnection(DriverManager .java:140)
at org.apache.commons.dbcp.DriverManagerConnectionFac tory.createConnection(DriverManagerConnectionFacto ry.java:97)
at org.apache.commons.dbcp.PoolableConnectionFactory. makeObject(PoolableConnectionFactory.java:300)
at org.apache.commons.pool.impl.GenericObjectPool.bor rowObject(GenericObjectPool.java:816)
at org.apache.commons.dbcp.PoolingDriver.connect(Pool ingDriver.java:171)
at java.sql.DriverManager.getConnection(DriverManager .java:525)
at java.sql.DriverManager.getConnection(DriverManager .java:193)
at com.zimbra.cs.db.DbPool.getConnection(DbPool.java: 274)
... 8 more

Any clues?

Thanx!
Reply With Quote
  #6 (permalink)  
Old 11-28-2006, 09:06 PM
Partner (VAR/HSP)
 
Posts: 11
Default

We went thru a similar process recently & had the same problem. The way I solved was:
- setup fresh machine
- give it the same hostname as backed up install
- install zimbra
- restore backup
- check that restore worked
- change zimbra servername using zmsetservername
- set hostname of machine to correct name
- (re)start zimbra

You may also be able to get it to work by inserting an entry in /etc/hosts that points the old name (courriel..) to the test machine.

I think that doing an restore to a differently named host is not a good idea. Entries in ldap, etc that zimbra relies on seem to get out of whack.

The above procedure worked pretty well from memory. There were a couple of minor things that had to be fixed but overall it was fairly painless.
Reply With Quote
  #7 (permalink)  
Old 11-29-2006, 05:45 AM
Loyal Member
 
Posts: 79
Default

Allright, thanx eintel. I'l give this a try.

I'll keep you posted with the results.
Reply With Quote
  #8 (permalink)  
Old 01-04-2007, 06:22 PM
Intermediate Member
 
Posts: 16
Default A successful Hostname change!

First of all Thanks to bobby. His instructions were very helpful.
Here is what I did step-by-step to successfully change the Hostname.
(I do not guarantee the process and did not repeat it since once I finally got it I did not want to touch it anymore...)

1. su - zimbra
2. I ran the following commands:
zmprov mcf zimbraLogHostname my-host.my-company.com

zmlocalconfig -e zimbra_server_hostname=my-host.my-company.com
zmlocalconfig -e ldap_master_url=ldap://my-host.my-company.com:389
zmlocalconfig -e ldap_url=ldap://my-host.my-company.com
zmlocalconfig -e snmp_trap_host=my-host.my-company.com
zmlocalconfig -e av_notify_user=admin@my-company.com
zmlocalconfig -e smtp_destination=admin@my-company.com
zmlocalconfig -e smtp_source=admin@my-company.com
zmlocalconfig -e ldap_host=my-host.my-company.com


3. I edited /etc/hosts file and change the old host with my-host.my-company.com. Without this LDAP will not start!

4. Added my host to a DNS server that my zimbra server can read. tested with
nslookup my-host.my-company.com.
If you do not get your server's IP then change DNS settings so you do.

5. Next I carfully followed instructions for regenerating the certs.
Note that "keytool" is located under: zimbra/java/jre/bin. I had to specify the full path or cd there to run the command.

6. There are several files in which I found the old host name after making all the above changes. I edited these files and replaced the old name with the new one (root user):
Under zimbra/conf:
ldap-vmd.cf
ldap-vam.cf
amavisd.con
ldap-vad.cf
ldap-scm.cf
ldap-transport.cf
ldap-vmm.cf
perdition.conf
swatchrc
I also had an entry in: zimbra/postfix/conf/main.cf (myhostname)

7. I now stopped Zimbra and started only ldap with the following command: sh -x bin/ldap start (zimbra user)

8. Now I ran zmsetservername my-host.my-company.com. You should see a long output of entries being updated that look like the following:

replace zimbraMailHost:
mail.my-company.com
replace zimbraMailTransport:
lmtp:mail.my-company.com:7025
modifying entry "uid=a_user,ou=people,dc=a domain,dc=com"
modify complete

9. Now restart Zimbra. Everything should work as before only with the Hostname you really want.

It would be nice to have one short command to do it all...

Good luck!
Reply With Quote
  #9 (permalink)  
Old 01-04-2007, 06:46 PM
Zimbra Employee
 
Posts: 515
Default

eric, what version of zcs are you running? ideally zmsetservername will handle everything. obviously you've already made the change, but for anybody else working on this, it would be useful to run zmsetservername first, and then check to see if anything needs to be changed manually. if so, file a bug and we'll get it in there

btw running ~/libexec/zmmtainit will update the ~/conf/ldap-* files
__________________
Search the Forums - Bugzilla - Wiki - Downloads
Reply With Quote
  #10 (permalink)  
Old 01-05-2007, 06:42 AM
Special Member
 
Posts: 106
Default Domain name change

How will zmsetservername handle changing the domain name? We have 3 domain names. I want to change the main domain name of the Zimbra server. Currently it is setup as mcleodtrucking.com is our main domain with mcleodexpress.com and mcleod-express.com being the virtual domain names such that mail going to "user AT mcleodexpress.com" goes to "user AT mcleodtrucking.com". I want to change the main domain name to mcleodexpress.com
(why we did not go with it to begin with has to do with me getting the domain name which I won't get into)
Thanks
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.