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!

8 Responses to “Sharing Files using Apache 2 on Linux”

  1. Marzouq |

    I haven’t worked on Apache servers for at least 5 years now!!! Damn!

  2. Amethyst |

    Again, esti3abi only speaks one language;p

  3. Used Tires |

    That’s why I don’t use Linux… it looks so intimidation to me, hehehe. But… I am sure if I used Linux… I’d look like a genius lol.

    Till then,

    Jean

  4. N. |

    Marzouq,
    lol, they are helpful at times

    Amethyst,
    Yes, but this is english.. somehow.. =p

    Used Tires,
    It isn’t too hard to learn

  5. Glass cookware |

    I want to start using Linux as my primary operating system on my personal PC, as I feel this is a great first step to really force myself to learn it. I need to know what distribution would be best for me to use. My concern is some of them seem to have alot of propriatary tools that are not found in other linux distros..

  6. Andrew |

    Nice sharing! I haven’t much worked on Linux but I hope your tips will be helpful to linux user.

  7. Jessica Web Marketing |

    How do I install/configure these on ubuntu? I keep following the commands however I keep getting the error: C compiler cannot create executables
    any idea whats up?? Im new to linux so it might just be something REALLY simple!!

  8. Yousef |

    Glass cookware:
    You are right in that most Linux distros don’t come with the proprietary tools/codecs. This is due to licensing issues. I would recommend you try Linux Mint. It’s one of most user-friendly distros that I’ve seen, and it includes many proprietary codecs and stuff (see their FAQ if you want to know how they get around this).

    Jessica Web Marketing:
    You need to install the build-essentials package. Open a terminal window and type: sudo apt-get install build-essentials

Reserved, going to add something here later.