Life is a series of choices. Every step is a choice, an option, a decision. We try our best to make these choices based on what we know. What we pick may not be based on what is right and what is wrong, but what we believe in our minds and hearts. Whatever we do decide, we have to compromise. It is always one or the other.

www.flickr.com
This is a Flickr badge showing public photos and videos from ntheother. Make your own badge here.

The Glider

The glider: an Appropriate Hacker Emblem

Categories

Banner

Power Content

N.

Sharing Files using Apache 2 on Linux

Sometimes on my Ubuntu box I want to share files with either my other machines, or with other people to give them quick access to download whatever they want from my machine. Instead of using ftp, rsync, or scp or a network drive even, I like to use Apache to set up a quick web directory.

This configuration has only been tested with my current Apache 2.2.8 version, so give it a go, and it could work with your version.

Just to note, most of these commands need root access so use sudo or su if you get an access denied message.

What you need to do is go to the Apache configuration files in the sites enabled folder:

$ cd /etc/apache2/sites-enabled/

Use nano or vi to create a new file, call it myshare or whatever you like:

$ nano myshare

Then add the following configuration and replace the _WEBDIR, _USER, _SHARED with the information from your machine.

Alias /_WEBDIR "/home/_USER/_SHARED/"
<Directory "/home/_USER/_SHARED/">
          Order allow,deny
          Options Indexes
          Allow from 127.0.0.1
          Allow from All
</Directory>

Save the file and enable the configuration using the a2ensite command:

$ a2ensite myshare

Then restart apache:

$ apache2ctl restart

And there you have it!

Reserved, going to add something here later.