Debian

Forward a message but still leave a copy on the server?

I am using Debian etch for production, plus Exim4 with per user ~/Maildir support. Since I hope to forward each user message to their own public email for backup, Procmail FAQ give me a useful example.

First of all, check if your Exim4 have ~/.procmailrc supported, which usually already there. Find the follow code snippet from /etc/exim4/exim4.conf.template:

#####################################################
### router/700_exim4-config_procmail
#####################################################

procmail:
  debug_print = "R: procmail for $local_part@$domain"
  driver = accept
  domains = +local_domains
  check_local_user
  transport = procmail_pipe
  # emulate OR with "if exists"-expansion
  require_files = ${local_part}:\
                  ${if exists{/etc/procmailrc}\
                    {/etc/procmailrc}{${home}/.procmailrc}}:\
                  +/usr/bin/procmail
  no_verify
  no_expn

#####################################################
### end router/700_exim4-config_procmail
#####################################################

Work around together with Debian's procmail example (/usr/share/doc/procmail/examples/), just create a ~/.procmailrc as below:

# Please check if all the paths in PATH are reachable, remove the ones that
# are not.

PATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:.
MAILDIR=$HOME/Maildir/
DEFAULT=$MAILDIR
LOGFILE=$MAILDIR/from
LOCKFILE=$HOME/.lockmail

:0c
! someone@example.com

Send an email to this user, check the mail log with tail -f -n 50 /var/log/exim4/mainlog and you will find that message already forward to your target public email address, with a saved local copy :-)

PostgreSQL 8.3 on Debian sid mini-HOWTO

This mini-HOWTO will guide you though the installation of PostgreSQL 8.3 on Debian sid. After install initial packages, you will need to create and configure both user account and database, which Debian installation script will not do for you.

Before start I will assume you have a complete installed and functional Debian sid box on hand. If you have no idea about this, please refer to my other article for more details.

This document is a refine and trim down version of my legacy artical which target for Debian etch. Most procedure are shared so you may also able to apply them in case of Debian etch.

Apache2.2 + PHP5.2 + pgsql/pdo_pgsql from sketch on Debian sid HOWTO

This simple HOWTO will guide you about how to setup Apache2.2 + PHP5.2 + pgsql/pdo_pgsql from sketch. Compile all package from tarball can give you the maximum flexibility of functionality, e.g. you can enable both mysql/mysqli/pgsql/oci8/pdo_mysql/pdo_pgsql/pdo_oci within single installation.

Before start, I will assume you have Debian sid and Postgresql8.3 installed correctly, which will not detail within this document. In case of Debian, Postgresql8.3 installation is just as simple as a single command:

apt-get install postgresql-8.3 postgresql-client-8.3 postgresql-contrib-8.3 postgresql-common

After installation, you should also initialize your user accounts and database. Please refer to my other article for more information.

This HOWTO is highly similar as my other article which target for install Apache2.2 + PHP5.2 + OCI8/PDO_OCI from sketch on Debian sid. Therefore some duplicated section will directly refer to there, and only mention those different in case for PostgreSQL in here.

Apache2.2 + PHP5.2 + mysql/mysqli/pdo_mysql from sketch on Debian sid HOWTO

This simple HOWTO will guide you about how to setup Apache2.2 + PHP5.2 + mysql/mysqli/pdo_mysql from sketch. Compile all package from tarball can give you the maximum flexibility of functionality, e.g. you can enable both mysql/mysqli/pgsql/oci8/pdo_mysql/pdo_pgsql/pdo_oci within single installation.

Before start, I will assume you have Debian sid and MySQL5 installed correctly, which will not detail within this document. In case of Debian, MySQL5 installation is just as simple as a single command:

apt-get install mysql-server-5.0 mysql-client-5.0 mysql-common

This HOWTO is highly similar as my other article which target for install Apache2.2 + PHP5.2 + OCI8/PDO_OCI from sketch on Debian sid. Therefore some duplicated section will directly refer to there, and only mention those different in case for MySQL in here.

Fast and safe upgrade to Debian sid from stable or testing

Debian only provide stable and testing installation CD/DVD so there is no way to install with sid directly. In order to use Debian sid, you will need to upgrade from existing installation. BTW, you may try once before but found that there was a lot of error message about package dependency, or not even able to complete the upgrade due to some tricky gap.

Here I will give you a simple guideline about how to upgrade in an elegant and stable style, from Debian stable or testing to sid.

Apache2.2 + PHP5.2 + OCI8/PDO_OCI from sketch on Debian sid HOWTO

