ServerSignature and ServerTokens

ServerSignature and ServerTokens are two variables that determine how the Apache server describes itself, which makes it useful to keep some secrets.   While obscurity is not security, it’s nevertheless a good idea not to save a potential attacker time by giving them the exact versions of everything you run on your server.

ServerTokens

ServerTokens describe how much information about itself Apache divulges, both in the HTTP headers, and in the signature on server-generated pages, such as errors and directory indexes.  Here are the possible settings and example values:

Full:  Apache/2.2.3 (Red Hat) mod_ssl/2.2.4 OpenSSL/0.9.7l DAV/2 mod_fastcgi/2.4.2 PHP/5.1.5 mod_jk/1.2.15
OS: Apache/2.2.3 (Red Hat)
Minimal: Apache/2.2.3
Minor: Apache/2.2
Major: Apache/2
ProductOnly:  Apache

ServerSignature

This describes how Apache refers to it
self in server-generated pages.  Possible values are On, Off or EMail.  On will give a message like:

Apache Server at www.example.com Port 80

Where “Apache Server” is the result of the ServerTokens value.  Setting ServerSignature to EMail, will give something like (note the mailto link):

Apache Server at www.somerandomstuff.com Port 80

And finally, setting it to Off, will show nothing.

Plesk: How many ColdFusion sites?

A customer asked how many ColdFusion sites they had on their Plesk server. Ordinarily, the following query would make this easy to answer:

# mysql psa -e "select count(*) as 'Coldfusion Enabled' from hosting where coldfusion = 'true'"
+--------------------+
| Coldfusion Enabled |
+--------------------+
|                159 |
+--------------------+

In their case, however, they had ColdFusion support enabled for all sites, so we needed to find out how many domains actually had ColdFusion content. Here’s a quick&dirty one-liner:

# find /var/www/vhosts/ -type f | grep -i "\.cfm" | cut -d/ -f5 | sort | uniq | wc -l
   150

Konsole and the console font

After doing some updates on my Debian Lenny workstation, I noticed that KDE’s Konsole is no longer able to find the “Console” font, and upon trying to install it, I’m greeted with an error saying:

Could not install console8x16.pcf.gz into fonts:/Personal/

Fortunately, this is easily fixable. As root, run the following:

# dpkg-reconfigure fontconfig-config

Choose the default option to all but the question about bitmap fonts – choose YES here. This will enable support for bitmap fonts. Then do:

# dpkg-reconfigure fontconfig

This will update the font cache. Now restart your Konsole, and your fonts should be back to normal.

Update 2009/03/07:   I had this happen to me again today (did a dist-upgrade to Squeeze) and after running the above fix, only one of the two missing fonts returned.   I found that removing the contents of ~/.fontconfig/ does the trick.

Update 2009/07/25:   I got a new PC at work, and this time did a clean install of Squeeze, which meant getting dumped into KDE4.  Again, the font was missing, and the font installer wouldn’t see the pcf file.  I had to do the above, and then, using the font installer, had to type *.pcf  in the filter field – this installed the font.  I also had to set font anti-aliasing to “enabled” instead of “system settings” in the System Settings panel –> Appearance –> Fonts.

AMOD trouble

I use an AMOD AGL3080 GPS logger in my photography. For a few days now, I cannot get it to do anything. The storage light stays on, but nothing happens. I thought that I’m out of disc space, maybe the trash is taking up all the free space? But that seemed not to be the case – I had 112MB free.

Today I got to look at this more closely for the first time. In the .Trashes directory, there is a ‘501’ directory, and under that, I get the following:

$ ls -lha
ls: QžÇØ\026gYø.œ?\036: No such file or directory
ls: ýdßÞæer˜.^ín: No such file or directory
$
$ rm *
rm: cannot remove `QžÇØ\026gYø.œ?\036': No such file or directory
rm: cannot remove `ýdßÞæer˜.^ín': No such file or directory

Eventually, I gave up and plugged it into a linux box. Now the ‘501’ didn’t show up as a directory any more, but as a file. rm -rf, unmount it, switch it on, and what do you know, it’s working! I’m not sure if just deleting the 501 from the terminal in OSX would have worked, it probably would have. I just find it strange that it showed up as a directory and not a regular file.

Plesk: Finding large log files

I get this kind of problem every day: “We’ve run out of disc space on our Plesk server – what’s taking up all the space?” The answer, almost every time, is “logs.” Plesk doesn’t enable log rotation by default, so logs can end up taking a lot of space.

Here’s something I cooked up to list the size of each domain’s log directory:

Continue reading “Plesk: Finding large log files”