If the server is under linux you can use dmidecode for the motherboard serial:
sudo dmidecode --type 2 |grep -i serial
For the harddisk use hdparm:
sudo hdparm -I /dev/sda | grep -i serial
this will check for the serial of the master hd, for slaves you have to check for sdb, sdc... in any case, with both commands, you need to provide a password or you have to add the Apache user to the admin group which, for security reasons, it is never a great idea.