Cf7 / jrun / apache2 - 404 error handling
Hello,
As I understand it with a CF7 / jrun / Apache setup, when a
404 occurs Apache sets a 404 code in the header and passes the 404
off to ColdFusion for handling. I would like to leverage the power
of Apache's mod_rewrite module for 404 errors btu am running into
some troubles. I have not been able to find a way to stop Apache
from passing 404 errors off to ColdFusion and so far, my
mod_rewrite rules in a virtualhost block are being skipped over
when a 404 occurs.
Perhaps this is not a ColdFusion question but a jrun or
Apache one. If anyone's reading this and has a similar server setup
and uses Apache for 404 handling of cfm files, please share how
you're doing it. Or if anyone knows of a better place to post this,
I'm all ears.
Thanks everyone!
-Matt MacDougall
Try doing the settings in the Administrator once again. You never know.
On the page Debug Output Settings, tick the checkbox Enable Robust Exception Information. Press the button to Submit Changes.
On the page Debugging IP Addresses, verify that your IP (for example, 127.0.0.1) has been added. If not, add it.
Similar Messages
-
Strange 404 error handling on Apache web server
My group recently pulled out of hosting, and now we're on a
Solaris server running Apache 1.3.29 (A bit behind the times, but
I've got no control there): (Server Version: Apache/1.3.29 (Unix)
JRun/4.0 mod_ssl/2.8.16 OpenSSL/0.9.7c). They quickly threw the
server together, and something's wrong with the 404 error handling.
Here are the symptoms:
- When the request is for a .cfm file, and that file doesn't
exist, the user is redirected to the 404 error page where all
request information is lost. By redirected, I mean
http://servername/test.cfm
goes to
http://servername/404.cfm.
When looking for the request information, it's as if the user had
browsed directly to 404.cfm and not test.cfm.
- When the request is for anything else that does not have
.cfm, say,
http://servername/blah/ (even if
it pulls a .cfm as the default file), instead of being
"redirected", the contents of the 404 error page are pulled up.
Now, all the request information is pulled up, although in custom
cgi variables like cgi.redirect_url and cgi.redirect_query_string,
but at least the values are there.
I realize it's hard to diagnose this problem without more
specifics on how the server was set up, but the only access I have
is WebDAV to the web root, and pretty much all collaboration
between our groups has been cut off so I won't be able to provide
any more information that the symptoms. Has anyone had a similar
problem? If so, could you provide some details?
Thanks for your time in reading this.
On a side note, taking a little poll, who uses a single
powerhouse server that costs tens of thousands of dollars, and who
uses cheaper, redundant hardware with load balancing?i checked and found there r no files like that.does these files really prsent?
%forms60java%/oracle/ewt/alert/resource/
AlertBundle_en_US.class
AlertBundle_en.class
also i m getting file not exists for Default.dat in registry directory of forms60.
null -
I removed .exe from the block list, checked MIME types, all ok,
I followed this solution: http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/b380a13e-a15f-4e32-98cd-12747538ad20?prof=required
( go into IIS (I am assuming IIS 7.0) and select the particular web site and click
handler mappings and Edit feature permissions and
uncheck the Execute box .)
It works, I can now open exe files. But it causes other major troubles so far:
-Cannot Export Lists to Excel
-Cannot Publish and Save InfoPath forms
-Cannot edit subsites in SharePoint Designer.
Does anybody have another solution that won't disable other features? What is the best way to do it? I have SolidWorks Edrawings in .exe that needs to be accessible.
Thank you.
Guillaume Gagnon, MCP Senior System Administrator Forensic Technology WAI Inc.Hi Guillaume,
As you know, if we remove the Execute permission for handle mappings, we will be able to download .exe file from SharePoint server. But as you said, this will cause other issues.
The another solution to allow to download .exe file is remove the CGI-exe handle mapping from the handle mappings directly. You may need to restart Internet Information Server(IIS). After that, we will be able to download .exe file directly.
Open the IIS manager
Select the site from the "Sites" tree
Double-click "Handle Mappings"
Right-click "CGI-exe", and then click "Remove"
Thanks,
Jin Chen
Jin Chen - MSFT -
Handling 404 errors and web robots
I'm using CFMX 6.1.
We handle our own errors for page not found (404 errors). But
I'm finding that web spiders/robots from search engines such as
Yahoo or Google seem to index these "page not found" custom pages.
I want them to get the message that the page isn't found and DON'T
index it, while displaying our custom error page to the human web
visitors that encounter the same URL.
How do you do this?Google "robots.txt" for information on how to tell web bots
what pages
should and shouldn't be indexed.
Bryan Ashcraft (remove brain to reply)
Web Application Developer
Wright Medical Technology, Inc.
Macromedia Certified Dreamweaver Developer
Adobe Community Expert (DW) ::
http://www.adobe.com/communities/experts/
"Tea man" <[email protected]> wrote in
message
news:ee7j8m$ftu$[email protected]..
> I'm using CFMX 6.1.
> We handle our own errors for page not found (404
errors). But I'm finding
> that
> web spiders/robots from search engines such as Yahoo or
Google seem to
> index
> these "page not found" custom pages. I want them to get
the message that
> the
> page isn't found and DON'T index it, while displaying
our custom error
> page to
> the human web visitors that encounter the same URL.
>
> How do you do this?
> -
Hey, all,
I was wondering what others on the list tend to do to create
a site-wide 404 handler (I am working on IIS servers but am equally
interested in approaches for Apache or other servers) for CFM
pages.
I've tried a few things here and there within the onError
method of Application.cfc and Application.cfm bits but am just
curious how others approach this.
Thanks!
CraigNot sure on Apache, but on IIS you can set up a custom error
page for a 404 error. This custom error page can be any file
(including .cfm) that is accessible from the root of the site. So,
if you go into iis and set a custom error for 404, you can point it
to something like /404Handler.cfm, then create the 404Handler.cfm
template in the root of your website. Inside this file you can do
what ever you like, including redirecting to the home page. One of
the nice features of how iis handles 404 errors is that the URL of
the page that was requested will be stored in the CGI.query_string.
For example, if a user types in
http://www.yoursite.com/foobar.html
and /foobar.html does not exist, the user will be forwarded to
/404Handler.cfm and CGI.query_string will be 404;/foobar.html.
This is a very easy way to handle friendly URLs as well. for
example let's say you have a user table that has a username and
useid field. Now let's also say you have a profile.cfm themplate
that takes in the URL variable called userid, and then looks up the
user and displays the user's profile. Using the method above, you
can create a friendly URL like
http://www.yoursite.com/users/username,
however you do not create a users directory. If a user types in
this URL he/she would normally get a 404 error, but since you
redirected to the 404Handler.cfm, you can get the URL by saying
<cfset target=ListLast(cgi.query_string,";")>, then check to
see if target url contains /users (<cfif target contains
"/users">). If it does, you can get the username by saying
<cfset username=ListLast(target,"/")>. Once you have the
username you can then query the database to figure out what the
userid is and then redirect to profile.cfm. It seems a little
convoluted, but it works. -
Handling 404 error through web.xml
In my application i made the following entry in web.xml:
<error-page>
<error-code>404</error-code>
<location>/error.jspx</location>
</error-page>
error.jspx is a jspx file and exist in the public_html folder and has following entry:
<f:view>
<af:document id="d1">
<af:form id="f1">
<af:outputText value="Hello There error occured" id="ot_11" />
</af:form>
</af:document>
</f:view>
when a 404 occurs in the application, i am getting following application in the log:
<[ServletContext@3806419[app:j2ee-app module:retailer path:/retailer spec-version:2.5]] error-page location: "/error.jspx" for the error-code: "404" does not exist. Serving the default error page.>
Any suggestion what to do next?on more thing,
404 errors are handled by web.xml using following:
<error-page>
<error-code>404</error-code>
<location>/login/404errorPage404.html</location>
</error-page>
but in case of 500 errors or nullpointers i treid a no of options, but neither one worked:
<error-page>
<error-code>500</error-code>
<location>/login/500errorPage500.html</location>
</error-page>
<error-page>
<exception-type>javax.el.ELException</exception-type>
<location>/login/500errorPage500.html</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/login/500errorPage500.html</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/login/500errorPage500.html</location>
</error-page>
Any advise? -
Error Handling 500 & 404 Errors
Hello,
I am using,
Studio Edition Version 11.1.1.2.0
Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
I am trying to implement the 500 and 404 error handlers in web.xml. Did mentioned the default error pages for these errors,
<error-page>
<error-code>500</error-code>
<location>/faces/unexceptedErrorHandler.jspx</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/faces/unexceptedErrorHandler.jspx</location>
</error-page>
But when 500 or 404 error occures,browser shows its default page not the one which I mentioned. In log I see
Error-page location: "/faces/unexceptedErrorHandler.jspx" for the error-code: "500" causes an infinite loop condition as it throws the same code for which it has been mapped.>
Any idea why?
Thanks
RBRB,
That's a pretty obvious one.. your error page throws HTTP 500, causing a loop (error, go to error page, throws error, go to error page, etc). Try looking in the server logs to see the root cause of the error. Alternatively, use a plain HTML page as your error page to test and see what's happening.
John -
I have a php script that when I hit submit, it submits the form to another php file with a get command. This worked about a month ago, but this month it's having issues. This is what the relevant code looks like in the table php file. Running
table.php shows the table in the browser and has 404 errors when I hit submit.
table.php:
<body>
<h1> Visual Evaluation Entry Table </h1>
<form method="get" action="visEupload.php">
<table id="bigTable" border="1">
<thead>
<tr>
<!--<th id="bandY" class="col3">Bands @263mm Y</th><th id="bandM" class="col3">Bands @263mm M</th><th id="bandC" class="col3">Bands
@263mm C</th><th id="bandK" class="col3">Bands @263mm K</th><th id="Comments" class="col3">Comments</th>-->
<th id="bandY" class="col3">Bands @263mm Y</th><th id="bandM" class="col3">Bands @263mm M</th><th id="bandC" class="col3">Bands
@263mm C</th><th id="bandK" class="col3">Bands @263mm K</th><th id="Comments" class="col3">Comments</th>
</tr>
</thead>
<tbody>
<tr name="MCBands" id="9214">
<!--<td><input name="Yevaluation" ></td> //Row 0 Column 1-->
<!--<td><input name="Mevaluation" ></td> //Row 0 Column 2-->
<!--<td><input name="Cevaluation" ></td> //Row 0 Column 3-->
<!--<td><input name="Kevaluation" ></td> //Row 0 Column 4-->
<!--<td><input name="comment" ></td> //Row 0 Column 4-->
<td><input name="bandY" ></td> <!--//Row 0 Column 1-->
<td><input name="bandM" ></td> <!-- //Row 0 Column 2-->
<td><input name="bandC" ></td> <!-- //Row 0 Column 3-->
<td><input name="bandK" ></td><!-- //Row 0 Column 4-->
<td><input name="comment" ></td>
</tr>
</tbody>
</table>
<input id="submit" type="submit" class="list" name="submit" value="Submit To Database" >
<!--maybe move all php part to other file-->
</form>
</body>
The server is mapped so when we run it off of the server, we use the server ip address and my file name and skip the rest of the path, which works fine with the table.php file, so that mapping appears correct. When I run it off of the server (from my
desk) and hit submit it gives me a 404 file or directory not found. When I run it locally on the server, it's saying it can't find the file name, but it says the requested url is `http://localhost:80/errorpages/403_error.html.` Physical path: E:\vise\jqproject\web\errorpages\403_error.html.
The error message says the notification is from the MapRequestHandler of Module IIS Web Core. I'm not sure why the requested url/path isn't referring to visEupload.php.
(Running on the server) When I change the action in the table.php get to include the IP address, it's behaving weirdly:
Module IIS Web Core Notification MapRequestHandler Handler PHP53_via_FastCGI, Requested URL `
http://localhost:80/13.141.xxx.xx/visEupload.php?bandy=xx&bandM=xx&bandc=hj&bandk=xx&comment=xx&submit=submit+to+database
physical path shows as E:\visE\jqproject\web\13.141.xxx.xx\visEupload.php
Login Method and user Anonymous.
When I change the url to just be
localhost/viseUpload.php
it's getting HTTP Error 404 not found. Any ideas why it's not finding the visEupload.php file? It has the correct .php extension. In file properties it's a type php file with name visEupload.php.
I took a look at
[404 error][1] but I see my "allowUnlisted="true" in applicationHost.config. I'm not using sitefinity, though.
I'm not sure if something got over-written when we did a server windows update.
I know we were having a problem with get and post a couple months ago and we had to add them to the IIS Manager Handler Mappings somewhere, but don't remember where we added them to check. Since I tried directly accessing the visEupload.php without any
get (and commented out get code in the file) it should have worked if that was the issue.
We are running server 2008 R2 and I'm not sure which version of IIS it is.
In case it matters, this is the contents of the visEupload.php:
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="utf-8" />
<title>Big Table</title>
</head>
<body>
<?php
require_once( "../classes/class.OLAPdatabase.php");
require_once( "../common/Session.php");
$OLAPdb = new OLAPdatabase;
handling of the get part is commented out
?>
</body>
All I can think of is that when I access visEupload.php it's running from the get/action in table.php. This might be a different user running in the system. I tried changing visEupload.php file properties to have full control for IUSR and Internet
Guest Account. It already has full control for System, and me. Users have read & exeture and read permissions. Or maybe it's something that has to do with how the directory is mapped out. I'm not sure what could be affecting this, and
why the message said it can't find the path to 403_error.html.
[1]: http://www.sitefinity.com/developer-network/forums/bugs-issues-/server-error-404---file-or-directory-not-found
Michele ClearyHello,
for IIS question better ask in http://forums.iis.net/
Best regards
Meinolf Weber
MVP, MCP, MCTS
Microsoft MVP - Directory Services
My Blog: http://msmvps.com/blogs/mweber/
Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights. -
How can I throw a hard 404 error to apache when a JSP is not found.
How can I throw a hard 404 error to apache when a JSP is not found.
I want to let apache handle the error.[email protected] (Jeremy Conner) wrote in
<[email protected]>:
>How can I throw a hard 404 error to apache when a JSP is not found.
>I want to let apache handle the error.
>
>
First thought that comes to mind is to return HTML that tells the browser
redirect to a nonexistent file under Apache. You can't tell Apache to
throw a 404 unless you're in a mod. Maybe something they could add to the
proxy, but until then, I think a redirection in the response HTML is your
only option.
Jesse
-
404 Error Message while running a servlet
Unable to run Snoop Servlet in JRUN 2.3.3 running on IIS4.0. I give the url
as http://websitename/servlet/SnoopServlet . But I get HTTP error 404 error.
I am trying to run the snoop servlet in the jrun/jsm-default/servlet directory. But, I am not able to run the servlets that are in the Servlet directory. It says '404 - Page Not Found Error'. Can anyone help me out what should I change to run the servlet when I type http//websitename/servlet/snoopservlet. Where 'snoopservlet' is the servlet in the servlets directory.I have been using JRun 3.1 and the default servlets directory is:
servers\default\default-app\web-inf\classes
Try to put your servlets in this folder. -
No SICF can be addressed, 404 errors
Within our Solution Manager non of the SICF services are accessible any more.
In the browser or in DSWP we all get 404 errors.
I retried to publsih the service in SE80 and this didn't help.
When starting in any service we get the following error:
Service Cannot Be Accessed !+
+Message no. SHTTP009+
+Diagnosis+
+You have not entered a handler, and the other services in the URL also do not have a handler. This means the service cannot be accessed by HTTP request.+
+Procedure+
+Check whether this is intentional, and if necessary, enter a handler.
In the ICM logfile we get the errors for icman which of course can also not be reached.
Has anyone an idea about how I can fix this?
Thanks.Hi,
Were you able to resolve this error? -
Error Handling in Jdeveloper?
I set a servlet as the ErrorHandler for the Application by modifying the web.xml file with th following code:
<error-page>
<error_code>404</error_code>
<location>/Srv_ErrorHandler</location>
</error-page>
and it worked.
then I deleted all the code and every thing related to that in other servlets, and set a jsp file as my Error Handler, using isErrorPage="true" in <%@page %>
and other proper changes, but it didn,t worked.
every time the error arises the server goes after the former servlet as the ErrorHandler (the path of the servlet appear in the addree bar?).
It seems that some changes have been applied on some variables in the application scope that won't be removed automatically?
Thank you for you answer my friend.
Best Regards,
PourangAre you making sure to point the pages to your error page?
-
In the process of setting up a new server, we're trying to keep from having
to copy over 6+ year old stale files to the new machine.
I've been given the go ahead, provided that I can redirect 404 errors to the
old machine, and then after a while, we'll just kill the old machine.
Unfortunately, I've run into a bit of a headache --
It seems that iPlanet 4.1SP7 won't let me re-write the 'Status' line in an
error handler. I know this was possible under Netscape 3.0k, (and
yesterday, after putting in a ticket with tech support, I verified that I
wasn't crazy) :
andrew% telnet [old_server] 80
Trying 128.164.127.251...
Connected to [old_server].
Escape character is '^]'.
HEAD /~oneiros/blah HTTP/1.0
HTTP/1.1 302
Server: Netscape-Enterprise/3.0K
Date: Thu, 12 Jul 2001 19:17:24 GMT
Location: http://[dummy_server]/~oneiros/blah
Content-type: text/html
Connection: close
Connection closed by foreign host.
andrew% telnet [test_server] 80
Trying 128.164.142.47...
Connected to [test_server].
Escape character is '^]'.
HEAD /~oneiros/blah HTTP/1.0
HTTP/1.1 404 Not found
Server: Netscape-Enterprise/4.1
Date: Thu, 12 Jul 2001 19:16:23 GMT
Location: http://[old_server]/~oneiros/blah
Content-type: text/html
Content-length: 5496
Connection: close
The two error handlers are identical, except for the machine they redirect
to.
After getting the call back from tech support, I really don't think the
person I spoke to understood what I was trying to do. [and well, I didn't
have the working example to show him].
Although I could do this using meta tags for redirection, that's not going
to work for images, and we have too many users who have used absolute URLS.
Does anyone out there know if there's some sort of work around for this
problem? (iWS 6 may be an alternative if absolutely necessary, but we're
reluctant to switch to a recently released version due to some history with
other applications).
Joe Hourcle
Networking and Information Technology
The George Washington UniversityJoe Hourcle wrote:
It seems that iPlanet 4.1SP7 won't let me re-write the 'Status' line in an
error handler. I know this was possible under Netscape 3.0k, (and
yesterday, after putting in a ticket with tech support, I verified that I
wasn't crazy) :Want to paste your code?
HTTP/1.1 404 Not found
Server: Netscape-Enterprise/4.1
Date: Thu, 12 Jul 2001 19:16:23 GMT
Location: http://[old_server]/~oneiros/blah
Content-type: text/html
Content-length: 5496
Connection: closeWhat's the content of size 5496 that's getting returned? -
Error Handler (File not Found) missing .cfm
Hi,
I have multiple applications on my server. For each
application I would like an error handler that will catch missing
.cfm files. If a user types in www.abc.com/test.cfm, and test.cfm
does not exist, each site will use its own "errorHandler.cfm" file
for example.
I already can handle .htm and .html files in IIS, basically
when the 404 error happens, it calls my html error handler. I also
tried checking the option in IIS where you see a list of file
extensions, you go to .cfm (this is all in IIS), and there is a
checkbox that says "check if file exists", so I have checked and
unchecked this, but not luck.
In CFAdmin there is an area where you can specify a missing
template handler. This seems to apply to the whole server. Each of
our application are very different, I would like to have an
individual error handler in each application.
I am getting a CF error, (File not Found) not an IIS error
when you type a file in the url string as mentioned above. I tried
using <cferror> in my Application.cfm file, but to no avail.
I tried using try/catch to no avail. I have heard of others having
this frustration as well.
Help is greatly appreciated
-WestsideI've not tried this, but consider having the server-wide
error handler look at the CGI.HTTP_REFERER variable to see what
application threw the error. Then do a <CFLOCATION> to the
application-specific error handler. -
I'm having a strange one. I'm using CF 9.0, and I have a Site-wide Error Handler set up, with the relative path set correctly.When run-time errors occur, it is calling the template exactly as expected, except for one thing.
In addition to the error template (which shows a nice user-friendly page), I am also getting the default ColdFusion error information following.
So...error occurs, it is throwing to the error template as expected, but then also pushing out the default error page.
It does not do this on CF7 with identical code, so I am thinking that perhaps there is a setting on CF9 Administator that I'm not clicking. But search as I might, I only see the Site-wide Error Handler field.
Any suggestions? This is driving me batty.ianskinner wrote:
What do you get if you turn on "Robust Exception Information"?
You are presuming that since your test error is a DSN error and this extra message is about a DSN error, that they are the same error. That is an unproven correlation. Or at least you have not show us the proof.
Robust Exception Information is enabled on the Cold Fusion Administrator. I don't know why it wasn't showing earlier, but now when I run the test page I get the following:
The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.
The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
Datasource doesNotExist could not be found.
The error occurred in \\srv238\wwwroot\rjr\errorhandling\cferror_test.cfm: line 11
9 : This query calls a non-existent datasource, triggering an error to be handled. --->
10 :
11 : <cfquery name="testQuery" datasource="doesNotExist">
12 : select * from nothing
13 : </cfquery>
DATASOURCE
doesNotExist
Resources: Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.3; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC EA 2)
Remote Address
172.21.10.142
Referrer
Date/Time
30-Dec-09 01:21 PM
Stack Trace (click to expand)
Maybe you are looking for
-
Dynamic Creation and Plotting in CNiGraph
Hi, I would like to create a temporary CNiGraph object, plot some data, and render it to an image. I am able to create the object dynamically (I think) but I get a runtime error when trying to plot data (using ChartY) on the graph. The error is in t
-
Error installing DPM Agent in Update Rollup 5 for System Center 2012 R2 Data Protection Manager
I have updated my main DPM server to Update Rollup 5 for System Center 2012 R2 Data Protection Manager and all went well. All Protected servers updated and rebooted and continued protection - EXCEPT one; Physical Windows Server 2012 R2 Datacenter. Tr
-
Hey guys, so I basically fixed my slow MacBook Pro about 2 weeks ago and it worked fine, but as of a about a week ago its just back to being just as bad as it was before and I can't seem to find any solutions. I'm using a MacBook Pro 4GB DDR and 2.53
-
Display external html page in (Collapsible Panel widget)
i everybody is there a way to display external html page in (Collapsible Panel widget) All the example a seen is with raw text in it is the panel can display different object instead of simple text At least a internal designed html page Thanks
-
Hello! I am running into a curious situation with Reports and I have been unsuccessful in trying to resolve it. Here is the description. I have a group (Job Category) that has a subgroup (Gender) which has a subgroup (Salary Range). I am running the