Friday, January 26, 2007

Unison and USB

I was having some problems getting my trusty USB key and unison (the file sync software) to play together. It turns out that because my USB key is formatted as vFAT (or FAT32) to allow it to work on my Ubuntu box and Windoze machines (at work), I need to ensure that Unison doesn't try to mirror the permissions.

unison usb -perms=0
where usb refers to the file: /home/username/.unison/usb.prf

Thursday, January 25, 2007

Using 4psa Total Backup

I have bought Total Backup from 4psa for Plesk and was having an issue with the automatic transfer of files from the host to backup server. Using FTP seems to work fine, but I couldn't work out how to use the SSH transfer.

I finally worked it out. You need to create a public/private key pair and then add these to the backup server's authorised keys within the profile of the user you want to log in as. I'd been doing this, but not as root and that was why the transfer was falling over - shame the debugging info wasn't that great.

Login to the backup server and create the account for the backup.
sudo adduser rbackup
Now log into the host server, create keys and enable passwordless login to the remote backup server - remember not to specify a passphrase for the key pair.
sudo -s
ssh-keygen -t rsa
ssh-copy-id -i /root/.ssh/id_rsa.pub rbackup@backup.server.tld
Confirm the login process by ssh rbackup@backup.server.tld

If you don't now create the directory that tbackup is expecting to log into remotely, it fails with a very unhelpful message. So, if (in the settings section of the tbackup page within Plesk), you have set backups to be stored in /rbackup/foo, you need to ensure that his exists on the remote system.

If there are issues with tbackup and you need to do some debugging:
/usr/local/tbackup/do_backup -d

Wednesday, January 24, 2007

MythTV

I've just been having a look at MythTV and am very interested in taking a Ubuntu Edgy (or Feisty) system and installing Myth on it. Myth, for those who don't know, is a media center which looks very polished. Then I could rip all my DVDs! Now there's a task that would take a significant amount of time!

Keeping an eye on hardware

Adding a task bar icon to keep an eye on hard drive and CPU temp was my latest challenge.

A challenge that was easily met by sensors-applet, a GNOME task bar applet:
sudo apt-get install sensors-applet
sudo apt-get install hddtemp
After that, a quick right click on the task bar and "Add to panel" was all that was needed before a graph akin to CPU usage appeared telling me how hot the CPU was - better get that fan turned up!

Thursday, January 18, 2007

Plesk 8.1 and spamassassin

I've just finished putting together a new UK2 Plesk server and found a problem when trying to "spamassassin --lint" after installing Spam Guardian.
Failed to run DNS_FROM_AHBL_RHSBL RBL SpamAssassin test, skipping:
(Can't call method "bgsend" on an undefined value at
/usr/lib/perl5/site_perl/5.8.5/Mail/SpamAssassin/Dns.pm line 112.
It would appear as though some required perl libs aren't loaded which can be proven with:
# perl -e "use Net::DNS::Resolver"
So, a quick couple of apt-get installs are required to load the respective libraries:
# apt-get install libnet-ip-perl libnet-dns-perl
I'm not sure why these aren't loaded as dependancies of spamassassin, but adding the libs seems to have fixed the problem. Recheck the "spamassassin --lint" and the errors should have gone.

Setting up a new UK2 server

Basic server setup

Once the email from UK2 has arrived with confirmation of the server, log into the server as root, change the password and upgrade all the current packages (be aware of previous kernel updates that have caused kernel-panics at boot:
ssh root@server12345.uk2net.com
passwd
apt-get upgrade
Upgrade out of date packages and setup the sudo function
apt-get install sudo
nano /etc/sudoers
Add the line %admin ALL=(ALL) ALL to the bottom of the file. Now add some real users and a group called admin; add users to the admin group if they are sudoers.
adduser username
groupadd admin
usermod -G admin username
Setup some other basic packages and admin tasks
apt-get install joe lynx
joe /etc/motd - Welcome to...
joe /etc/ssh/sshd_config - PermitRootLogin no
sudo /etc/init.d/ssh restart
Setup the hosts file (/etc/hosts)
127.0.0.1 localhost.localdomain localhost

83.170.97.143 luffness.humblehosting.co.uk luffness

83.170.75.20 kilspindie.konsulting.ltd.uk kilspindie
83.170.73.70 kingsacre.konsulting.ltd.uk kingsacre
83.170.73.111 kingussie.konsulting.ltd.uk kingussie
Logout of the root account and setup passwordless login to the new server
ssh-keygen -t rsa - follow the hints (don't enter a passphrase)
ssh-copy-id -i ~/.ssh/id_rsa.pub username@host
Log into your new account and check that you aren't prompted for a password.

Firewall

The next job is to remove the firewall that comes preinstalled with some UK2 debian boxes. A quick check should allow confirmation of any rules that are set
sudo iptables -L

If rules are setup, the following commands followed by a reset should reset the firewall and remove it.
sudo -s
cd /etc/init.d/
rm -rf firewall
cd /etc/rc2.d/
./S22firewall_setup
shutdown -r now
Copy across the Plesk installer
chmod +w psainstaller....
./psainstaller...
choose the appropriate sections of Plesk to install and let the installer do the work.

Plesk web

Log into the Plesk web interface as admin:setup and follow the on screen instructions to setup the hostname, IP addresses, admin account and first client account.
  • Check the firewall is installed and running
  • Switch on and setup Watchdog
  • Run the security check for the first time
  • Increase server idle timeout (90 min)
  • Run updater and update settings
  • Setup IP addresses
  • Fix contact name and login for client account
Copy across the 4PSA installers: Spam Guardian and Total Backup (minimum)
Also copy across the SafeCat deb (http://www.4psa.com/software)

Spam Guardian

move the tarred installer to /usr/local/src
unzip the installer - [tar -zxf]
chmod 777 sguardian_directory
double check the install.txt file

sudo dpkg -i safecat*.deb
sudo apt-get install spamassassin
sudo ./install.sh - follow instructions
  • Ensure that domain and client creation and modification works
  • Check the service restart works
  • Install the license and perform the server checks again
Double check that a "spamassassin --lint" doesn't throw any errors (in the early versions of 8.1 and SG 3.0.3, some libs were missing):
apt-get install libnet-ip-perl libnet-dns-perl
Copy the rules_du_jour scripts to /usr/local/sbin/
Copy the RDJ config file to /etc/rulesdujour/
Run RulesDuJour and watch the rules get updated.
Add a cron to run the script at a random time in the morning.

Total Backup
move the tarred installer to /usr/local/src
unzip the installer - [tar -zxf]
chmod 777 sguardian_directory
double check the install.txt file

sudo apt-get install bzip2 ftp
sudo ./install.sh
Licences

Next important thing is to setup the licences for Plesk, Spam Guardian and Total Bakcup. Download them from their respective repositories and use the web-based GUIs for each system to seach for the licence and upload it.

Munin
sudo apt-get install munin-node
sudo joe /etc/munin/minin-node.conf

add host_name [hostname.example.com]
add allow ^192\.168\.2\.1$ [where 192.168.2.1 is the muine server IP]

sudo /etc/init.d/munin restart
Browse to the firewall module as admin and open a port:4949 to the IP address of the munin server.

Saturday, January 13, 2007

Edgy Eft re-install

This is just a quick reminder of the install process for Edgy Eft. All in all, it took about 2 hours + data copying time.

CD install
login...

Basic setup
check hardware
sudo apt-get upgrade
restart...

stop gedit from saving backups!
change the gedit settings - font: monospace 9
change the terminal settings - font: monosapce 9

setup hostname
setup /etc/hosts
setup /etc/network/interface

Setup the GDM
sudo apt-get install nvidia-glx
backup the original working xorg.conf file
copy the xorg.conf file to /etc/X11
restart GDM

login...


auto-adjust both flat-panels
move panels and reset
add 'force-quit', 'system monitor'
create 4 desks
setup system monitor (50px) CPU, harddisk, network
add application icons


Add useful applications
add the universe repository
sudo apt-get install joe muine gstreamer0.8-mad gstreamer0.10-fluendo-mp3
sudo apt-get install easytag unison unison-gtk
Setup unison
copy usync to /usr/local/sbin/
copy data from backup server
copy unison config files to the .unison directory
perform the sync
copy mvb to /usr/local/sbin/
setup a panel launcher for unison-gtk backup
setup a panel launcher for unison-gtk usb -perms=0

Remaining setup
create desktop connections to useful servers
setup passwordless login with keys (don't enter a passphrase)
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub username@host
setup printers
re-install google-earth