Friday, December 29, 2006

Wonderful easy ftp server

Back again in my daily drama, I am sorting out the hows and whys of an ftp server called VSFTPD

I'm growing to love this charming and easy, yet powerful and secure FTP server. It has one config file that spells out options in nice, plain English. It can run in an inetd server (like xinetd) or in standalone mode.

It's configurable, it's tidy, and I recommend it.

Thursday, December 28, 2006

RedHat: command of the day: chkconfig

I'm administering a few Red Hat ES 3 servers now, after a lapse of in the Windows system admin world, and I was delighted to find this command:

chkconfig

It's my hero. Whomever thought up this command is my hero. For those of us who got tired of having to add a new service to all of the rc directories, set up all the symbolic links back to init.d services, this is the command for you.

Take it out for a test drive with
chkconfig --list sshd
and it will tell you which run levels it's configured for. Is it on, is it off?

And if you want to add a new service, once it's in the init.d directory, run this:
chkconfig --add newservicename
and
chkconfig --level 2 httpd on
to add httpd to run level 3.

There. Consider that my contribution to sharing useful things that may be common knowledge to some, and not to others.

Reference: run levels, init scripts, rc, init.d, services

Wednesday, December 27, 2006

Zimbra and the art of mail troubleshooting

Things I learned today about the Zimbra mail server I inherited that could send me over the edge. Zimbra is an open source mail server that wraps itself around postfix, tomcat, and mysql. It seemed to be working just fine until there was a power blink in my office and I realized the mail server wasn't on a UPS.

Login to mail server and 'su - zimbra'

Useful commands to figure out what is happening with Zimbra.

zmcontrol status
zmcontrol start
This will start tomcat, mysql, AND zimbra. You don't start these solo, in fact, they don't even live in normal places, they live in /opt/zimbra, even the bin files. Por que? I ask, in unaccented spanish, por que?

zmcontrol stop
Stops everything, including mysql and tomcat.

Mysql is installed in zimbra's home directory, also /opt/zimbra/mysql
Check logfile in /opt/zimbra/log/mysql.log
Also check /var/log/zimbra.log and /opt/zimbra/log/zimbra.log.

Today my issue was that when starting zimbra mysql didn't start also.
Tried zmcontrol stop and start - didn't change

Checked logfile and saw:
[zimbra@mail log]$ more mysqld.log
061227 11:17:19 mysqld started
061227 11:17:20 [ERROR] Can't start server: cannot resolve hostname!: Success
061227 11:17:20 mysqld ended

Found this on google search: http://bugs.mysql.com/bug.php?id=1200

Checked /opt/zimbra/conf/my.cnf file - saw
[mysqld]

basedir = /opt/zimbra/mysql
datadir = /opt/zimbra/db/data
socket = /opt/zimbra/db/mysql.sock
pid-file = /opt/zimbra/db/mysql.pid
bind-address = localhost
port = 7306
user = zmbra

But localhost wasn't listed in /etc/hosts - must have been removed prior.

Added this to /etc/hosts:

127.0.0.1 localhost.localdomain localhost
192.168.1.17 mail.omn.org mail # this was already there

Zmcontrol stop
Zmcontrol start

Zimbra started just fine. Then I figured out that I couldn't receive mail. The server was receiving mail and storing it in /opt/zimbra/store/0/ with a numeric folder for each user (if you know what date you created the user account, that date stamp will give you a clue to the folder for your mail).

That problem got nailed down to DNS - I guess the server wanted DNS to spit back it's private IP address when it asked, which it wouldn't, and so it got upset about the whole thing. this is not the first time I wondered how the darned thing was working in the first place.

Mail and DNS, they are like a divorced couple with kids - never to be separated no matter how hard you try.

Something else that was useful:
http://www.zimbra.com/forums/showthread.php?t=340

p.s. turned out the very big little issue was that named didn't start when the box rebooted. Started named, which was needed by zimbra to resolve the IP correctly, and life got better. Still kept the localhost entry in /etc/hosts because heaven knows why my coworker thought it was a good idea to take it out. Sheesh.

Reference: zimbra mail mysql mysql.server tomcat