LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-23-2009, 02:10 AM   #1
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: AV Linux MX Edition
Posts: 213

Rep: Reputation: 25
basic html question - download link to files on my webpage question


Hi,
I have a small LAMP server, used mostly for family and friends. The web pages are very basic (built with Kompozer). I have thumbnails that link to pictures and files.
But i can not find a way to make the full content of a directory downloadable, except by making html link to each of the files, one by one. This task would take too long, is there a way to do this automaticaly for all the files in a folder. I have a script that make a html list of the content of each of my var/www/html/my_stuff_directory, it would be nice if every line of that list would be clickable and point to the actual file.
Thank you in advance for your help.
 
Old 12-23-2009, 02:32 AM   #2
baltho
Member
 
Registered: Aug 2004
Location: Adelaide, South Australia
Distribution: Ubuntu (Natty)
Posts: 38

Rep: Reputation: 18
The short answer would be to use apache's mod-autoindex, which does just what you want - if there's not an index.<whatever> in a directory, it'll just produce a list of the files there.

If the module's not enabled, do "a2enmod autoindex" as root/sudo and restart your apache. You can also fine-tune it by allowing (or not) auto-indexing on specific folders in your web site.
 
Old 12-23-2009, 02:41 AM   #3
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: AV Linux MX Edition
Posts: 213

Original Poster
Rep: Reputation: 25
Thank you for the quick answer, first thing ill try when i get home.
 
Old 12-25-2009, 01:15 AM   #4
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: AV Linux MX Edition
Posts: 213

Original Poster
Rep: Reputation: 25
Hi, maybe you can help me again.
I have checked if the module is enable in the httpd.conf and it look ok
Code:
LoadModule autoindex_module modules/mod_autoindex.so
my problem is that i probably configure it wrong, see what i added to httpd.conf
Code:
<Directory "/var/www/html/stuff">
    Options -Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
I restarted the server and still no indexing is found in there.
If i create a index.html file in that repertory, it stays empty and if i don't create one, it is simply not being created.
 
Old 12-25-2009, 06:24 AM   #5
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
Try:

Code:
<Directory "/var/www/html/stuff">
    Options +Indexes +MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
Delete any index.htm or index.html file that you created. They will prevent Apache from generating the directory listing.

Then browse to the directory, like: http://mysite.com/stuff/
 
Old 12-25-2009, 07:24 AM   #6
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: AV Linux MX Edition
Posts: 213

Original Poster
Rep: Reputation: 25
The + and - signs, that was it thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux AVG, Several Download Files, Quick Question aaron4katie Linux - Software 5 12-23-2006 06:04 AM
How do I link to odt/docx files in a webpage? matthewhardwick Programming 5 12-09-2006 06:41 PM
basic question about searching files balteo Linux - Newbie 1 09-03-2005 07:38 PM
editing config files.. embarassingly basic question adhara Linux - Newbie 3 12-23-2003 07:27 AM
Ok Here a good question about download iso files maximalred Linux - Distributions 7 04-15-2003 12:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration