Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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
  • 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

577 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