Sharing Files using Apache 2 on Linux
April 28, 2009
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!
Popularity: 41% [?]
Posted in 

content rss

April 28th, 2009 at 3:55 pm
I haven’t worked on Apache servers for at least 5 years now!!! Damn!
April 28th, 2009 at 6:08 pm
Again, esti3abi only speaks one language;p
May 2nd, 2009 at 8:33 am
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
May 31st, 2009 at 9:54 am
Marzouq,
lol, they are helpful at times
Amethyst,
Yes, but this is english.. somehow.. =p
Used Tires,
It isn’t too hard to learn
June 6th, 2009 at 8:41 pm
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..
June 12th, 2009 at 7:51 am
Nice sharing! I haven’t much worked on Linux but I hope your tips will be helpful to linux user.
June 22nd, 2009 at 3:54 pm
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!!
July 19th, 2009 at 9:59 pm
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