Pietro Abate
use vlogger with apache2
vlogger [1] is a nice piece of software to deal with large number of virtual hosts. It is meant to work with apache by piping the logs to the vlogger process that will then take care of storing them in you log directory.
I found an excellent howto that describes how to install vlogger in debian [2] .
To better integrate it with webalizer you can use this small bash snippet to generate conf files automatically for all your vhosts. This assumes that your log files are stored in /var/log/apache2 and that you don't have any other directories there but those generated by vlogger.
use postfix to setup a satellite host and maquerading
It's actually pretty easy. On the client side you need to specify your hostname, your origin and the relay host. For example:
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = dev.localnet.xen, dev, localhost
relayhost = [mail.localnet.xen]
mynetworks = 127.0.0.0/8
Mydestination must not be set otherwise mail will be delivered locally. Server side you need first rewrite
name-based virtual hosting with ssl
I've been looking for a solution to this problem for a long time. Basically apache2 is not able to do name-based virtual hosting if you also want to use ssl. The reason for this problem is very simple. In order to know then hostname, apache2 I need to establish a secure channel, but to establish a secure channel, if I have more then one virtual host, then I need to know the hostname, that is, to provide the client the correct certificate. There is also a better explanation on the apache website [1].
openvpn day
Today I spent large part of the day to configure a vpn to access our servers. Instead of leaving port 22 wide open, I prefer to use a vpn to access the internal network and to do ordinary administration tasks. This way I'll also be able to use graphical tools that I don't feel like to use over the internet.
lvm and friends
Not a tutorial, just few lines to write down what I've done.
This command gives you information about all virtual groups
Then, to create a logical group :
the -l option specifies the number of extent to allocate for this lv . You can see the number of available extents for a vg with the command above. This is useful to know when you want to create a lv using all the available space.
Then let's create an xfs fs on this lv : <code>
MD1000 performance
This is data related with a dell 2950 + md1000 that I'm configuring. /dev/sda is the onboad raid controller with 3 300G sas disks (raid5). /dev/sdb is the md1000 with 5 1T sata disk (raid5). First when configuring the md1000 you must create the logical volume from the bios. I've created a fairly standard raid5 array using with all disks.
The crude data without any optimization is as follows:
<code lang=sh> promethium:~# hdparm -tT /dev/sda
/dev/sda: Timing cached reads: 5872 MB in 2.00 seconds = 2940.90 MB/sec
configuring sympa with postfix
Last week I took over the task of migrating sympa from a vserver machine to a xen vm. In the process I upgraded the sympa version and changed the MTA, from sendmail (ahhhhhhhhhh) to postfix. In my opinion sympa is designed to do far too many things just to be a mailing list manager. In particular, it has its own mail spool, it organizes mail delivering (via the MTA) and bounces.
connect mrbs with sympa
Today I wrote a small script to allow mrbs [1] to authenticate with the sympa[2] database. mrbs has a nice feature to use an external command to do authentication. This is a simple script that query the sympa db.
<code lang="perl">
- ! /usr/bin/perl
use lib '/usr/lib/sympa/bin'; use wwslib;
unless (require Crypt::CipherSaber) { die "Crypt::CipherSaber not installed ; cannot crypt passwords"; }
require 'tools.pl';
use List;
- Load sympa config
&Conf::load('/etc/sympa/sympa.conf') || die 'config_error'; chdir $Conf::Conf{'home'};
trasfering data over the wire with nc
nc, TCP/IP swiss army knife, is an utility to transfer data across the network (actually is much more then that...). If you need to transfer large files inside you private network it might be a good idea to use nc, instead of heavier data transfer protocols (such as nfs, samba, ssh, http...)
Server side :
nc -vvn -l -p 3000 -w 3 | pv -b > outputfile
where -l says to listen and -p 3000 specifies the port.
Client side :
nc -vvn 192.168.0.5 3000 < inputfile
This is pretty straightforward.
To make the process a bit more human friendly I've used pv that is a small monitor the progress to show how much data has been transfered.
how to resize a xen image (or any other fs)
This is a small recipe to resize a disk image. In this case I wanted to make it bigger.
create a sparse file :
dd if=/dev/zero of=xen.img bs=1k count=1 seek=30M
copy the old file system to the sparse file:
dd if=old-xen.img of=xen.img conv=notrunc
now we resize the fs (reiserfs in this case)
resize_reiserfs xen.img
and we can happily mount it.
mount -o loop xen.img test/
now we have a bigger fs !
# df -h
Filesystem Size Used Avail Use% Mounted on
/home/xen.img 30G 338M 30G 2% /home/test