Author Archives: Simon

Upgrading Iptables to 1.4 on Debian Etch

I required the module connlimit to limit the number of connections on one of our Debian firewall boxes. After a while of try and error i found out that the iptables version shipped with debian 1.3.6 doesn’t support the new module format used in 2.6.23+ kernels. So i looked for a backported version of iptables which i did not find 🙁 So i thought i would try and install iptables from source. First download the latest iptables version from Netfilter.

Unpack the tarball

tar -xjvf iptables-1.4.2.tar.bz2

Change directory

cd iptables-1.4.2

configure iptables

./configure --prefix=/usr libdir=/lib bindir=/sbin mandir=/usr/share/man

if you just use ./configure then everything will be installed to /usr/local

make and install iptables

make prefix=/usr libdir=/lib bindir=/sbin mandir=/usr/share/man install

I don’t know why but a few binaries landed in /usr/sbin instead of /sbin so i copied them to the desired location

After that you can check your new iptables version

iptables -v

The only problem i encountered is apps which need iptables as dependency beacuse aptitude will try and install the old version of iptables again as a dependency. Either you install those apps from source as well. Or you can install two versions of iptables one under /usr/local and one under /sbin which can be confusing.

Ubuntu GPG error: http://ppa.launchpad.net

If you come across this error after running aptitude update

W: GPG error: http://ppa.launchpad.net intrepid Release: The following signatures couldn't be verified because the public key is not available:
NO_PUBKEY 7D2C7A23BF810CD5
W: You may want to run apt-get update to correct these problems

due to a missing GPG key do the following to correct the problem

gpg --keyserver subkeys.pgp.net --recv 7D2C7A23BF810CD5

Replace the key number “7D2C7A23BF810CD5” with the one included in your error message

gpg --export --armor 7D2C7A23BF810CD5 | sudo apt-key add -

After that, the key will be added to a list and the error will not reappear.

Happy Christmas Everyone

I wish all you Linux geeks out there a happy christmas. I am spending this years chrismas with my family in Perth west australia. It’s my first visit to western australia and i am really enjoying it. I will try and post a few photos when i get back to berlin.

Merry Christmas

German Umlaut on Debian Console

To get Debian to correctly display german Umlauts (äöü) in a console install the following packages:

aptitude install console-setup ncurses-term language-env

I am not sure if you really need ncurses-term und language-env but i won’t hurt.

When you configure console-setup use the standard options press enter. Then issue the following command

dpkg-reconfigure console-setup

Edit  /root/.bashrc and /etc/profileand add the following line.

export LC_ALL="de_DE.UTF-8"

The reconfigure your locales with:

dpkg-reconfigure locales

And make sure you tick all boxes with:

de_DE

Then logout or reboot you system and enjoy your umlaut. This howto should also work for other languages. Just change de_DE for you locales.

Thanks for the original german howto goes to:

coffeethewebandme

Lost your debian-sys-maint account?

This has happend to me a few times. You import a mysql user database from another server and you get these horrible errors when you restart mysql.

error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'

Go find your debian-sys-maint password in

/etc/mysql/debian.cnf

Write it down you will need it later. Log on to your mysql server and issue the following command

GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'your-password' WITH GRANT OPTION;

Change your-password with the password from the file debian.cnf. I am sure the debian-sys-maint user could be given less rights but this thread is only helping to restore the previous defaults. So please be aware this could be a security issue.

Plesk move your apache vhost directory

To move your apache vhost directory in plesk do the following

cd /usr/local/psa/bin
./transvhosts.pl --source-dir /my/old/directory --dest-dir /my/new/directory --correct-scripts

The new directory must exist even though the script help says it will create missing directories it did not work for me. The correct script option will change all the vhost configs for you. Watch out for trailing slashes or you will have incorrect paths in your vhost configs. Another thing i noticed some of our vhosts had double slashes in there path names to correct this issue

/usr/local/psa/admin/sbin/websrvmng -a -v

Confixx Mod-Rewrite

To use Mod-Rewrite in Confixx for a certain vhost you must do the following

1. Log in to confixx as admin and select http special

2. Choose the customer or domain you wish to edit

3. Select advanced options an copy the following text into the provided text box

<Directory "/var/www/##user##/html">
Options +FollowSymLinks +SymLinksIfOwnerMatch +Multiviews
AllowOverride Indexes AuthConfig Limit FileInfo
</Directory>

Please change the path entry accordingly. ##user## matches all web users. You could also change the AllowOverride line to:

AllowOverride All

But this is not necessary if you are only planing on running Mod-Rewrite.

Example:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^(.*)$ http://www.example.com/ [L,R=301]

This rule should rewrite all non www URL’s with www.