SunQuest
           Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old October 2nd, 2001, 05:36 AM
Alkis Alkis is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: Hellas
Posts: 46 Alkis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 46 m 35 sec
Reputation Power: 8
Question Alias a directory and all its subdirectories - access problem on subdirectories

I have put an alias in httpd.conf file, to access a read-only (777) directory of images.

But this directory have other subdirectories which may have other subdirectories.
the problem is that the access from the web is given only to the parent directory, but restricted to any other subdirectories in it.
I tried as much regular expression combitations on the alias, but none of them worked. May I missed something but I cannot get it work.

Any help? maybe I am giving wrong the expression, and if yes, even an example may prooved very helpfull to me.

Reply With Quote
  #2  
Old October 2nd, 2001, 01:48 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> even an example may prooved very helpfull to me

No. You post your lines here instead and we tell you what the problem was.

>> but restricted to any other subdirectories in it

What error message?

Reply With Quote
  #3  
Old October 3rd, 2001, 06:56 AM
Alkis Alkis is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: Hellas
Posts: 46 Alkis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 46 m 35 sec
Reputation Power: 8
Ok, here is my example

Ok, I see.

I have the directory /var/dbimg/ including some number of subdirectories which have other subdirectories in them. All directories are containing pictures in jpg format. I am using them for calling them inside my pages under their names in a mysql database (the names of the pictures are only in the db).

well the the pages are trying to get the images from those the permission is denied.
I've written the following in httpd.conf in order to allow access to all subdirectories and also their parent directory of course (I don't have problem with the access on the parent directory):


<Directory ~ "/var/dbimg/.*">
Options Indexes FollowSymLinks
</Directory>


what's wrong?

I am new to this directives, so have it in mind if there is something very silly I've done.

And the error message (eg trying to access the subdirectory "products" inside "dbimg"):

Forbidden
You don't have permission to access /dbimg/products/ on this server.

I am using redhat 7.1 with Apache 1.3.19

thank you for your attention

Reply With Quote
  #4  
Old October 3rd, 2001, 09:00 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> <Directory ~ "/var/dbimg/.*">

This is equivalent to <DirectoryMatch>. The options you set to a particular directory is the same recursively, unless it's overridden again. That said, you don't need to use <DirectoryMatch> in the first place. <Directory /var/dbimg/products> and <Directory /var/db/img/products/foo> have the same options.

Say you set an Alias like so:

Alias /dbimg/ "/var/dbimg/" # must have trailing slash on both

<Directory "/var/dbimg">
Options Indexes FollowSymLinks
</Directory>

Then you should be able to access your /var/dbimg/products/foo/bar.jpg at http://domain.com/dbimg/products/foo/bar.jpg

Say you change the Alias line to:

Alis /myimg/ "/var/dbimg/" and with the same <Directory "/var/dbimg">, the URL would then be http://domain.com/myimg/products/foo/bar.jpg

Reply With Quote
  #5  
Old October 3rd, 2001, 09:10 PM
jester jester is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Location: Hong Kong
Posts: 47 jester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 32 sec
Reputation Power: 9
Talking

I got it~ Thx
__________________
======================
Linux is Great ! Try !

Reply With Quote
  #6  
Old October 5th, 2001, 06:57 PM
Alkis Alkis is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: Hellas
Posts: 46 Alkis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 46 m 35 sec
Reputation Power: 8
Thanks a lot

Thanks a lot freebsd. It is working great now. I like configuring a server with just code. This ensures that the posibilities of problems or crashes are very small. If you make a mistake in the code, it will just won't work. If you write it right, it will work great! But never work the way you don't want to.

And it seems to me (at least the basic configuration) it's faster to configure a site, than other "great" application servers. And I think it's the most intelligent server all over the world.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Alias a directory and all its subdirectories - access problem on subdirectories


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway