I have a folder on a linux box which is up 24x7. The folder needs to be available for download to everyone on the same network, anytime of the day.

How Can I set this up using ftp or some other method? I'd like to send everyone a link, which would allow them to download this folder.

Thanks.

link|improve this question
feedback

migrated from stackoverflow.com Nov 4 '11 at 8:00

This question came from our site for professional and enthusiast programmers.

2 Answers

  1. either serve it through a web-server (apache, nginx, ...) on the machine

  2. or export the directory through /etc/exports and share it through NFS -- then mount it remotely on the other machines (see: man nfs man exports )

  3. you could use ssh / scp to copy the contents (better choice than ftp).

  4. you could use rsync to actively sync the directory every once in a while, e.g. triggered by a cron-tab entry.

Option 2. is probably the best choice, because you can also restrict who can mount the directory, and you can share it either read-only or writable by others. And an NFS-mounted directory is available on the client-machine just like any other directory, which makes it really easy to access the data.

Rsync is typically used when having to sync contents of directory trees between two machines. If you want to share the directory across the whole network and want to have the contents readily available, then NFS is the best choice.

HTTP and FTP are probably not such good choices for this, because they need you to actively pull the contents, to sync things up in case something changed.

NFS sharing is probably the best solution in your case, and you can mount it cross-platform:

http://sagehacks.wordpress.com/2009/01/21/howto-mount-nfs-shares-under-windows-7/

http://support.microsoft.com/kb/324055

link|improve this answer
Option 1 is easy enough to control with basic "htaccess" ... of course, it's also "downloaded specific files" and "read only". – pst Nov 3 '11 at 6:24
The folder needs to be downloadable on both linux & windows machines. Will option 2 work for it to be downloaded on winodws machine? – Gshaw Nov 3 '11 at 6:28
see bottom of my answer – Tilo Nov 3 '11 at 6:32
Note that NFS authentication is on a "trust me!" basis, so if you don't trust your client machines and the network between, NFS might not be your best choice. OTOH, NFS is nice and fast for UNIX/Linux/OSX clients (though look around for the difference between hard and soft mounts.) Windows is happiest with CIFS/SMB (Samba on the Linux side) but CIFS on Linux is about the same as NFS on Windows. WebDAV works for both Windows/OSX clients, but it's slower, and not as easy as NFS to set up, and most painful for Linux/UNIX clients. (Fun, isn't it?) – jon Dec 16 '11 at 19:29
feedback

This should be on serverfault but most distributions comes with admin tools which makes it very easy to configure both samba (windows file sharing) and NFS. You need to say which flavor of linux you're on to get specific help there.

At the end, NFS exports ends up in /etc/exports and Samba exports usually in /etc/samba/smb.conf or something like that but stick to the tools.

Setting up an ftp server is also an option but I wouldn't do it for the purpose you describe.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown