Catégorie: "Linux"

mail on Debian

So... I guess I thought I was smart enough to set up a Debian server all by myself... and it looks like I'm not even able to get basic email to work! :roll: Bleh...

I could set up apache, php, mysql and have everything working... but email ? What the hell is going on?

I sorta had exim4 installed automatically while apt-get installing mysql-4.1 . I also installed mutt so I could "read" any mail. But that damn thing won't save any email to /var/mail !! I think there should be a file named 'root' (at least) in there, but there is not.

All I know, is that I can use 'mail' to send email to an external machine. But I can't use mail to send a local mail to root.

I get lines like these in /var/log/exim4/mainlog:

2006-05-27 01:18:17 1FjlZR-0007Wy-Gx == /var/mail/mail ( <> R=mail4root T=address_file defer (13): Permission denied: creating lock file hitching post /var/mail/ (euid=8 egid=8)

The exim process seems to be running under Debian-exim4 and the permission for /var/mail seems to be drwxr-sr-x root root

Now of course I can make it work by funkying around with the permissions of that folder, but that doesn't feel right... Besides I wonder what magic that 's' is trying to accomplish...

Is there a caring soul out there willing to show me the light? I'm so lost right now... :| Thanx!! ;)


I think I need to log what I did here... might get useful someday...

Read more »

Live monitoring a web server

Today I learnt to sort of monitor my webserver live. And I learnt it the hard way... :-/

The LAMP servers kept crashing every 2 hours and I could not even log on with SSH. I had to hard reset them.

Here's how I managed to watch them dying in real time. I opened an SSH window running top -S -d 2 so I could see when the load average was going unusually high, what process was actually causing it. I was suspecting the IMAP server, but actually it was simpler than that: PHP & MySQL! :|

With a second SSH window (you HAVE to open these BEFORE things get bad or you just won't be able to log in then) I ran a tail acces_log -f on the Apache logs and I could see what requests were actually generating the high loads. 8|

It was a little tricky because those were not requests on huge PHP pages with lotsa SQL requests. No, those were rather plenty of requests on basic PHP pages with an average number of requests. It's just that at some times there were too many of the same requests (on the same tables) at the same time. :o

Well, I'm not precisely a Unix guru, so there might actually be a more efficient way to find that kind of problems... but if you can't find a better way, this one works.

Hum... something else I'd love to have would be a real time grapher that would show (in Windows) how the load average of several remote servers is evolving, and send out alerts if things get hot... Gotta look at that some day... ;)

The Unofficial Fedora FAQ

Most useful Fedora rundown I came accross this week B)