Optimize roundcube

Posted: 04/04/2013 in Shell tips
Tags: ,

Use this to optimize roundcube load time. Just edit:

vim /var/lib/roundcube/config/main.inc.php

And make these changes

// Type of IMAP indexes cache. Supported values: 'db', 'apc' and 'memcache'.
$rcmail_config['imap_cache'] = 'db';
 
// Enables messages cache. Only 'db' cache is supported.
$rcmail_config['messages_cache'] = true;

I installed mytop in my debian system. Mytop is  is a console-based (non-gui) tool for monitoring the threads and overall performance of a MySQL server.
I got this error message when i run it

Error in option spec: "long|!"

to fix it i edit

vim /usr/local/bin/mytop

find

"long|!"              => \$config{long_nums},

and comment it out with #

or just install the new 1.7 version from here
https://github.com/jzawodn/mytop

Rsync out of memory

Posted: 18/12/2012 in Shell tips

Do you have any problems when you use rsync to create incremental backups of your files?
Rsync uses a considerable amount of memory because of the recursive algorithm. The recursive algorithm that is used is an incremental scan that begins the file transfer after the scanning of the first few directories have been completed. If you use a VERY low memory vps for your backups you might have problems.
Incremental recursion can be disabled using the

--no-inc-recursive

option or its shorter

--no-i-r

You also have to read these:
https://rsync.samba.org/FAQ.html#4
https://rsync.samba.org/FAQ.html#5

An easy and very useful command to automatically check, repair and optimize all tables in all mysql databases

mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

I had a problem in my web-server vps.
I make daily compressed backups from my data and transferred them to another vps using tar and rsyc. I noticed high cpu usage nad load above 1.
After a little research i found this useful article and i will write here to find it easily:

“Anyone running a web server will either use a RAID for information protection, or will run a cron job that backups all the data daily

If you are running a budget server like mine, then most likely you’ll be doing daily backups. At 4 am everyday a backup process runs and stores a dump of the SQL and gzip of all the web folders including the SVN repository on a separate harddrive, which gets unmounted after the backup is done. The process takes around 2 hours to complete, during which the hard drives are all stressed and if the backup scripts were not carefully written they will hog any apache request due to slow disk access.
Read the rest of this entry »

To make fail2ban monitor roundcube 0.8+ authentication access in logs/errors add this to
/etc/fail2ban/jail.conf or /etc/fail2ban/jail.local

[roundcube]
enabled = true
port = http,https
filter = roundcube
logpath = /var/lib/roundcube/logs/errors
maxretry = 3

Read the rest of this entry »

I keep getting those mails from rkhunter recentrly

One or more warnings have been found while checking the system.

Warning: Hidden directory found: /dev/.udev
Warning: Hidden directory found: /dev/.initramfs

i had to reconfigure rkhunter to stop report false positive warnings

vim /etc/rkhunter.conf

and remove the # in fron of the following lines:

ALLOWHIDDENDIR=/dev/.udev
ALLOWHIDDENDIR=/dev/.initramfs

UPDATED
When i updated to rkhunter 1.4.0 i got more warnings in my debian 6 system
I just added this to rkhunter.conf to get rid off them

ALLOWHIDDENDIR=/dev/.udev
ALLOWHIDDENDIR=/dev/.initramfs

ALLOWDEVFILE="/dev/.udev/queue.bin"
ALLOWDEVFILE="/dev/.udev/rules.d/61-dev-root-link.rules"
ALLOWDEVFILE="/dev/.udev/db/block:*"
ALLOWDEVFILE="/dev/.udev/db/input:*"
ALLOWDEVFILE="/dev/.udev/db/sound:*"
ALLOWDEVFILE="/dev/.udev/db/usb:*"
ALLOWDEVFILE="/dev/.udev/db/net:*"
ALLOWDEVFILE="/dev/.udev/db/serio:*"