Pick the right MTA is an important step for a webmaster. For a *nix system, the most popular ones are Exim, Postfix, Qmail, and Sendmail. Here is a very good article talking about their differences and how to compare them:
MTA comparison
Comments Off
Normally Exim runs very well out of package, and there is no need to do much tweaking on it. These are just some watch points that may need a little attention.
The never_users list
In /etc/exim.conf, root is in the “never_users” list. This is described as a “paranoiac” security catch. The only problem I had was that the email delivered to root from the cron job got bounced and it was flooring the exim mail log. To cure this, either you have to create an local alias for root so the emails will be forwarded to that user; or change the cron job email destination to something other than root. I chose the latter option.
Running smtp on another port
The reason for this is that some ISPs start to block post 25. So from your email client you will see some “connection timeout” error. Opening another port, and configuring your email client to connect to the new one can help bypassing this “restriction” from your ISP if it is there.
If you have Cpanel installed, start another exim on a different port is quite easy. Just go to “Service Configuration”->”Service Manager” page and setup “exim on another port”.
Comments Off
Logrotate normally runs as a daily cron job and rotate/compress/remove the log files that are generated by the system. In a CentOS system, you may see this error in the email that sent from the cron job:
/etc/cron.daily/logrotate:
error: error running postrotate script
error: error running postrotate script
error: error running postrotate script
error: error running shared postrotate script for /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron
And although logrotate changed messages to messages.1 and created a messages file, the messages.1 is the one that is still being logged to and growing.
This place gives some insight about the cause of this problem. But in a nutshell, logrotate executable writes something(probably a script) to /tmp and tries to execute it. Since /tmp is mounted on most system as “noexec” for security reasons, logrotate fails.
To work around this, we can create a new “tmp” directory and let logrotate use that one. For example, below is my new /etc/cron.daily/logrotate:
#!/bin/sh
TMPDIR=/var/tmp_safe
export TMPDIR
/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate “ALERT exited abnormally with [$EXITVALUE]”
fi
exit 0
/var/tmp_safe is the new directory I created for logrotate and it needs to be executable.
To test this from command line, we will need to run /etc/cron.daily/logrotate. Notice that logrotate won’t rotate files twice in a same day so we need to add “-f” option after /usr/sbin/logrotate to force it rotate again. And you should see them rotating.
Comments Off
- Your site has been down frequently, by frequently I mean more than once a month.
- When you feel like you are part of your hosting company’s support team because it is always you who detect the problem first and report it.
- When your wife actually asked why your site is broken again… if you are not married, I guess friends will do.
- When you open a technical support ticket, you get a standard message: “your server has experienced a crash, we are trying our best to fix it…”.
- When you actually phoned the support and keyed in the “urgent support” option, you were taken back to the support main menu again…
I was trying to run a PHP script from CRON and kept getting a “XSLTProcessor class not found message”.
This really puzzled me since I had no problem to run the exactly same script from the command line. I tried different stuff, and one point even re-compiled PHP.
Feeling hopeless I put phpinfo() in the script to see what kind of PHP environment is running in CRON and found out the configure options and build date are not the same with the current version. OK, what’s going on?
It turned out, I have an older copy of PHP executable in /usr/bin, which was probably compiled and left there by my hosting company (by the way this is a VPS server), and my newer re-compiled PHP is under /usr/local/bin.
Guess what, in /etc/crontab file, the path is: “PATH=/sbin:/bin:/usr/sbin:/usr/bin”, and this is why the older PHP which didn’t have xslt compiled in always got picked up.
whew….
Comments Off
While designing fluid multi-column page using CSS, the right column may wrap under if the browser is resized to a small width. To avoid this we can define min-width for the body tag so the columns won’t wrap. The trick is how to convince IE.
In IE 7, the following will work just fine: body {width: auto; min-width: 600px;}
But not for the earlier version though.. Earlier version of IE has no concept of the “min-width”, as a matter of fact, it thinks “width” represent the min-width.
Someone came up with the body tag like this: body {width: 600px;} html>body {width: auto; min-width: 600px;} The first line is for IE and the second line is for Firefox, Opera or Safari. However, this doesn’t work for some IEs. The last resort, will be to use Javascript to set the min-width using the DOM object access.
Comments Off
Stumbled upon this site today…is this the future of the interactive web site…? http://www.msdewey.com/ Once the flash is loaded, a laby is on the screen to ask you to type something in the search box. It's like watching someone live in front of you. I have to say it is nicely produced so it doesn't seem too boring. I typies in different search terms such as: tennis, beer, new york, you suck, "who am i"…,� besides the search result on the right side of the screen,� Ms. Dewey actually� "spoke to me" and most of� what she said were� quite relevent to what I searched. The funniest answer is for the last one: "you do know I have your social security number, do you?" Although I will not use this site for search, I certainly had some fun.
This is a Microsoft product…
Comments Off