Solved

Apache Alias and Directory

Posted on 2007-03-27
12
986 Views
Last Modified: 2013-12-24
Working with:
Fedora Core 3
Apache 2.0.52
BlueDragon JX 6.2.1 (CF MX)
I have created a alias in httpd.conf to /forum
Inside /form is subdirectory installation
When I go to the actual URL (where it really is) everything works the way it is supposed to.  That is when I browse into the installation directory, the Application.cfm file in /forum is referenced properly.  If I am on one of the other domains where /forum should be available, CF does not "find" Application.cfm.
I have used Alias and Directory and tried everything I could think of in the envelope
Alias /forum "/xxx/controlpanel/_modules/forum/"

<Directory /xxx/controlpanel/_modules/board >
    Options Indexes FollowSymLinks MultiViews ExecCGI Includes
    AllowOverride None
    Order allow,deny
    Allow from all
    AcceptPathInfo On
    Satisfy Any
</Directory>
0
Comment
Question by:Len45
  • 8
  • 4
12 Comments
 
LVL 39

Expert Comment

by:gdemaria
ID: 18803528

 try adding the folder as a mapping in the coldfusion administrator
0
 

Author Comment

by:Len45
ID: 18803611
Tried that, should have worked, but didn't
0
 

Author Comment

by:Len45
ID: 18803651
The way I understand it mapping works for cfinclude, cfmodule and cfs's ??
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 18803731

 yes it does.  To be honest, I am a little confused by the structure in your question.

 Can you identify your folder hierarchy.   Rereading it, it sounds like perhaps your application.cfm file isn't in a folder above your current folder, but in a sibling one...
0
 

Author Comment

by:Len45
ID: 18803881
/xxx/xxx/_modules/forum/installation/
Application.cfm is in forum
0
 

Author Comment

by:Len45
ID: 18803918
laid it out a bit differently in my original question, sorry to confuse.  But Application.cfm (LINUX need "A" not "a", but you know that) is in the directory "above" installation and is accessed when I go to the web space where it actually resides

so is I go to
http://mydomain.com/controlpanel/_modules/board/installation/index.cfm -- all is well with the world

I have used Alias and Directory in the httpd.conf to "map" /forum to that directory and if I go to another domain on my server

http://AnotherDomain.com/forum/installation/index.cfm -- it is not "seeing" Application.cfm which would now be in the forum directory.  
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:Len45
ID: 18809310
I am wondering if I have my <directory> set up right?  Anyone have suggestions?
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 18809593

Application.cfm is found by an upward search of physical folders, not related to the URL or mappings, right?  So if your template launched is in this hypothetical directory    /A/B/C/D/E/index.cfm  your application.cfm needs to be in A,B,C,D or E.  

So in this example,
http://AnotherDomain.com/forum/installation/index.cfm 
Directory:
xxx/controlpanel/_modules/forum/installation/

It seems like it would work if Application.cfm is located in your forum directory.


In this example, installation, is inside of board, not inside of forum, so I would think it would not find it..
http://mydomain.com/controlpanel/_modules/board/installation/index.cfm 
Directory:
/xxx/controlpanel/_modules/board/installation/


What if you place the Application.cfm inside of _modules ?  That seems to be shared by both?

Do you only have one Application.cfm file, or are you attempting to launch different ones depending on something.  If only one, place it in the web root ?

0
 

Author Comment

by:Len45
ID: 18810825
gdemaria -- thanks for sticking with me on this one, it is really weird

Base on the Alias that I have set up in the apache conf file /forum and /board are the same actual directory on the server, that what is so weird.

CF usually does not care about names... it just goes up the "tree" till it finds a Application.cfm file -- maybe names matter in a case like this?

When I am in installation and pull up index.cfm it is exactly the same file, if just does not reference Application.cfm in the parent directory when I am in forum -- this has got to be an apache deal with the Alias and Directory "requests"


0
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 18811052

That is weird, I would suspect that, regardless of any settings in apache, coldfusion would simply walk up the directory structure as you suggested.   That's why I'm not focusing on the apache settings, seems like it should just look at the directory structure.

Perhaps you can try creating a few little test Application.cfm files and place them in various locations to see what fires (if any).

Application.cfm
<cfoutput>I am Here: #getTemplatePath()#</cfoutput>
<cfabort> <!--- if you need to kill processing to see it ---->

Place a file like this in your _modules folder, board folder, installation folder and just play with it to see what is firing and what is not..

You may get an idea of what path the coldfusion is using to search for the Application.cfm file.

0
 

Author Comment

by:Len45
ID: 18811078
what is really weird is that if I do a <cfinclude template="../Application.cfm"> it works.  I will play a bit with your suggestion -- especially the getTemplatePath()

Thanks
0
 

Author Comment

by:Len45
ID: 18837567
gdemaria

Your code helped me track down a problem with how I had set up the Alias directive in the apache.conf file, did not have anything to do with CF (or in my case BlueDragon), thanks for the help... don't spend all those points in one place, eh?  :-)
0

Featured Post

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sendmail STARTTLS error 37 79
Linux Copy Command - All Files inc Directory 1 27
linux redhat 7.2 10 36
Setting up static IP - Ubuntu server 16.04 12 23
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now