|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
>> 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? |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
>> <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 |
|
#5
|
|||
|
|||
|
I got it~ Thx
__________________
====================== Linux is Great ! Try ! |
|
#6
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Alias a directory and all its subdirectories - access problem on subdirectories |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|