Archive for April, 2013

Problems installing Authen::Libwrap on Ubuntu Server using webmin

So going to webmin > Perl Modules > Suggested Modules shows Authen::Libwrap as a suggested module, but using webmin to install it always fails.

Error: Function definition too short '/ * EOF * /' in Libwrap.xs, line 32

the following may help

apt-get install build-essential gcc libc6-dev libwrap0 libwrap0-dev
sudo cpan ExtUtils::MakeMaker
sudo cpan Authen::Libwrap

This was writted for Ubuntu Server 12.04.

Futher Reading:

, , ,

Leave a comment

Simple outbound email configuration for Ubuntu Server 12.04 using sSMTP

If all you really want from your Ubuntu Server is to be able to send you email if something goes wrong, or the occasional email to a trusted partner, friend, colleague, etc, then you want a simple solution. Although Postfix or sendmail, etc, will work in a satellite configuration, it’s still too heavy and over-the-top for this type of setup.

Enter sSMTP.

apt-get install ssmtp

Now open /etc/ssmtp/ssmtp.conf in your favorite text editor and, to get it working on an example gmail account, set it up like so:

[email protected]

Save the file, and you’re done.

Example for Amazon SES users. Be sure the sending domain is verified or mail will get rejected.:

[email protected]
# from SES SMTP settings

Important: You’re leaving your Gmail account password in a plaintext file. Make sure you’re using strong passwords. Even better, use Google 2-factor authentication so you can use an application-specific password for sSMTP.

UPDATE: Lastly, update the permissions

chown root:mail /etc/ssmtp/ssmtp.conf
chmod 640 /etc/ssmtp/ssmtp.conf

Unprivileged users who have a need to send mail using sendmail must be a member of the mail group, or they will receive the following error:

mail: Cannot open mailhub:25

This was written for Ubuntu Server 12.04 64-bit.

Further reading:

, , , , ,

Leave a comment

Suhosin PHP extension on Ubuntu Server 12.04

On Ubuntu Server 12.04:

sudo apt-get install php5-suhosin

Edit /etc/php5/apache2/php.ini and add (this step may not be necessary):



service apache2 restart


Leave a comment

Installing UPS monitoring for a USB UPS on Ubuntu Server

This is for Ubuntu Server 12.04 64-bit.

Install the NUT software

sudo apt-get install nut

edit file /etc/nut/ups.conf

Scroll down to the example, uncommenting and configuring. Locate the correct driver to use from this page. (Most USB UPSes using the usbhid-ups driver, and port set to auto). Example:

driver = usbhid-ups
port = auto

Note the tag used in the brackets, you will need this later.

edit file /etc/nut/upsd.users

Find the section entitled “Configuring for upsmon”, uncomment and configure, using the example given.

Next edit upsmon.conf and add the example MONITOR line provided in upsd.users, adjusted for your settings.

Lastly, edit nut.conf and set appropriately.

now, restart

service nut restart

If you get this error:

* Restarting Network UPS Tools [ OK ]
Broadcast Message from [email protected]
 (somewhere) at 21:52 ...
Communications with UPS [email protected] lost
Broadcast Message from [email protected]
 (somewhere) at 21:52 ...
UPS [email protected] is unavailable

Run the following commands as root:

udevadm control --reload-rule
udevadm trigger
upsdrvctl start

That’s it.

, , ,

Leave a comment

Enabling Apache SSL and installing own certificates

This is for Ubuntu Server 12.04 64-bit.

The easiest way to activate Apache’s SSL is:

a2enmod ssl
a2ensite default-ssl
service apache2 restart

That’s all for the setup, now for installing the certificates. I am using certificates from StartSSL, so your installation may be slightly different.

Copy the unencrpyted SSL private key to /etc/ssl/private, chown it www-data:www-data, chmod it 700.

Find the line containing SSLCertificateKeyFile, uncomment it, and change it to point to your private key file, like so:

SSLCertificateKeyFile /etc/ssl/private/(your private key file)

Copy your public key to /etc/ssl/certs.

Change the SSLCertificateFile line to point to your public certificate, like so:

SSLCertificateFile /etc/ssl/certs/(your certificate file)

Find the following line and uncomment it:

SSLCACertificatePath /etc/ssl/certs/

That’s it.

, , ,

Leave a comment

Installing AjaXplorer on Ubuntu Server

Instructions are here, reposted for my own convenience:

This is for Ubuntu Server 12.04 64-bit.

edit /etc/apt/sources.list and add to the bottom:

deb stable main
deb-src stable main

Then, install the gpg key

wget -O -[email protected] | sudo apt-key add -


sudo apt-get update
sudo apt-get install ajaxplorer

A few more steps to get it working…

copy the sample config file over (and make it readable by the web server):

cp /usr/share/doc/ajaxplorer/apache2.sample.conf /etc/apache2/sites-enabled/ajaxplorer.conf
chown www-data:www-data /etc/apache2/sites-enabled/ajaxplorer.conf

Restart apache…

service apache2 restart


/etc/init.d/apache2 restart

Make AjaXplorer redirect to HTTPS… (this is displayed during the initial page visit anyway)

edit /usr/share/ajaxplorer/conf/bootstrap_conf.php and uncomment the following line (or add it to the bottom)

define("AJXP_FORCE_SSL_REDIRECT", true);

If HTTPS doesn’t load, it’s probably because apache isn’t configured for SSL. That’s in the next section.

If you get a warning about Server charset encoding, uncomment this line in /usr/share/ajaxplorer/conf/bootstrap_conf.php

define("AJXP_LOCALE", "en_US.UTF-8");

Lastly, since I have /srv on a separate partition, I want ajaxplorer data stored there. By default it’s stored in /usr/share/ajaxplorer/data, which is actually a symlink to /var/lib/ajaxplorer/data.

mkdir /srv/ajaxplorer
cp -r /var/lib/ajaxplorer/data/* /srv/ajaxplorer
chown -R www-data:www-data /srv/ajaxplorer
rm /usr/share/ajaxplorer/data
ln -s /srv/ajaxplorer /usr/share/ajaxplorer/data

Warning: AjaXplorer will start acting odd if /srv isn’t mounted at boot time. Keep that in mind.

By default, PHP max file upload is 2M, and this setting will carry over to AjaXplorer. In order to increase it, you have to change it in three places.  The AjaXplorer documentation says that this is set by php’s upload_max_filesize, but I’ve found that you also have to change php’s post_max_size to match. (/etc/php5/apache2/php.ini). After which, go into AjaXplorer settings repository, then Global Configurations > Core Configs > Common ‘uploader’ core configs. Expand Limitations, then set File Size to 0 to inherit the PHP setting. (Note: It won’t stay 0, it will auto-set to php’s setting. Keep this in mind if you want to change it later.)

More later…

, ,

Leave a comment

Installing webmin on Ubuntu Server

Same disclaimer as last post: This is mostly for my memory, but you’re welcome to the comments section below.

This is for Ubuntu Server 12.04 64-bit.

In order to install webmin from apt, follow these instructions, reposted here for my own convenience:

edit /etc/apt/sources.list and add to the bottom:

deb sarge contrib
deb sarge contrib

then, to add the gpg signature, run:

sudo wget -O - | sudo apt-key add -

lastly, install:

sudo apt-get update
sudo apt-get install webmin

If it complains about missing dependencies, first edit /etc/apt/sources.list and uncomment any lines for universe. Then, install these:

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

Coming up…even more…

, ,

Leave a comment

Installing Ubuntu Server 12.04 LTS x64 on the HP MicroServer N40L

I’m mostly documenting this as a way for me to remember it, but anyone is free to learn from my doings or leave their own comments.

Configuration is 3x2TB hard drives in bays 0, 1, 2. Bay 3 is empty. (I’m considering adding a 4th 2TB drive and reshaping to RAID-6 at some point in the future.)

Partitioned as follows (MBR):

  1. 50GB as RAID
  2. 4GB as RAID
  3. 1.9TB (max) as RAID

RAID setup (mdadm) as follows:

  • md0: partition 1 (50GB) RAID-5, 3 units, 0 spares. EXT4, bootable, mounted at / [Total 100GB+parity]
  • md1: partition 2 (4GB) RAID-5, 3 units, 0 spares. swap [Total 8GB+parity]
  • md2: partition 3 (1.9TB) RAID-5, 3 units, 0 spares. EXT4, mounted at /srv [Total 3.8TB+parity]

Packages installed during installation:

  • OpenSSH
  • LAMP
  • Samba

GRUB installed to MBR

The very first thing to do after installation is to update. SSH in and run the following:

sudo apt-get update
sudo apt-get upgrade

May get the following complaint about kernel updates being held back:

The following packages have been kept back:
 linux-headers-generic-lts-quantal linux-image-generic-lts-quantal
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

This is the fix:

sudo apt-get dist-upgrade

Coming up… more installations…

, , , , , , ,

Leave a comment

Windows 7 USB DVD Download Tool fails on UEFI-boot systems

If your system is set to EFI/UEFI boot, and you try to use the Windows 7 USB/DVD download tool to make a Windows 7 bootable USB stick, it will fail with the following error:


Files copied successfully. However, we were unable to run bootsect to make the USB device bootable. If you need assistance with bootsect, please click the “Online Help” link above for more information.

The reason? Well, I found this post that had instructions on running bootsect.exe manually. I did that, I received this message:


This tool can only be run on systems booted using a PC/AT BIOS. This system was booted using EFI or some other firmware type.

So UEFI booting is why the USB creation fails.

Anyone have any suggestions on a workaround for this?


Leave a comment