Archive for the ‘Operating Systems’ Category

Missing Junk mailbox in Apple Mail

Tuesday, August 19th, 2014

When setting up a new MacBook Pro recently, I was impressed that all of my mail account settings were synced over via iCloud, but somewhat surprised and confused to find that the “Junk” mailbox for all accounts was missing.

I couldn’t find the “Junk” mailbox anywhere – it wasn’t in the list of special folders (Drafts, Sent, Trash etc.) with the Inbox and it wasn’t in the list of general mailboxes – it had seemingly just vanished.

This is particularly annoying for me as I used Zimbra for my mail server and can train the server side junk mail filters by moving messages in and out of the special “Junk” mailbox.

All of the junk mail settings in Apple Mail were enabled and seemed to match those in the same version of Apple Mail on my old laptop, so what was happening?

It seems that when you have the junk mail setting in Apple mail set to “Mark as junk mail, but leave it in my Inbox”, Apple hides the “Junk” mailbox to start with whilst it trains its filters and then only shows it once they have sufficient data built up to start identifying spam.

A quick work around to get the “Junk” mailbox to show up straight away is to change the junk mail setting in Apple Mail from “Mark as junk mail, but leave it in my Inbox” to “Move it to the Junk mailbox” and back again.

Changing this setting causes the “Junk” mailbox to be shown and the mailbox doesn’t get hidden again when you change it back.

Parallels Plesk hanging on login

Friday, June 27th, 2014

I recently came across a strange problem when setting up a new Windows Server running Parallels Plesk 12.

Everything was working fine to being with, and then suddenly Parallels Plesk started behaving strangely. I would select some items in a list and press remove and they would be greyed out as if the AJAX had fired in the background, but they wouldn’t be removed from the list until refreshing the page.

Wondering if this was some kind of browser problem as I was using Apple’s Safari, I fired up Mozilla’s Firefox but was somewhat surprised that I couldn’t get past the login screen.

The login page loads, but once I’d entered the username and password and pressed “Log In”, the page would just hang, loading indefinitely until it eventually times out.

The CPU and memory usage on the server were fine. The services were all running correctly. What’s going on?

After a quick look in “C:\Program Files (x86)\Parallels\Plesk\admin\logs\php_error”, it was pretty obvious that the recently installed Parallels Panel Mobile Center extension wasn’t working properly, as there were lots of errors about being unable to access files in “C:\Program Files (x86)\Parallels\Plesk\var\modules\plesk-mobile”.

Deleting the “C:\Program Files (x86)\Parallels\Plesk\var\modules\plesk-mobile” folder at least allowed me to log back in to the Parallels Plesk control panel, however the Parallels Panel Mobile Center extension couldn’t be removed.

After a bit of digging, it seems that the permissions on “C:\Program Files (x86)\Parallels\Plesk\var\modules\” aren’t set correctly out of the box and the “psaadm” user needed to be given write access to this folder in order to create or remove the files and folders for extensions when they are installed/uninstalled.

Once the permissions had been corrected, I was able to remove and then reinstall the Parallels Panel Mobile Center extension successfully.

SuperMicro ipmicfg utility on Linux

Sunday, December 15th, 2013

SuperMicro have a nice little utility called ipmicfg, which can be used to interact with the IPMI BMC from within your operating system. This can do all sorts of things with the IPMI BMC, however it’s really useful if you want to change the IP address details on the IPMI card without rebooting your system and going into the BIOS setup.

To get started, download the latest version of ipmicfg from the SuperMicro FTP site (currently it’s ftp://ftp.supermicro.com/utility/IPMICFG/ipmicfg_1.14.3_20130725.zip).

Unzip this and you will find DOS, Linux and Windows versions of the ipmicfg tool, as well as a bit of documentation. I’m only really interested in the Linux version, so lets go into that folder, where you will find 32-bit and 64-bit versions.

There are two binary files included – “ipmicfg-linux.x86_64” which is dynamically linked and “ipmicfg-linux.x86_64.static” which is statically linked. The dynamically linked version normally works fine for me.

As a quick example of how to use ipmicfg, lets change the IPMI BMC IP address from being assigned via DHCP to being statically configured to 192.168.1.2 with a subnet mask of 255.255.255.0 and the default gateway set to 192.168.1.1:

./ipmicfg-linux.x86_64 -dhcp off
./ipmicfg-linux.x86_64 -m 192.168.1.2
./ipmicfg-linux.x86_64 -k 255.255.255.0
./ipmicfg-linux.x86_64 -g 192.168.1.1

When you run ipmicfg, you may see errors along the lines of:

[kcs] kcs_error_exit:

[kcs] kcs_error_exit:

[kcs] kcs_error:

[kcs] kcs_error_exit:

This essentially means that ipmicfg is having problems communicating with the IPMI BMC, and can normally be resolved by installing the IPMI drivers and loading into the kernel. On CentOS you can do this with the following commands:

yum -y install OpenIPMI
service ipmi start
chkconfig ipmi on

Building httpd 2.4.6

Sunday, July 28th, 2013

When trying to build an RPM from the Apache source tarball, rpmbuild bails with:

RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/lib64/httpd/modules/mod_proxy_wstunnel.so

The problem is that the mod_proxy_wstunnel.so file has been omitted from the httpd.spec file used to build the RPM.

Extract the tarball, open up httpd.spec in your favourite text editor and scroll down until you find a section that looks like:

%dir %{_libdir}/httpd
%dir %{_libdir}/httpd/modules
%{_libdir}/httpd/modules/mod_access_compat.so
%{_libdir}/httpd/modules/mod_actions.so

%{_libdir}/httpd/modules/mod_vhost_alias.so
%{_libdir}/httpd/modules/mod_watchdog.so

%dir %{contentdir}

This should start at line 308. Add in the following line:

%{_libdir}/httpd/modules/mod_proxy_wstunnel.so

You can now run rpmbuild again. You will either need to rebuild the tarball or change to using “rpmbuild -bb httpd.spec” instead of “rpmbuild -tb httpd-2.4.6.tar.bz2”.

Not able to unsuspend a domain in Parallels Plesk

Saturday, May 25th, 2013

If you are seeing the following unhelpful message when trying to unsuspend a domain in Parallels Plesk running on Windows Server:

Warning: The domain is still suspended for the following reason: This user account and user’s domain were suspended

Then you will need to use the command line domain.exe tool to manually unsuspend the domain:

“C:\Program Files (x86)\Parallels\Plesk\admin\bin\domain.exe” –on

I’ve not seen the same behaviour on a Linux based Parallels Plesk server, but that’s not to say that it doesn’t also suffer from the same problem.

Regenerate statistics in Parallels Plesk for Linux

Monday, February 6th, 2012

Every night Parallels Plesk for Linux servers run a cron job to process various log files and generate statistics. This includes generating the HTML for the AWStats or Webalizer log analysis packages used for the Plesk “web statistics” features as well as updating the disk usage and bandwidth usage for each domain.

Sometimes you need to re-run this task, such as if it failed or if you need to process a particular domain name again. One common reason for this is to correct the disk and/or bandwidth usage figures for a domain.

You can either regenerate the statistics for all domain names (the equivalent of the daily cron job) using:

/usr/local/psa/admin/sbin/statistics –calculate-all

Or you can re-generate the statistics for a single domain name (“example.com” in this case) using:

/usr/local/psa/admin/sbin/statistics –calculate-one –domain-name=example.com

There is a similar tool in Parallels Plesk for Windows under C:\Program Files (x86)\Parallels\Plesk\admin\bin\statistics.exe, however this requires different arguments.

Windows Server 2008 with multiple IP addresses on one NIC

Monday, September 5th, 2011

If you are running a Windows Server 2008 installation with multiple IP addresses on one interface then you might be surprised to know that the default behaviour when selecting the IP address to use for outbound connections has changed compared to Windows Server 2003.

Previously, the “main” IP address on the adapter would have been used for initiating outbound connections and the “additional” IP addresses would be used for inbound connectivity only (unless specifically bound to by a client application, which is quite rare).

However, the new behaviour in Windows Server 2008 is that the IP address closest to the default gateway is used for outbound connections, which can catch you completely by surprise when your server’s IP address effectively changes after simply adding a new additional IP address to an interface – particularly if you are using firewalls to filter connections by IP address elsewhere in your network!

In order to provide some control which IP address is used for outbound connections, Microsoft introduced the “skipassource” flag to the netsh command. This allows you to exclude IP addresses from being used for outbound connections when managing IP addresses via netsh.

This command wasn’t initially available, so you may need to apply one of Microsoft’s hotfixes (KB975808 for Windows Server 2008 and KB2386184 for Windows Server 2008 R2). It is also possible to wipe out your carefully crafted skipassource settings using the GUI unless you apply KB2554859.

To add an IP address to the “Local Area Connection” interface with the skipassource flag set, fire up the command line and run the following (replacing <ip> <netmask&gt with the appropriate values for your network of course):

netsh int ipv4 add address “Local Area Connection” <ip> <netmask> skipassource=true

You can verify that this has worked as well as view the flags on all currently configured IP addresses using:

netsh int ipv4 show ipaddresses level=verbose

EPEL NSD RPM and the missing PID file directory

Sunday, June 26th, 2011

NSD is a fantastic authoritative nameserver from NLnet Labs which was developed in conjunction with the RIPE NCC to be a highly scalable, secure authoritative nameserver which has no recursive features by design. In fact, it is such as good nameserver that it is used on three of the root namesevers (k.root-servers.net, h.root-servers.net and l.root-servers.net).

Thanks to the EPEL project run by the Fedora guys, you can quickly and easily install an up to date copy of NSD on CentOS/RHEL systems. The only problem that I have found so far is that the RPM doesn’t seem to create directory for the PID file specified in the /etc/nsd/nsd.conf and so the daemon won’t start out of the box.

Obviously it is easy enough to create the /var/run/nsd directory with mkdir, but remember to chown/chgrp this directory to the nsd user and group, otherwise and “nsdc restart” will fail with errors in /var/log/messages along the lines of “failed to unlink pidfile /var/run/nsd/nsd.pid: Permission denied

Recovering Logical Volumes deleted with lvremove

Sunday, March 20th, 2011

Need to recover an LVM Logical Volume that you deleted by mistake? No problem, luckily LVM archives all of the old Logical Volume and Volume Group metadata in /etc/lvm/archive/ whenever you use something like lvremove to make adjustments to the Logical Volumes.

Before you start, remember that any kind of operation like this is potentially dangerous and so backup anything of importance on the intact Logical Volumes. Also, as a safety net, backup the contents of /etc/lvm just in case and then run “vgcfgbackup” to put an up to date copy of the metadata in /etc/lvm/backup.

Now look for the appropriate file in /etc/lvm/archive. Each LVM operation will create a file in here with the name of the affected Volume Group and an incrementing number. By default on RHEL/CentOS this will be “VolGroup00”, so you will be looking for /etc/lvm/archive/VolGroup00_xxx.vg where xxx is the appropriate increment.

If you open up your chosen file in your favourite text editor you should see a line that starts “description” and has something like “Created *before* executing ‘lvremove -f /dev/VolGroup00/xxx'” on it. You can use this to verify that you have the right file.

The next thing that you need to do is verify that this file has valid metadata and thus will be useable. To do this, you can use the vgcfgrestore command in a test mode that will perform a dry run. Assuming you are trying to restore Volume Group VolGroup00 from VolGroup00_00161.vg, this would look like:

vgcfgrestore VolGroup00 –test -f /etc/lvm/archive/VolGroup00_00161.vg

Which will return something along the lines of:

Test mode: Metadata will NOT be updated.
Restored volume group VolGroup00

Assuming this all went well, you can now re-run the same command but without the “–test” option:

# vgcfgrestore VolGroup00 –test -f /etc/lvm/archive/VolGroup00_00161.vg
Restored volume group VolGroup00

Now run an “lvscan” and you should see your missing Logical Volume(s) have returned, but are inactive. Re-activate them with “lvchange” and you are back in business, just be more careful next time 😉

lvchange -a y /dev/VolGroup00/xxx

Parallels Plesk for Windows upgrade and lots of session files

Monday, December 27th, 2010

Be careful when running the Parallels Plesk update utility on Windows servers if you have a large number of files in “C:\Program Files (x86)\Parallels\Plesk\admin\sessions” as once it has finished the upgrade the utility will try and clear this directory before letting you do anything else, including the mandatory reboot. It seems that it is quite easy for there to be hundreds of thousands of files in this folder, which in turn means that this part of the upgrade process can take well over an hour even on a decent machine!