Varnish cache, munin-node and server-status

varnish-cacheOn my server running Ubuntu 12.04, I have Apache2 listening on port 8008 (20 virtual hosts) and Varnish on port 80. I use munin and monit to keep tabs on the various services running on the machine and they use the mod_status output to keep tabs on Apache2 processes. As mod_status is compiled into Apache2 by default and the module is enabled this means that the detailed information about your secure webserver is exposed for all the world to see. The mod_status configuation file allows you to lock access down to localhost access only which is nice.

munin

However, Varnish connects to the backend Apache2 server as localhost and so exposes the server-status page to the wild wild web. With the Varnish VCL I was using my server-status page was cached for an hour so it was still available but only provided a static status report that changed when the cache refreshed. Implementing a solution from serverfault.com made the live server-status available through Varnish as it passed it to the backend. This did not help. To secure my server-status I had to block access to the server-status URL but still keep it open for munin-node. Continue reading Varnish cache, munin-node and server-status

Replacing a failing HDD in RAID1 in Ubuntu Server

I have a software RAID1 (mirrored) setup with four partitions on two 160GB SATA drives. Munin started emailing me reports that a drive was failing with bad sectors.

This is what I did to get the system up and running again.

From advosys.ca I completed the following steps first in the terminal:

To make Ubuntu Server automatically boot when one drive in a RAID array has failed do the following:

From a running server, do a package update to make sure you have the latest kernel and boot loader

sudo apt-get update && apt-get upgrade

Reboot the server to ensure any new kernel and bootloader packages are in place.
From the command line run

sudo grub-install /dev/md0

to ensure GRUB is installed on all members of the boot RAID device.

When asked “Should mdadm run monthly redundancy checks of the RAID arrays?”, select either Yes or No (read the warning about possible performance impact and decide. “Yes” is the safer choice)

From the command line run

sudo dpkg-reconfigure mdadm

When asked “Do you want to start the md monitoring daemon?” select Yes.

Enter a valid email address to send warning messages to.

When asked “Do you want to boot your system if your RAID becomes degraded?” select Yes. Continue reading Replacing a failing HDD in RAID1 in Ubuntu Server

Amarok Last.fm integration

I am running Fedora 16 with KDE 4.8.3 and Amarok 2.5.0.  I have a last.fm account but I couldn’t get Amarok to scrobble my tracks.  It turns out it is an issue with KWallet, the KDE password manager.

The solution was found here in the KDE forums and, while this references version 2.3.x and the problem persists in 2.5.0, the solution is the same.

  • Open ~/.kde/share/config/amarokrc
  • Find the Last.fm plugin section
  • Add the following:
  • username=<yourlastfmusername>
  • password=<yourlastfmpassword>
  • ignoreWallet=true

Restart Amarok and start playing.  Check your last.fm account and see your currently playing tracks.  It works!

New Weather Station

Poor site
Poor site

For Christmas Kevin gave me a WH1081 wireless USB weather station. It has a wind vane and anemometer, minimum and maximum thermometer, barometer, rain gauge and hygrometer mounted externally. It communicates wirelessly with a base station inside the house. The base station is connected to the server in the loft and there is much chatter between the two. The server runs pywws (Python Wireless Weather Station) software developed by Jim Easterbrook. This processes the data from the weather station at regular intervals and submits the information to a number of different sites. You can check the weather for IPERTHSH12 on Weather Underground (wunderground.com) and on the Met Office WOW site (wow.metoffice.gov.uk). You can also follow the current weather and 12 hourly forecasts on twitter (@newtyleweather). I also wrote up my own pages to display the weather information (cribbing from various other sites on the web) and give further details here: http://wx.mixedbredie.net/ Continue reading New Weather Station

In My CUPS*

CUPS book
CUPS book

Ubuntu 10.04 server – Fedora 16 desktop – Snow Leopard 10.6.8 macbook – Brother DCP-195C printer scanner

Printer plugged into Server in the loft via USB. Desktop and Server connected by wired ethernet through Netgear router. Macbook connects through wireless.

Server runs CUPS 1.4.3, Macbook runs CUPS 1.4.7 and Desktop has CUPS 1.5.0.

Server is set up to share the Printer over IPP on port 631. Some machines can connect to http://server:631/ (i.e. the remote print server) and print a test page. The Macbook just connects but cannot print. All machines can connect to http://localhost:631/ (i.e. their own CUPS print server) and can see the remote Printer on the Server. Continue reading In My CUPS*

Farewell Kubuntu Mint, Hello Fedora 16

Fedora Logo
Fedora logo

I have been running Linux Mint 10 for ages and have hacked and patched and updated it with various repositories to make sure it was reasonably up-to-date. The application I use most often on the desktop is DigiKam. The development of DigiKam has accelerated recently to the point of a new release almost monthly. The repositories are all trying to play catch-up. Some dedicated individuals are rolling their own .debs/.rpms for different flavours of linux. All you have to do is connect to their repository and install. But it is never that simple as the newer versions of DigiKam required newer versions of all the dependencies and a simple install ends up pulling in loads of different packages. In the end I gave up and stuck with version 1.9 as newer versions required an updated version of KDE and it was getting to be a hassle patching everything together. Continue reading Farewell Kubuntu Mint, Hello Fedora 16

Batch Processing Images

Running digiKam 2.0 on Windows 7 Professional 32bit and Linux Mint 10 KDE 4.6.2

Standard workflow for new images:

  1. download into new date based folder renaming on the fly and applying metadata template.
  2. tag new images
  3. geotag new images
  4. select images for upload to web
  5. add to batch queue manager
  6. adjust colours – auto levels
  7. sharpen – unsharp mask
  8. resize – 1024px wide
  9. watermark – overlay PNG (prepare earlier using Xach Effect in GIMP)
  10. reapply metadata
  11. write to output folder
  12. export to piwigo
  13. export to gallery Continue reading Batch Processing Images

Upgrading Ubuntu Server 8.04 LTS to 10.04 LTS (Part II)

Upgrading over SSH by doing:

do-release-upgrade

issued a warning about doing it over SSH.

So I did it through Webmin and the Command Shell:

do-release-upgrade

This wrote a bunch of stuff to /var/log/dist-upgrade/main.log and /var/log/dist-upgrade/apt.log and then stopped when it appeared to run out of disk space.  Which is odd as I have more than 80GB free on the machine. Continue reading Upgrading Ubuntu Server 8.04 LTS to 10.04 LTS (Part II)

Upgrading 8.04 LTS to 10.04 LTS

The Ubuntu Community Documentation recommends the following steps when upgrading the Long Term Support (LTS) version of its server operating system.  My server has been running 8.04 since April 2008 and has been a good and faithful server.  However, the time has come to upgrade it to new versions of the server software.  It is also an opportunity to completely clean out the accumulated cruft that happens when your development, test and live servers are one and the same.

Network Upgrade for Ubuntu Servers (Recommended) Continue reading Upgrading 8.04 LTS to 10.04 LTS