NameVirtualHost *:80 has no VirtualHosts

February 21st, 2009 Category: Apache

If the message “NameVirtualHost *:80 has no VirtualHosts” appears during Apache start and no one of your virtual hosts is recognized  it can be solved by changing the file /etc/apache2/sites-enabled/000-default and /etc/apache2/ports.conf. Within both files I’ve changed declarations “*:80″ to “*”:

/etc/apache2/sites-enabled/000-default

<VirtualHost *>

/etc/apache2/ports.conf

NameVirtualHost *

Note that all your virtual host configurations also have to be defined with “<VirtualHost * >”.

PuTTY SSH Login Without Password Prompt

February 21st, 2009 Category: General, Linux

Annoyed of typing login passwords?

Your desktop is running with Windows and you often need to connect remote servers using SSH then you will already know PuTTY. You will also know that it’s getting frustrating to enter the passoword every time. There is a simple way to login to remote machines using RSA/DAS keys.

What is needed?

First of all you will need to download the PuTTY.exe. And to generate the keys on your Windows desktop you’ll need to download  PuTTYgen.exe as well.

Key Generation

Start PuTTYgen.exe after download and press the Generate button. Now follow the instruction and move the mouse cursor over the desired area. I’ve used the default parameter [x] SSH-2 RSA with a key length of 1024 bits.

I leave the Key passphrase empty because I don’t want to enter any passwords during login.

putty-key-generator-21022009-183726.jpg putty-key-generator-21022009-183824.jpg

To have the key later available for other servers use the “Save public key” and “Save private key” button. My private key is saved as haifisch.ppk and my public key as haifisch. By the way, haifisch is German and means shark.

Now mark the generated public key, copy it to the clip board and paste it into ~/.ssh/authorized_keys file on the remote server of the user you want to login as.

save-private-key-as-21022009-183913.jpg putty-key-generator-21022009-192015.jpg

PuTTY Configuration

Keys have been generated and stored on the remote server, therefore PuTTYgen can be closed now and the PuTTY.exe is needed now.

In PuTTY under the item “Session” enter the host name of the remote server and connection type SSH. Next choose “Connection/Data” and enter the remote user name. Also the previously defined private key is needed, it is given in “Connection/SSH/Auth” using the “Browse” button. In my case it’s haifisch.ppk.

putty-configuration-21022009-193323.jpg putty-configuration-21022009-193323.jpg

When all settings are done go back to “Session”, enter a name for this session and press “Save”.

That’s it. Try it by double clicking on the saved session.

Login via Desktop Icon

If you want to have a desktop icon which opens putty and logs into a remote server generate a file e.g. www.myserver.com.bat with the content:

start C:\temp\putty\putty.exe -load "Session Name in PuTTY"

Now generate a link to this batch file on your desktop and login in by double clicking.

IE Death March

February 21st, 2009 Category: General

iedeathmarch2009badge.jpg Did you know that Internet Explorer 6 is already 7 years old? The browser is older than Star Trek “Enterprise”, TV Show 24, Xbox and Nintendo Gamcube. Unbelieavable! This out dated web browser causes headache to many web developers who need to do some extra work to get their webpages compatible with this browser.

Now several companies and people started discontinuing support for IE6 on their homepages. There is a web site iedeathmarch.org “ID Death March” which wants to tell people on the net to no longer support IE6.

Read more on: iedeathmarch.org

Debian “Lenny” 5.0 Released

February 21st, 2009 Category: Linux

Finally after 2 years running Debian “Etech” 4.0 the new version Debian 5.0 codename “Lenny” has been released. The new release is dedicated to Thiemo Seufer, a Debian Developer who dies on December 26th, 2008 in a tragic car accident. Read more information about “Lenny” on the Debian homepage.

As you know only the early bird catches the worm, I immediately decided to update one server to Lenny. Sure, sometimes the worm isn’t delicious but if you are dealing with IT stuff you will know this kind of bad tasting worms already.

Okay the good news are: The worm wasn’t bad tasting in this case. Find my upgrade report below.

Upgrade Procedure

First I started with:

apt-get update

And received the error message:

There are no public key available for the following key IDs: 4D270D06F42584E6

Which means we need to get a new public key:

gpg --recv-key --keyserver wwwkeys.eu.pgp.net 4D270D06F42584E6
gpg --export 4D270D06F42584E6 | apt-key add -

or optionally with (not tested):

apt-get install debian-archive-keyring

Fine, next apt-get update was done again and several packages have been updated. It was prompted if a new /etc/mysql/my.cnf should be installed or my old one should be kept. I decided to keep my old one.

Afterwards I upgraded the distribution with apt-get dist-upgrade and many packages have been downloaded and installed.

For several config files it is again prompted if the old one should be kept or overwritten. I decided to backup to old configuration files and overwrite them with the new ones from the current distribution. I wanted to make sure that I don’t run into conflicts. Using this way the upgrade is performed very quick.

In the next step I adapted all my changes from backuped config files into the new ones. In my case mainly the Apache2 and MySQL configurations.

Apache2

After doing this Apache2 started with the message “NameVirtualHost *:80 has no VirtualHosts” and no one of my virtual hosts was recognized. I resolved this issue by changing the file /etc/apache2/sites-enabled/000-default and /etc/apache2/ports.conf. Within both files I’ve changed declarations “*:80″ to “*”:

/etc/apache2/sites-enabled/000-default

<VirtualHost *>

/etc/apache2/ports.conf

NameVirtualHost *

Note that all your virtual host configurations also have to be defined with “<VirtualHost * >”.

APT

To receive the updates for “Lenny” edit the file /etc/apt/sources.conf and change the line:

deb http://security.debian.org/ etch/updates main contrib non-free

to

deb http://security.debian.org/ lenny/updates main contrib non-free

Grub

One special thing on my server here (Strato root server) is the Grub configuration. The server is configured with SATA RAID 1, therefore partitions are mounted on /dev/md0 and /dev/md1. After every kernel update I manually change the /boot/grub/menu.lst file. Here I copy the two parts for the latest running kernel and simply adjust the kernel versions:

title           Debian GNU/Linux, kernel (2.6.26-1-686)
root            (hd0,0)
kernel          /vmlinuz-2.6.26-1-686 root=/dev/md1 ro console=tty0 console=ttyS                   0,57600
initrd          /initrd.img-2.6.26-1-686
savedefault
boot

title           Debian GNU/Linux, kernel (2.6.26-1-686, recovery mode)
root            (hd0,0)
kernel          /vmlinuz-2.6.26-1-686 root=/dev/md1 ro console=tty0 console=ttyS                   0,57600 single
initrd          /initrd.img-2.6.26-1-686
savedefault
boot

Finally reboot and your issue will show “Debian GNU/Linux 5.0″.

Free TreeSize Tool

February 17th, 2009 Category: General

treesize-free-grose-laufwerk-lokaler-datentrager-c-17022009-204714.jpg Hard disc full? No idea where are all the big files?

There is a free version of TreeSize from JAM software available which calculates the size of all folders of your hard disc. You can also expand the folder Explorer-like and find out where all the disc space is wasted. JAM software also offers a professional version which is capable of scanning network folders as well.

See also: