LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 03:10 AM   #1
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: Mandriva 2010.2
Posts: 148

Rep: Reputation: 24
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, 03: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, 03:41 AM   #3
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: Mandriva 2010.2
Posts: 148

Original Poster
Rep: Reputation: 24
Thank you for the quick answer, first thing ill try when i get home.
 
Old 12-25-2009, 02:15 AM   #4
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: Mandriva 2010.2
Posts: 148

Original Poster
Rep: Reputation: 24
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, 07: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, 08:24 AM   #6
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: Mandriva 2010.2
Posts: 148

Original Poster
Rep: Reputation: 24
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 07:04 AM
How do I link to odt/docx files in a webpage? matthewhardwick Programming 5 12-09-2006 07:41 PM
basic question about searching files balteo Linux - Newbie 1 09-03-2005 08:38 PM
editing config files.. embarassingly basic question adhara Linux - Newbie 3 12-23-2003 08:27 AM
Ok Here a good question about download iso files maximalred Linux - Distributions 7 04-15-2003 01:28 PM


All times are GMT -5. The time now is 02:23 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration