Check RAID status on Ubuntu

Check RAID status:

/sbin/mdadm --detail /dev/md0

Or check with this:

sudo cat /proc/mdstat

This is what a good status will look like:

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md1 : active raid1 sdb5[0] sdc5[1]
      1485888 blocks [2/2] [UU]
      
md0 : active raid1 sdb1[0] sdc1[1]
      242709888 blocks [2/2] [UU]
      
unused devices:

The [UU] (I think) indicates the status of both drives in the array, and both are Up

Easy steps for Ubuntu server upgrade

sudo apt-get update
sudo apt-get upgrade

Edit /etc/update-manager/release-upgrades, and ensure:

Prompt=normal

(otherwise if its LTS you will only be able to upgrade to the next LTS release if one is available

sudo apt-get install update-manager-core
sudo do-release-upgrade

…and follow the prompts.

Hiding Apache2 header info

Add these to your /etc/apache2/apache2.conf then restart Apache:

LoadModule headers_module /path_to/mod_headers.so
Header unset Server
ServerSignature Off
ServerTokens ProductOnly
Header unset X-Powered-By

Enabling chrooted sftp access for WordPress automatic upgrades

Create wordpress user specifically for the auto update and add the user to the www-data group:

  • sudo adduser wordpress
  • sudo adduser wordpress www-data

chgroup the wordpress dir to the www-data group:

  • sudo chgrp -R www-data /var/www/wordpress

Add the following to /etc/ssh/ssd_config to chroot the wordpress user to the wordpress directory:

Match User wordpress
ChrootDirectory /var/www/wordpress
AllowTCPForwarding no
X11Forwarding no
ForceCommand /usr/lib/openssh/sftp-server

Restart the sshd service:

sudo /etc/init.d/ssh restart

Setup the sftp userid and password in the wordpress settings and select sftp.