How to give others access to a folder on my computer?
January 23, 2008 5:47 PM   Subscribe

What's the easiest way for me to host files for friends to download directly off my computer? I'm running Ubuntu 7.10.

The goal: a friend can type in a URL (maybe I'll register with DynDNS since I'm using DSL, and my IP address changes periodically), see a list of folders/files, and download what they want.

Right now we're accomplishing this by me using Gmail to e-mail the file to them. What I'd rather do is have them be able to peruse the contents of a folder, as I'm constantly adding files to the folder(s). Rather than e-mail them all the time, they can log on, see what's there, and download it. They need to be able to do this through a browser, not an FTP client.

I'm not sure what I should even be looking for here. Searches like "file sharing" and "file hosting" aren't getting me anywhere, so I'm turning to the Green.

Remember, I'm running Ubuntu, so unfortunately something like HFS isn't going to work for me, but that looks like what I want to do.

A GUI with simple drag/drop would be perfect.
posted by spikeleemajortomdickandharryconnickjrmints to Computers & Internet (29 answers total) 3 users marked this as a favorite
 
You'd have a much easier time getting a cheap hosting plan with godaddy or dreamhost and just ftp'ing your files up there and linking your friends to them. Most decent hosting services make this kind of thing extremely easy.

And there's always services like box.net, but I'm not sure how easy it is to share files with others.
posted by inkedmn at 5:51 PM on January 23, 2008


Just checked into the box.net thing and you can indeed share files with friends. Not sure how big your files are or how much space you'd need, but you get a 1gb space for free.

http://www.box.net/info/public-sharing
posted by inkedmn at 5:53 PM on January 23, 2008


I should have said that I'm looking for a free service. I'll need much more than 1GB of space unfortunately.
posted by spikeleemajortomdickandharryconnickjrmints at 5:55 PM on January 23, 2008


Plain old apache. There are 10^6 ubuntu tutorials for this. It requires you to leave your PC on all the time. Of course anyone with the right URL could get the files. If you want auth, consider a chrooted sftp, especially since you're all friends.
posted by a robot made out of meat at 5:55 PM on January 23, 2008


I should also point out that the comments in the LH article that you like for HFS discuss exactly this question.
posted by a robot made out of meat at 5:57 PM on January 23, 2008


The super-easy solution: install Apache and send your friends the link to your IP, sending them an e-mail periodically when your IP changes.

This has some problems, though:
- Some ISPs block incoming port 80... You can easily run on 81 or 8080 or whatnot. Be aware that, with some ISPs, this violates your Terms of Service.
- Your IP will change periodically, as you mention. DynDNS is the right track, though I haven't worked with it in years.

The one problem you can't get around: your upload speed is probably substantially lower than your download speed, meaning that serving files is going to be relatively slow.
posted by fogster at 5:59 PM on January 23, 2008


As for the interface, you can install PHP in addition to Apache, which gives you access to myriad PHP File Management tools. I've been meaning to set up Relay, but haven't gotten around to it yet.
posted by fogster at 6:01 PM on January 23, 2008


Frogster and a robot, I installed Apache and had absolutely no idea what to do after that. I'll search around for a tutorial.

I realize the upload speed will be much slower than my download, but that shouldn't be a problem. Thanks for the suggestions.

If anyone knows of easy Apache solutions or tutorials, I'm all ears.
posted by spikeleemajortomdickandharryconnickjrmints at 6:05 PM on January 23, 2008


It's really simple.

Step 1: Install Apache.
Step 2: Make a directory called /var/www/spikeleemajortomdickandharryconnickjrmintsstuff/
Step 3: Put all of the stuff you want to share in that directory.
Step 4: Have your friends go to the URL: http://yourdomain/spikeleemajortomdickandharryconnickjrmintsstuff/
Step 5: Profit
posted by jozxyqk at 6:18 PM on January 23, 2008


Yes to Apache. Super simple, even on linux.
They forgot the part about visiting some dynamicdns place like no-ip.com and getting your fancy domain name like http://harrytrumancapote.bounceme.net and running the client (or letting Tomato do it for you if you have a WRT54G Linksys router).
posted by TomMelee at 6:39 PM on January 23, 2008


If you've installed Apache and it's running, your computer is already a web server.

