Installing Raspbian OS

Important: In order to use tha Raspberry without a screen, mouse and keyboard, you must create an empty file named "ssh" into the "/boot" on your SD card. Remember that you have to connect your device to the network using an ethernet cable.

Update your OS

sudo apt-get update && sudo apt-get dist-upgrade

Mount external hard drive

First find your hardware:

sudo blkid

Next make your OS mount the external drive at boot

sudo nano -Bw /etc/fstab

You have to include the following lines (using the correct UUID)

UUID=0000000000000000 /media/externalUSB auto defaults,user,nofail 0 2

Install Samba

sudo apt-get install samba samba-common-bin

Samba setup

Open the samba configuration file

sudo nano /etc/samba/smb.conf

Simply add the following lines into that file:

[Files on external USB]
comment = Files
public = yes
writable = yes
browsable = yes
path = /media/externalUSB
create mask = 0777
directory mask = 0777
guest ok = yes
only = no

Install Apache

sudo apt-get install apache2

Change permissions

sudo chown -R $USER:$USER /var/www
sudo chown -R 755 /var/www

Restart Apache

sudo service apache2 restart

Put your device to sleep for 60 seconds

This will not work on Raspberry since the device has no internal clock

sudo rtcwake -m disk -s 60