OpenSSL Usage

Display certificate request:

openssl req -noout -text -in /etc/apache2/ssl/server2007.csr

Display to whom it was issued from PEM file:

openssl x509 -noout -in imapd.pem -subject

Display certificate:

openssl x509 -noout -text -in /etc/apache2/ssl/server2007.crt

Create key:

openssl genrsa 1024 > www.linuxia.de.key

Create certificate request from existing key:

openssl req -new -key www.linuxia.de.key -out server2007.csr

Redirect Subsidiary Domains to Website Area

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?tenti\.ch$
RewriteRule ^/.* http://www.tenti.ch/vitamin-chischte/ [L,R=301]

SPAM attack through vulnerable PHP script

One of my customers reported this morning that their webserver was unusually slow. I discovered that it was abused for sending SPAM through web forms. The PHP script processing these forms lacked proper input sanitization. After disabling the script by renaming its mail function I deleted almost 1000 of SPAM emails from the queue:

xxx:/var/spool/exim4/input# grep -l "Email von yyy.zz:" *-D | perl -pe 's/-D$//' | xargs exim -Mrm

Suexec on Debian

Load the suexec module and restart Apache.

a2enmod suexec
/etc/init.d/apache2 force-reload

Bug in automysqlbackup script

There is a bug in the MySQL Backup Script v2.5 from http://sourceforge.net/projects/automysqlbackup/, triggered by database name containing spaces. I fixed it by using quotes in the dbdump function:

# Database dump function
dbdump () {
mysqldump --user=$USERNAME --password=$PASSWORD --host=$DBHOST $OPT "$1" > "$2"
return 0
}

Command Line Catalog Reconfiguration with sudo

Users can use the Interchange administration interface (UI) for reconfiguring their catalog. Alternatively, you can configure sudo to allow users running interchange from the commandline:

sudo -u interchange /usr/sbin/interchange --reconfig=linuxia

Add the following line to your sudoers file with visudo to give permission to do so:

racke LOCAL = (interchange) NOPASSWD: /usr/sbin/interchange --reconfig=linuxia

Delays on Email Delivery

To avoid unnecessary DNS lookups for the hostname of the machine, define primary hostname:

primary_hostname = linuxia.de

Or you can use on of the alternatives described at:

http://wiki.debian.org/PkgExim4UserFAQ#head-9df4f560713a5f58d5cdb9fdf230...

Typical Permissions for Queue Users

CommentOnTicket - add comments to tickets
CreateTicket - create tickets
ModifyTicket
OwnTicket
ReplyToTicket - add replies to a ticket
SeeQueue - queues will appear in visible listings for this user (like "New Ticket")
ShowTicket - see tickets
ShowTicketComments - see comments attached to tickets
TakeTicket

.htaccess errors

Drupal needs extensive permissions in .htaccess. If you encounter an Internal Server Error by Apache and the following error in the Apache logfile:

/var/www/drupal/.htaccess: Option Indexes not allowed here

The solution is to grant Drupal every permission:

<Directory /var/www/drupal>
AllowOverride all
</Directory>

Mounting Shares from win2k3 DCs

This isn't possible with smbfs (see Samba mailinglist).
The solution is to mount with cifs like that:

//server/share /local/dir cifs credentials=/etc/local/creds,ip=192.168.0.200

Syndicate content

User login

Navigation