Figure out what the location of your Apache root directory is (it depends) and put a file there.

Figure out what your IP address is.

Now your friends should be able to download the file from http://<your ip address>/<yourfilename>
posted by AmbroseChapel at 6:51 PM on January 23, 2008


If you're on Ubuntu 7.10, it looks like the root level of the webserver is /var/www.
posted by AmbroseChapel at 6:54 PM on January 23, 2008


A couple more options:
http://freshmeat.net/projects/phpdropbox/
http://freshmeat.net/projects/webadmin/
posted by fings at 6:59 PM on January 23, 2008


SSH on the server, dyndns.org(*) and a tunnel through your router for you, and WinSCP for your friends.

IMO, using Apache for this is not so good, unless you're planning on running tripwire or some other security/paranoia goodness alongside. I'd suggest you uninstall it.

(*)-Some routers can manage DynDNS updates for you. Check your router manual.
posted by Orb2069 at 7:11 PM on January 23, 2008


Sorry about not reading your part WRT browser, not client, but I respectfully suggest you reconsider, particularly if you've got any interest in security, whether it's from the R.I.A.A. or bored Russian hackers.
posted by Orb2069 at 7:22 PM on January 23, 2008


Step-by-step for Ubuntu Apache installs: (root console)

Install apache:
# aptitude install apache2

Create a host config to share the folder /var/www/shared to users specified by /var/www/access/htpasswd.
"My Shared Junk" can be whatever you want but be sure to replicate it in a few steps when it shows up again. This shows up in the users' password prompt.
# echo 'NameVirtualHost *

DocumentRoot /var/www/shared

AuthType Digest
AuthDigestProvider file
AuthUserFile /var/www/access/htpasswd
AuthName "My Shared Junk"
require valid-user
Options +Indexes

' > /etc/apache2/sites-available/shared

Point Apache at the host config we just made instead of the packaged one
# rm /etc/apache2/sites-enabled/000-default
# ln -s /etc/apache2/sites-available/shared /etc/apache2/sites-enabled/001-shared

Enable digest authentication since the regular plaintext mode is really crappy on security
# ln -s /etc/apache2/mods-available/auth_digest.load /etc/apache2/mods-enabled/auth_digest.loa

Make the folders just referenced in the host conf
# mkdir /var/www/access /var/www/shared

Add a user. If you want to add more follow the same procedure but omit the '-c[reate]' flag.
# htdigest -c /var/www/access/htpasswd "My Shared Junk" username

Restart the Apache service.
# /etc/init.d/apache2 restart

You'll likely find your ISP blocks port 80, you can easily make Apache listen on a different port. Restart the Apache service afterwards.
# cat /etc/apache2/ports.conf | sed s/80/44020/ > /etc/apache2/ports.conf

Visit http://localhost:44020/ and enter one of the username/password combos you set up earlier to test. If all is well move the files you want to share to /var/www/shared. Strongly consider reading a tutorial on Apache SSL or posting again if you're serving any confidential files.
posted by moift at 7:30 PM on January 23, 2008


Crap, so all the carets got eaten. I always do that.

The echo command should look like this:

echo 'NameVirtualHost *
<VirtualHost *>
DocumentRoot /var/www/shared
<Location />
AuthType Digest
AuthDigestProvider file
AuthUserFile /var/www/access/htpasswd
AuthName "My Shared Junk"
require valid-user
Options +Indexes
</Location>
</VirtualHost>' > /etc/apache2/sites-available/shared
posted by moift at 7:34 PM on January 23, 2008


crap again,

ln -s /etc/apache2/mods-available/auth_digest.load /etc/apache2/mods-enabled/auth_digest.load
posted by moift at 7:38 PM on January 23, 2008


super-super easy, if you don't mind using kubuntu instead of ubuntu (as far as I know this is a kde feature that gnome does not have...)

right-click on a folder (in konqueror or dolphin), select properties. go to the 'sharing' tab, which should be the last/rightmost (NOT the 'share' tab which is next to it)

tell it to start the web sharing applet which will let you select a port etc. and once done with that, the folder will show up at http://your.ip.address:port/

you can share as many folders as you want, just have to give each one a unique port #.
posted by dorian at 7:48 PM on January 23, 2008


(naturally you could use fqdn instead of IP)

