LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-06-2006, 04:49 PM   #1
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Rep: Reputation: 47
apache config, how can I only allow people to view images in a folder?


ok, why I need this is complex, so I will skip those details, but here is what I have and need:

I have a folder with a ton of subfolders, each has it's own subfolders, and in some of these subfolders are images.

to access these photos I would do:
Code:
Alias /papers/ "/stuff/http/papers/"

<Directory "/stuff/papers/GMA Papers">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
Problem is there are many types of files, and some must not be accessible through apache/ over the web.

how would I change the above to only allow images to be viewed? and remember, the images are in sub-folders, not sure if that makes a difference.
 
Old 08-06-2006, 05:07 PM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
If you want to learn about apache configuration, I'm not going to be of much use. As you haven't told us *why* you need what you need, my suggestions might be of little value to you, so please describe what you need in more detail and why. We can always ignore present information, but we can't use absent information.

Anyways, here are a couple of suggestions:

1) chmod o-r all non-images.

2) make a directory tree with the same structure (directories only); then put symlinks in it where the images are, leaving out the rest. Publish this directory instead of the actual one.

If you're keen on bragging about your directory entries, you could add symlinks for non-images, all pointing to a text file saying "sorry, only images are viewable". Or, better yet, to a "broken" file such that apache doesn't return '200 OK' to the client (broken could either be non-existing or non-readable, test that on your own).
 
Old 08-06-2006, 05:33 PM   #3
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Original Poster
Rep: Reputation: 47
I did similar to your #2 already and forgot to come post I do not need an answer anymore.
 
  


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
Is it possible to view images with mplayer? Linux_Lite Linux - Software 2 11-22-2005 04:12 AM
Can't view dowloaded images... HELP! dark_prancer Linux - Newbie 3 05-07-2005 04:23 AM
is there a way to view images without X? pyenos Linux - Software 2 03-09-2005 07:19 AM
view images in Linux HULLU Linux - Software 5 03-23-2004 08:28 PM
Want to keep people from linking images. BrianG Linux - Networking 0 01-09-2002 03:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:48 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
Open Source Consulting | Domain Registration