I think ownCloud might be what you are after. Before following the steps below make sure your Pi has a fixed IP address.
Assuming you are running Raspbian open a Terminal window and run:
sudo apt-key add - Release.key
Those two previous commands installs the necessary repositories and the command below ensures they are up to date:
sudo apt-get update
sudo apt-get install owncloud
Which installs ownCloud, it will also ask you to set up a password. The above command also installs some Apache webserver stuff that is also required. To install the extra Apache modules run:
sudo a2enmod headers rewrite env
sudo apachectl restart
To enable the server to handle files greater than 2MB a couple of tweaks need to be made. Go to
/etc/php5/apache2 and open the file
php.ini. Change the value of
post_max_size variables to something like
2G. Which changes the maximum file size to 2GB.
As an extra you can install APC PHP accelerator which might make ownCloud more responsive for larger installations. To do this run:
sudo apt-get install php-apc
To configure APC PHP accelerator run
sudo nano /etc/php5/conf.d/20-apc.ini. In this file add:
extension=apc.so apc.enabled=1 apc.shm_size=12M
sudo apachectl restart enables the cache.
Now you can add external storage, start by plugging in the USB storage device and run
sudo blkid. If only one USB device is plugged in it will probably be mounted as
/dev/sda1, you will also want to make a note of the UUID. Run
sudo mkdir /media/owncloud to create a new file directory. Mount the drive with
sudo mount -t vfat -o umask=007,auto,uid=33,gid=33 /dev/sda1 /media/owncloud.
This does work on the assumption the drive is FAT 32. So the drive is automatically mounted run
sudo nano /etc/fstab and add:
UUID=your-drives-uuid /media/owncloud/ vfat
rw,umask=007,auto,uid=33,gid=33 0 0
Now open a web browser on your computer and enter
Pi's-IP-Address/owncloud. You will then be prompted to create an account. Click storage & database pull down menu and add
media/ owncloud/data in the text box corresponding to
Data Folder. Then select the
MySQL/your-username option in the
You will then be asked enter the connection details of the database server, so just enter "localhost" as the host and "root" as the username, along with the password you configured when the database was pulled in along with ownCloud.
Everything is now setup. To access the files on the database from your phone you can install the ownCloud app or the free ocloud app and you are good to go.