Solved

Apache Alias and Directory

Posted on 2007-03-27
12
982 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
Comment Utility

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

Author Comment

by:Len45
Comment Utility
Tried that, should have worked, but didn't
0
 

Author Comment

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

Expert Comment

by:gdemaria
Comment Utility

 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
Comment Utility
/xxx/xxx/_modules/forum/installation/
Application.cfm is in forum
0
 

Author Comment

by:Len45
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

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

Expert Comment

by:gdemaria
Comment Utility

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
Comment Utility
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
Comment Utility

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
Comment Utility
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
Comment Utility
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

771 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

11 Experts available now in Live!

Get 1:1 Help Now