virtual path mapping

Posted on 2003-03-10
Medium Priority
Last Modified: 2012-06-27
I have defined the following virtual path
Alias  /tmp/      /ieur/cre/eeceu11/online/www1/gecs/images/gets/          Alias /tmp/gets/   /ieur/cre/eeceu11/online/www1/gecs/images/gets/
Alias /tmp/ecr/  /ieur/cre/eeceu11/online/www1/gecs/images/ecr/          Alias /tmp/system/  /ieur/cre/eeceu11/online/www1/gecs/images/system/

Among the above four only first difinition is working fine other
three are not? When try to access some file using other three virtual path
(/tmp/gets/ or /tmp/ecr/  or /tmp/system/) apache usage the
first definition only(Alias  /tmp/ /ieur/cre/eeceu11/online/www1/gecs/images/gets/)

and in this situation it always try to search the file as follows
/tmp/ecr/  /ieur/cre/eeceu11/online/www1/gecs/images/gets/ecr          
/tmp/gets/  /ieur/cre/eeceu11/online/www1/gecs/images/gets/gets          
/tmp/system/  /ieur/cre/eeceu11/online/www1/gecs/images/gets/system
since ecr/system and gets are not a physical subdirectory in gets
therefore, it logs the error in the log file File does not exist
Would like to know why Apache server is not picking the longest path
as defined to retrive the correct file

I will be very greatful for any further information to resolve the virtual path mapping issues
Question by:gulench
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 8107006
Try reordering the definitions so that the
Alias /tmp
comes last

I'm not sure now and I can't check it for the next 10 hours, but try it anyway :)
LVL 22

Expert Comment

ID: 8107320
Your first line is:

Alias  /tmp/      /ieur/cre/eeceu11/online/www1/gecs/images/gets/

ie when someone tries to access /tmp/ they get:

Therefore when they try to access /tmp/gets/ it will access your aliases /tmp/ followed by gets ie:

Likewise for system etc....

The easiest way to get round this is to use the:

FollowSymLinks directive for the /tmp/ aliased directory, and creat symbolic links to the other sub directories that you wish to use.

Hope that helps:)
LVL 22

Expert Comment

ID: 8107326
..then the appropriate directories really do appear as subdirectories:)
LVL 27

Accepted Solution

BigRat earned 1500 total points
ID: 8110879
Another possibility is to use rewrite rules. The rules are executed (matched) in the order written and can be extremely explicit.

rewrite ^/tmp/gets/*$  /ieur/cre/eeceu11/online/www1/gecs/images/gets/$1 [L]
rewrite ^/tmp/*$ /ieur/cre/eeceu11/online/www1/gecs/images/gets/$1 [L]

The advantage is that you can also use the rules to exclude things and completely control the access to the site. (See module rewrite and the examples/tutorial on the Apache site)


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question