How to make a webserver from the HP T5300

Why - How - questions - Specification

What you need

How

Step 1 - Format USB stick

Start your computer with PuppyLinux
Put your clean USB stick into your computer
Open GParted and choose the USB stick in the upper right corner
Remove all partitions from the USB stick
Create a new partition and format this partition to ext3

Step 2 - Create a bootloader

Do a universal install of Puppylinux and choose the syslinux bootloader
This is very important since grub will not work and grub4dos neither
Follow the steps - You can find the files for puppylinux at /mnt/home or on CD or whatever

Step 3 - Install TinyCoreLinux

Download the ISO file from http://www.tinycorelinux.net
Book of tinycoreFile that I have used
I have downloaded the so called TinyCore

Make a directory /tinycore on the USB stick
Click on the ISO file (in PuppyLinux) and copy the content to the USB stick in this directory.
We only need the 2 files core.gz and vmlinuz. The only interest is at a textbased operating system, because we have only 52 MB ram.
Make in the root of the USB stick the following directories:

Step 4 - Change the startup of the bootloader

The bootloader file extlinux.cfg must look like
DEFAULT tinycore
prompt 1
timeout 50

F1 boot.msg
F2 help.msg

label puppy
timeout 50
display boot.msg
kernel vmlinuz 
append initrd=initrd.gz pmedia=usbflash pfix=noram,nox nosmp

label tinycore
kernel tinycore/vmlinuz
append initrd=tinycore/core.gz tce=sdb1 home=sdb1 opt=sdb1
When you do fill in puppy in the prompt, tinycore linux starts after 5 seconds.
It searches for the tce, home en opt directory.
The home is where the websites are copied to.

Step 5 - Add software for the tinycorelinux

For a website we need a webserver.
The following software must be added:

Step 6 - Copy your website to the USB stick

Create under the directory home the directory for the website.
For me it is: /web/puppylinux
index.html is at: /web/puppylinux/www/htdocs
The directory can be found later on the webserver as /mnt/sdb1/web.....

Step 7 - Configurate lighttpd and sshd

Copy the file lighttpd.conf in the directory /home
Change the content in what you need. Remember most of the files are created by the user root. So you need to put sudo to edit it with vi.

Configuring ssh is done by adding the directory for ssh with its keys in /opt/filetool. My opt/filetool looks like:
opt
home
usr/local/etc/ssh
etc/password
etc/shadow

Step 8 - Configure ssh and other stuff from tinycore

Start the USB stick with tinycore from a computer.
I had an old monitor and a USB keyboard connected.
The main user for tinycorelinux is tc and there is no prompt for a password, so tc automatically logs on.
If tc is logged on it needs a password for the use of ssh.
Type passwd and [ENTER] and fillup twice a new password.
Because of the previous step, the password is remembered.
Do the same for the user root with: sudo passwd
Do the command filetool.sh -b
This makes a backup of the password file

Step 9 - Change the DHCP IP address into a static IP address

Change the file /opt/bootstart.sh so that services are starting at boot and that the static IP address will be accomplished.
My file looks like:
#!/bin/sh
# put other system startup commands here
sudo pkill udhcp
sudo ifconfig eth0 192.168.1.120 
sudo route del default
sudo route add default gw 192.168.1.254 eth0
sudo lighttpd -f /home/lighttpd.conf -m /usr/local/lib/lighttpd
sudo /usr/local/etc/init.d/openssh start

Step 10 - Restart the machine and connect with SSH

Repeat this step also with no keyboard connected.
If you can connect to ssh, the webserver is running.
For windows there is the software putty, linux can do it without putty.

Do the command filetool.sh -b
This makes a backup of the generated keys by openssh

Good Luck

Why making a webserver from the HP T5300 ?

In my experience is that every old PC is inadequate with working of 24x7.
Normally only servers are equiped for that.
The power supply of PC's are not equiped for 24x7 and the harddisk will fail after a certain time.
Laptop powersupplies are better equiped for that, they will normally stay powered 24x7.
The main thing that equipment is failing is that it has moving parts.
The HP T5300 does not have a harddisk, so you need a USB stick.
The HP T5300 does not have a fan either, so again not a moving part.
The HP T5300 does have a fast enough but not a CPU that is much heated.
So why not give it a try. Heat and moving parts are not in case of this little thin client.
Buy yourself a decent USB stick and make a little webserver

Disadvantages

The HP T5300 does not have much memory, so only some services are allowed to fit in the memory.
So I only run the lighttpd and ssh services.

The goal to create a computer with a simple webserver is accomplished.

Questions

Does puppylinux run on a HP T5300?
Answer: Normally NO
For some time it will run and than suddenly stops, because it is out of memory.
A USB stick is not designed for being a swap drive, use a HD drive as swap if you like to run puppy on this machine.
Does a graphic tinycorelinux run on a HP T5300?
Answer: Normally NO, same reason why puppylinux is difficult to run on this machine

Brothersome