This simple HOWTO will guide you about how to setup Apache2.2 + PHP5.2 + OCI8/PDO_OCI from sketch. Compile all package from tarball can give you the maximum flexibility of functionality, e.g. you can enable both mysql/mysqli/pgsql/oci8/pdo_mysql/pdo_pgsql/pdo_oci within single installation.

Before start, I will assume you have Debian sid and Oracle 11gR1 installed correctly, which will not detail within this document. If you really need some help for that, please refer to my other article for more indeed guideline.

Oracle Database 11g Release 1 on Debian sid HOWTO

This is a simple HOWTO, for installing Oracle Database 11g Release 1 on Debian sid.

But why we need this HOWTO? Since Oracle only officially support Red Hat Enterprise Linux, SUSE Enterprise Linux and other enterprise level Linux distribution; BTW, there shouldn't be any problem if you hope to use with other distribution, which just need some special configuration and install required dependent packages. On the other hand, some dependent packages are obsoleted in Debian etch, but only available in oldstable or sid, so install with sid should be better than etch + hybrid sid packages.

"Hey man! Please stop for a while! I have no idea about how to working with Debian sid!"... Ooops... If this is your case, my other article should be your cup of tea. Go back now and let's enjoy with that for a bit while :-)

Before start you will need to prepare your Debian with:

  • A complete Debian sid installation with X11.
  • Static public IP address (or you may bind to localhost during installation).
  • Functional hostname, e.g. hardcode it within /etc/hostname and /etc/hosts.

virt-manager + libvirt + KVM on Debian mini-HOWTO

Long story short, you can seem KVM as replacement of VMware, XEN, VirtualBox, and so on (If you don't know what am I talking about, please give a look about what is Virtualization).

If you have play with similar solutions once before, the virtualization GUI shouldn't be new to you. The virtualization GUI usually provide an interface for client creation, managment and also operation, e.g. when you start a virtual client, the GUI will provide a window for it and display its screen message as like as real PC. So any similar solution for KVM? Yes, virt-manager (http://virt-manager.et.redhat.com/) is one of similar choice.

Besides previous 2 mini-HOWTO (KVM on Debian mini-HOWTO and libvirt + KVM on Debian mini-HOWTO), here I will guide you though how to employ virt-manager for more high level visualization handling.

Bacula backup with GZIP compress ON

Backup usually require for a lot of storage space, and so we always hope to preform some compression. Default style of Bacula on Debian is coming "without" compression, which means all txt/bmp/wav files will store as original size. You can configure Bacula director to use GZIP during backup, and the compression will preform in File Daemon (FD, which means your backup client) locally before send to Storage Daemon (SD) though network, which means it will also save some of your bandwidth usage. But for sure, it trade some performance for the benefits.

To configure Bacula director to use GZIP compression is quite simple: within the director configuration file (/etc/bacula/bacula-dir.conf), just add the line compression = GZIP under your FileSet ->Include -> Options section, e.g.:

FileSet {
  Name = "Full Set"
  Include {
    Options {
      signature = MD5
      compression = GZIP
    }
    File = /etc
    File = /home
}

Before software compression option on, your log report should have line as below:

Software Compression:   None

Restart all of your Bacula daemons, and preform a full backup if possible. Now you may see the difference within the log report with line similar as:

Software Compression:   34.0 %

So that's it :-)

Bacula on Debian sid mini-HOWTO

System backup is a complicated task, including backup, keep trace of record and restore. As the most simple method, you may just *.tar.gz your data and rsync them to remote storage. This maybe useful when you have only 1 server with simple backup architecture, but for sure not enough if you have number of production server with GB scale backup. Therefore Bacula (http://www.bacula.org/) show be your cup of tea.

From Bacula (http://www.bacula.org/):

Bacula is a set of computer programs that permit you (or the system administrator) to manage backup, recovery, and verification of computer data across a network of computers of different kinds.

Bacula split all roles within backup procedure into a very detail and elegant style, so once you understand how its work, you will never get lose. It also support number of backup storage devices, e.g. harddisk, tap, DVD, USB flash driver and so on. It even support different type of database backend, e.g. MySQL, PostgreSQL and SQLite. Moreover, you can setup email report whenever backup process is complete, or browse backup statistic though a simple but elegant web interface. Long story short: it is a fairly complete backup solution that a system administrator should learn about it :-)

This mini-HOWTO will guide you though the installation and configuration of Bacula on top of Debian sid, setup the web GUI for report, and some basic daily operation.

Syndicate content