Linux – a simple linux based file server with web front end for upload and download to user folders

file-serverlinuxweb-server

I'm running an Ubuntu 10.4 system. I have freedom to install mostly whatever packages I need (free non-commercial only) and I can program/script C++, python, JavaScript comfortably and probably work with PHP and Java if needed.

My goal is to allow users to access the server via a web page, see the file contents of a user specific directory that they can upload and download to/from.

This is a throwaway prototype solution too, so I don't need or want anything extensible or flexible or secure or even scalable, just something very simple and quick that could handle a couple of users uploading and downloading simultaneously, the main caveat being that the files being uploaded/downloaded might be measured in gigabytes.

I've done very little web application development and only some Linux development and my research has led me to LAMP, python CGIHTTPServer, tomcat, but I suspect there is something simple that I'm missing.

I'm trying to minimize the amount of programming/scripting I do for this, so I'm hoping a drop in package exists.

Best Answer

Well i ended up doing the following:

apt-get'd lighttpd

edited the lighttpd conf:

  • to point it at /var/www/
  • enabled mod_cgi cgi.assign ".py" => ""
  • enabled dir-listing.show-header
  • set dir-listing.exclude HEADER.txt

i then added an executable upload.py script using cgitb and cgi to copy the file to /var/www/

i then created a HEADER.txt in /var/www/ which had HTML for a typical multipart form upload that pointed at my upload.py

i also had to ensure that the concerned directories and files were appropriately permission'd and the py script executable of course.

and this was sufficient for me to be able to use dir-listing to access and download files from /var/www on the server, and use the form+python to upload files to /var/www/ on the server.

its not particularly secure or anything, but it's doing the job so far.

Related Topic