also, once started, the web sharing applet will appear in the system tray and allow to you make new shares / manage existing ones / start+stop sharing / monitor access to specific shares, etc.
posted by dorian at 7:50 PM on January 23, 2008


also you could consider something like sshfs, just have to make accounts for them and make sure the shared folders have proper group permissions etc.

(or the fish:// ioslave is totally an awesome thing. it is possibly one of the best features ever. but again not only is kde required, it would be needed on their side as well)
posted by dorian at 7:56 PM on January 23, 2008


Ok, I've gotten to the point where I'm able to host files with Apache, but it looks like it's not seeing folders that I drop in /var/www. That's got to be possible, right?

Also, thanks to everyone for the suggestions so far. The KDE solution sounds great, but I'm not going to switch my operating system just to do this. I can't believe there's not an application out there that will do all of this for me, so I guess I'm going to have to find an Apache tutorial and do some studying.
posted by spikeleemajortomdickandharryconnickjrmints at 8:40 PM on January 23, 2008


Ok, I've gotten to the point where I'm able to host files with Apache, but it looks like it's not seeing folders that I drop in /var/www. That's got to be possible, right?

Getting the apache test page?

then you want to comment out the directives in your welcome.conf file (well, on centos -- it's in /etc/httpd/conf.d/welcome.conf -- for you, maybe in /etc/apache2/...???/ -- don't have a debian/ubuntu flavor handy right now).

looks like this:

<LocationMatch "^/+$">
Options -Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>



no-ip.org is pretty good for free dynamic dns updates. They have a client for linux available to refresh your IP periodically. Real simple -- I've used them for about 2 years with no problems.

Make sure you've got an htpasswd on, as moift has suggested.
posted by fishfucker at 12:10 AM on January 24, 2008


Check permissions on the folders you dropped. Also be aware that with newer Ubuntu builds the apache conf files have been scattered to the winds. Mail file is now apache2.conf, remainder of the settings are going to be distributed amongst other .conf files in the /etc/apache2 directory. After running Apache builds on various operating systems over the last 8 years*, this confused the hell ut of me when I first encountered it.

*Implies only that I did it - which does not mean that I actually know what I'm doing. I may be a sysadmin, but I am not YOUR sysadmin, etc., etc.
posted by caution live frogs at 8:02 AM on January 24, 2008


Erg. s/Mail/Main, s/ut/out.

But you probably get the picture.

posted by caution live frogs at 8:03 AM on January 24, 2008


If you set up an FTP server, they could still get the files through most any browser with a url of the form ftp://yourdomain.com/files/x.txt.

If you're not going that route, then, for just serving files I'd be inclined to use a ightweight web server like thttpd (available in the Ubuntu repositories.) Simpler server = less to know, less to configure, less to go wrong. But Apache is so dominant that there's much more documentation and tutorials out there for it than for anything else, so I can't offer any guarantee that one of these would ultimately end up easier.
posted by Zed_Lopez at 9:55 AM on January 24, 2008


Zed Lopez, after I install thttpd (I tried that before I made this post)...where do I go to find it? I'm not sure where it's installing to in Ubuntu.
posted by spikeleemajortomdickandharryconnickjrmints at 1:52 PM on January 24, 2008


Ok, scratch that last comment of mine. I've got it installed, and it tells me it's running, but I'm not sure where I'm supposed to put the files I want to share. More digging......
posted by spikeleemajortomdickandharryconnickjrmints at 2:08 PM on January 24, 2008


In the general case in Ubuntu (and Debian and other Debian derivatives) look to /usr/share/doc/package-name for the package documentation. Sometimes it's very good, sometimes it's not. I recommend also installing the 'apt-file' package to be able to get a list of all the files included in a given package, which is sometimes the quickest and easiest way to find out what the darn executable's name is.

thttpd docs here.

The conf file is in /etc/thttpd/thttpd.conf. The root directory it defaults to is /var/www. The user it runs as is 'www-data', so make sure that user has read permission to that directory and the files under it.

I just installed it (in 7.04 -- Feisty), dropped an index.html in /var/www and everything just worked.
posted by Zed_Lopez at 3:17 PM on January 24, 2008


« Older Easiest pet fish?   |   Chemistry Peeps: Help my distillation please. Newer »
This thread is closed to new comments.