Setup Clam Antivirus & SpamAssassin
July 23, 2007 on 11:45 am | In Linux Admin, command, Qmail | No CommentsI followed the original setup guide (part 14) and will make some modifications here
—————————————————————–
vi /etc/clamd.conf
"Example" - should already be commented out. However, if it is not, make sure that it is commented out (#)
"LogFile" - should be set to /var/log/clamav/clamd.log
"LogTime" - should be uncommmented.
"LogSyslog" - should be uncommented.
"User" - should be set to qscand
"ScanMail" - should be uncommented.
—————————————————————–
Because the user is set to qscand, I have to change the owner and group of /var/log/clamav to qscand. the commands as follow:
chgrp -R qscand /var/log/clamav
chown -R qscand /var/log/clamav
otherwise, it won’t start.
And
I need grant write permission to others, otherwise the virus definition update can’t proceed. the command is:
chmond -R o=rwx /var/log/clamav (the original permission is rx)
Furthermore, here is the good place to download the latest version of Clamav
http://dag.wieers.com/rpm/packages/clamav/
Setup Qmail on CentOS 4.4
July 18, 2007 on 10:29 am | In Linux Admin, command, Qmail | No CommentsAlthough Eric Siegel have done great job on how to setup Qmail on Liunx, I’d like to make a notes on how to setup Qmail on CentOS 4.4 Final.
My system is Linux 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 26 14:30:58 EDT 2007 i686 i686 i386 GNU/Linux with full latest updates. And also, I have already installed Apache Friends.
So let me start:
Because of " CentOS is an open source free GNU Linux distribution which aims to be 100% compatible with and based on Red Hat Enterprise Linux. " , I choose "Red hat" (from the flavor list) to start.
————————————————————————-
After I run ./config-fast newemail
I got this message, it might be useful in the feature.
Now qmail will refuse to accept SMTP messages except to newemail.
Make sure to change rcpthosts if you add hosts to locals or virtualdomains!
Note: newemail is my system’s hostname
————————————————————————–
In Part 6
For my case (apache friends)
./configure –enable-cgibindir=/opt/lampp/cgi-bin –enable-htmldir=/opt/lampp/htdocs
After configure it, I got
Current settings
—————————————
vpopmail directory = /home/vpopmail
uid = 507
gid = 502
cgi-bin dir = /opt/lampp/cgi-bin
vqadmin dir = /opt/lampp/cgi-bin/vqadmin
mysql features = disabled
—————————————
In opt/lampp/etc/httpd.conf
after line of "Include etc/extra/httpd-default.conf", add
Include etc/extra/httpd-qmail.conf
Then in /opt/lampp/etc/extra/
create a file named httpd-qmail.conf
and edit this file, add contents as follow:
<Directory "/opt/lampp/cgi-bin/vqadmin">
deny from all
Options ExecCGI
AllowOverride AuthConfig
Order deny,allow
</Directory>
In /opt/lampp/cgi-bin/vqadmin/, there is a file .htaccess, edit it as follow
AuthType Basic
AuthUserFile /opt/lampp/etc/.htpasswd
AuthName vQadmin
require valid-user
satisfy any
and run
chown nobody .htaccess ( for the apache friends case, the username running apache is nobody)
htpasswd -bc /opt/lampp/etc/.htpasswd admin ‘admin_password’
—————————————————————————
In part 8
after configure
I got
qmailadmin 1.2.9
Current settings
—————————————
cgi-bin dir = /opt/lampp/cgi-bin
html dir = /opt/lampp/htdocs
image dir = /opt/lampp/htdocs/images/qmailadmin
image URL = /images/qmailadmin
template dir = /usr/local/share/qmailadmin
qmail dir = /var/qmail
vpopmail dir = /home/vpopmail
autorespond dir = /usr/bin
ezmlm dir = /usr/local/bin/ezmlm
ezmlm idx = yes
mysql for ezmlm = yes
help = no
modify quota = no
domain autofill = no
modify spam check = no
——————————————————————————-
In part 11 I got
[root@newemail lib]# qmailctl stat
/service/qmail-send: up (pid 8454) 12 seconds
/service/qmail-send/log: up (pid 8455) 12 seconds
/service/qmail-smtpd: up (pid 8460) 12 seconds
/service/qmail-smtpd/log: up (pid 8465) 12 seconds
/service/qmail-pop3d: up (pid 8468) 12 seconds
/service/qmail-pop3d/log: up (pid 8469) 12 seconds
messages in queue: 0
messages in queue but not yet preprocessed: 0
———————————————————————————
Incompetent power supply could cause hard drive error
July 14, 2007 on 9:16 pm | In command | No CommentsIt’s very interesting! see someone discussed it here
If you are serious on your business, don’t save money on the hardware, you will pay more on the labor cost!
By the way, this command might be useful on checking hard drive
smartctl
For example:
smartctl -a /dev/* (* can be hda, hdb, sda, sdb etc.)
Sync time with the time server
July 6, 2007 on 8:58 pm | In command | No CommentsJust some command to remember
ntpdate ca.pool.ntp.org (or rdate -s ca.pool.ntp.org)
date
hwclock –systohc
hwclock
Improving MySQL database backup script
July 3, 2007 on 9:12 am | In MySQL | No CommentsThe original script is here
Reason: As usual, I checked the database backup file and found the size was really small. It meant the backup script had some problems. After then, I was told that the database’s root password had been changed. Oh, that was the culprit!
Now that I know what the problem is, how can I improve it?
The first thing comes to my mind is: I must add a flow controller statement which will tell me (by email) if the backup process is successful. But what if I read the email too late and the backup time is missed? Fortunately, the password is stored in a configuration file. Whenever the DB admin changes the password, she has to change the configuration file. So the better solution is: read the password from the configuration file instead of hard code in the script file.
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^