Simple Download Setup

Simple Download Setup

Here is some simple steps to give you a feature to share files with others.  This example is for Debian setup, but can easily be ported over for other linux flavors.

Setup folder in your home directory:

mkdir /home/yourname/filedownloads

add index.php file to it:  ( from here )

$filepath = “/home/yourname/filedownloads/”;
$dir_handle = @opendir($path) or die(“Unable to open your  $filepath”);
while ($file = readdir($dir_handle))

if($file == “.” || $file == “..” || $file == “index.php” )
echo “<a href=\”$file\”>$file</a><br />”;

append to apache setup file at /etc/apache2/sites-available/default

#  public file download
<VirtualHost *:80>
DocumentRoot /home/yourname/filedownloads

Restart apache daemon

/etc/init.d/apache restart

Everything you put inside the folder /home/yourname/filedownloads will now show up as a link on the web under

Leave a Reply

Your email address will not be published.