Ubuntu – How to use external hard drive for server storage?

Apache2external-hddhard drivepartitioningserver

Ok, so I am a n00b. Keep that in mind. My Ubuntu computer is running an Apache2 server for basic web hosting and file transfer. If I wanted to use an external hard drive for it, how would I go about it? I mean, the var, www, and html folders are stored in the computer's storage. I want to combine the storage from the internal computer and external drive for total storage for the /var/www

Best Answer

  1. You should mount the drive and make sure it mounts automatically after a restart.
  2. You can use a symlink to the folder on the external drive. You could link directly in the vhost or apache config, but using symlinks simplifies most of the time.
  3. You need to set proper rights so Apache can write to that folder. On Ubuntu, Apache is run as user www-data, so make sure www-data can write to that folder.