OpenSSL Usage
Submitted by racke on Fri, 06/29/2007 - 12:44.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
Submitted by racke on Fri, 06/22/2007 - 10:59.RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?tenti\.ch$
RewriteRule ^/.* http://www.tenti.ch/vitamin-chischte/ [L,R=301]
SPAM attack through vulnerable PHP script
Submitted by racke on Fri, 06/15/2007 - 08:22.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
Submitted by racke on Thu, 06/14/2007 - 13:13.Load the suexec module and restart Apache.
a2enmod suexec
/etc/init.d/apache2 force-reload
Bug in automysqlbackup script
Submitted by racke on Thu, 06/14/2007 - 11:58.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
Submitted by racke on Tue, 06/12/2007 - 09:05.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
Submitted by racke on Wed, 06/06/2007 - 09:38.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
Submitted by racke on Wed, 04/18/2007 - 07:51.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
Submitted by racke on Tue, 03/20/2007 - 12:24.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
Submitted by racke on Tue, 03/20/2007 - 10:20.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
