PostgreSQL Performance Tuning Compilation

Feel free to add-into comment if you found any usefull one.

Exim, refused: too many connections

One of our mailserver having problem last week. It’s caused by the massive connections connected into the server sending out newsletter(large database unstoppable loops) from one host.

2006-06-15 08:50:06 Connection from [201.xx.xx.xx] refused: too many connections
2006-06-15 08:50:20 Connection from [201.xx.xx.xx] refused: too many connections
2006-06-15 08:50:24 Connection from [201.xx.xx.xx] refused: too many connections
2006-06-15 08:50:28 Connection from [201.xx.xx.xx] refused: too many connections
2006-06-15 08:50:32 Connection from [201.xx.xx.xx] refused: too many connections

Exim default allow maximum 20 connections from a host. You can increase the connection in the main configuration file by adding in this line;

smtp_accept_max = 50

For more information, visit Exim’s documentation site.

Backup and Archive Incoming Email with Exim

Loitering around Google and finding a way to archive/backup incoming email in Exim email server. I went through the documentation in Exim offical website and found out a solution to do that with $tod_log, substr and shadow_transport.

The below transport rule will backup copy of email into /mail/backup/datetime/domainname/userid


save_incoming_email:
  driver = appendfile
  file = /mail/backup/${substr_0_10:$tod_log}/$domain/$local_part
  delivery_date_add
  envelope_to_add
  return_path_add
  group = paulooieximing
  user = paulooieximing

local_delivery:
  driver = appendfile
  file = /mail/$domain/$local_part/inbox
  create_directory
  delivery_date_add
  envelope_to_add
  return_path_add
  group = paulooieximing
  user = paulooieximing
  shadow_transport = save_incoming_email

This rules will backup all incoming email in local_delivery router. For you information;


$local_part = email userid
$domain = domain name
$tod_log = date time for log files
${substr_0_10:$tod_log} = substring 10 char for date "2006-07-01"

Error in suphp.c on line

Am experimenting suphp on several servers for security reason. During installation, I have encoutered few error messages and problems. Here are what I want to share;

Error in suphp.c on line xxx
After suphp installation, fire up apache web server. Misconfiguration error message displayed on the site, and it said, “read error log file”. tail the error file and you see;

[error] [client 203.223.134.888] Premature end of script headers: index.php
[error] [client 203.223.134.888] Error in suphp.c on line 236: UID of calling process mismatches
[error] [client 203.223.134.888] Premature end of script headers: index.php
[error] [client 203.223.134.888] Error in suphp.c on line 236: UID of calling process mismatches

This log doesn’t give you a clear picture on what is happening, suggest you tail on suphp.log file, and you will see;


[error] suPHP was called by hansome (8888), not by www
[error] suPHP was called by hansome (8888), not by www

If you have both of the error message shown above, most probably it’s misconfiguration on apache config file. Open httpd.conf, change the User to www insteady of others UID.

Have fun with suphp.

Pure-ftpd: account disabled

I have configured pure-ftpd using FreeBSD ports(usually compiled from source). After everything have setup, postgresql, db, table, users and etc, it seem like cannot connect into the server with the below message…

Dec 19 16:34:14 server pure-ftpd: (?@60.48.150.26) [WARNING] Can’t login as [takizo]: account disabled

After few hours of checking, I found the cause of the problem is the UID and GID I set was low than 1000, if you have the similar problem, try to set a higer UID and GID. Better in the range of 5000(my own opinion).

All the best ;)