Microsoft IIS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationMicrosoft IIS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 5th, 2006, 09:43 AM
janetb janetb is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 11 janetb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 34 sec
Reputation Power: 0
IIS 6 Custom Errors

Okay, I'm losing it. Have three websites on a box running Server2003, IIS6. One public website has custom error messages working great. Decided to do similar for an Intranet site. Made the page, changed the custom error link in IIS6. Still shows the old, generic page. Looked back in IIS to be sure, and yep, shows custom page path. Looked at specific file (for a denied page), and it also shows custom page path. But, the page doesn't appear. In case it was a permissions deal, I moved the file to within the web but to an area where the user has permissions. Still get old generic error message. restarted services - same thing. restarted server - same thing....

Any ideas?

Reply With Quote
  #2  
Old September 5th, 2006, 10:05 PM
markoc's Avatar
markoc markoc is offline
Contributing User
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Nov 2003
Location: UK
Posts: 2,160 markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Weeks 20 h 31 m 46 sec
Reputation Power: 220
IIS 6 Custom Errors

have you put the url path of ur custom error pages from the root of ur web server, so instance if u have a folder in the root call server_errors then the path for say ur 404error.asp would be /server_errors/404error.asp and message type will be URL

this will work for .htm,.html, .asp ... BUT remember if ur using .aspx files and an error occurs it won't work u need to change the web.config file.

have alook at the following link:

http://www.xefteri.com/articles/show.cfm?id=11
__________________
Hope this advise helps.

If so please show your appreciation by adding reputation points (click gauge image on top right of this post and score).

Reply With Quote
  #3  
Old September 6th, 2006, 09:52 AM
janetb janetb is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 11 janetb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 34 sec
Reputation Power: 0
MarkOC,
Thanks for the reply. Great article! I think it's right on the money - I had been playing around and noticed that when I have a 401.3 to a non-.net subfolder, the correct error message shows, but it's only when the subfolder is an asp.net app that I get the problem. So, seems to be the application is not letting the error through - which is what the article states. (I'm slowly converting a site from asp to asp.net. The root and majority of the site is still asp, but I'm using subfolders to convert as I can to asp.net)

Still having problems...
I placed a basic aspx (before I get to the error capture in the article) page the in the root web's appropriate folder.

Added the custom error within webconfig - first used the full url and it didn't like it. (Understandable-should be virtual) Second, used /foldername/filename.aspx and it didn't like it. Third, used ../foldername/filename.aspx and it didn't like it. Fourth, moved the file to the apps folder, still didn't like it.

I've also edited the custom error setting in IIS6 at the application level to redirect to the aspx file. (With a 401.3 you can't use url - must use default or file.)

I'm still getting the error "Server Error in '/blog' Application.
Access is denied. blah blah Error message 401.3 blah blah"

Any ideas?

PS Really like the site you pointed me to. Some articles there I'm going to read next.

janet

Reply With Quote
  #4  
Old September 6th, 2006, 08:25 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
Access denied errors is almost always related to an incorrect permission setting on some file/folder somewhere. The web server user account needs proper permissions to read, write, etc.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #5  
Old September 15th, 2006, 01:37 PM
R.Hansen R.Hansen is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Location: Denver
Posts: 4 R.Hansen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 2 sec
Reputation Power: 0
IIS 6 Custom Errors

To All:

I have the same problem. I am trying to limit windows authentication with active directory and provide a custom 401.2 error page when a user is denied to the application.
The custom error page displays properly when garbage is entered in for the username or password. However, when entering in a proper "DOMAIN\username" and password that exists in AD but is set to be denied via web.config authentication, I get:

"Server Error in '/<application name>' Application.
Access is denied.
Description: An error occured...
Error message 401.2.: Unathorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials..."

I have checked permissions on the applications directory both within IIS6 and the NTFS permissions, etc.

Any other suggestion would be appreciative.

Thanks,
R.Hansen

Reply With Quote
  #6  
Old September 15th, 2006, 03:25 PM
markoc's Avatar
markoc markoc is offline
Contributing User
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Nov 2003
Location: UK
Posts: 2,160 markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Weeks 20 h 31 m 46 sec
Reputation Power: 220
IIS 6 Custom Errors

with IIS6 on win 2003 servers you have to set the permissions correctly or u'll have all sorts of issues.

I've jsut done a migration from IIS 5 to IIS 6 this week with AD auth.

the folder ur error pages are located, did you create the folder in the site pages folder or did you add a Vir Dir?

also have u disabled anonymous access?
have u enabled basic auth?
have u enabled inter win auth?

Reply With Quote
  #7  
Old September 15th, 2006, 04:28 PM
R.Hansen R.Hansen is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Location: Denver
Posts: 4 R.Hansen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 2 sec
Reputation Power: 0
IIS 6 Custom Errors

I added the custom error page to the apps site folder and configured the custom errors tab for 401;2 to point to the custom error page. Integrated Windows Authentication is the only authentication method I am using. All others are unchecked. This is also in an intranet environment. (IIS6 on Window Server 2003)

When the error page in my previous post shows up (instead of my custom error page), the entry in the web log is:
2006-09-15 19:51:54 W3SVC1 SQLSERVER1 172.16.0.25 GET /IncidentReview/Default.aspx - 80 - 172.16.10.58 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.0;+WOW64;+ SLCC1;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04320;+Inf oPath.1) sqlserver1 401 2 2148074254

And the entry in the system App log is:
Event
Date: 9/15/2006 Source: ASP.NET 2.0.50727.0
Time: 1:51:54 PM Category: Web Event
Type: Information Event ID: 1314
User: N/A
Computer: SQLSERVER1


Event code: 4007
Event message: URL authorization failed for the request.
Event time: 9/15/2006 1:51:54 PM
Event time (UTC): 9/15/2006 7:51:54 PM
Event ID: 2349de2f5a2d4092b28204562ae1455e
Event sequence: 7
Event occurrence: 6
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1/Root/IncidentReview-2-128028230424496154
Trust level: Full
Application Virtual Path: /IncidentReview
Application Path: D:\Inetpub\wwwroot\IncidentReview\
Machine name: SQLSERVER1

Process information:
Process ID: 1284
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Request information:
Request URL: http://sqlserver1/IncidentReview/Default.aspx
Request path: /IncidentReview/Default.aspx
User host address: 172.16.10.58
User: PATHWAYS\cosmotest
Is authenticated: True
Authentication Type: Negotiate
Thread account name: PATHWAYS\cosmotest

So, my only dilemma is that the wrong, non-customized error page shows up (a 401.2 error page with different text by the way than the 401-2.htm page found in %windir%\Help\iisHelp\common) when using a proper AD account and password that exists in AD, but when I enter a non-existent AD username or password, the custom error page I configured, displays just fine like I would expect. (The whole purpose is to restrict the web app to only those few that authenticate to a certain AD group and display a friendly error message to those who don't have access).

If I am overlooking anything or if you need more information please ask as I have been pounding my head against the wall for a good week now on this!

Thanks,
R.Hansen

Reply With Quote
  #8  
Old September 16th, 2006, 12:30 PM
markoc's Avatar
markoc markoc is offline
Contributing User
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Nov 2003
Location: UK
Posts: 2,160 markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Weeks 20 h 31 m 46 sec
Reputation Power: 220
IIS 6 Custom Errors

if ur using Integrated Windows Authentication have you give domain users read access in the folders secutriy?

Reply With Quote
  #9  
Old September 18th, 2006, 04:49 PM
R.Hansen R.Hansen is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Location: Denver
Posts: 4 R.Hansen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 2 sec
Reputation Power: 0
IIS 6 Custom Errors

Yes, I have Domain users as having read permissions on all affected folders. I have experimented with other permissions but have not found the solution yet.

Thanks,
R.Hansen

Reply With Quote
  #10  
Old September 19th, 2006, 10:16 AM
R.Hansen R.Hansen is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Location: Denver
Posts: 4 R.Hansen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 2 sec
Reputation Power: 0
IIS 6 Custom Errors

I found a solution on the thread: "Handling Custom Error 401.2" by a post by iSpeakGeek at
http://forums.aspfree.com/microsoft-iis-12/handling-custom-error-401-2t-21027.html

Thanks to iSpeakGeek for a solution to this non-intuitive scenario.

Quote:
Originally Posted by iSpeakGeek
You can replace the default 401.2 message that ASP.NET displays, although it isn't exactly an intuitive process. I spent a week or so trawling for solutions with no luck, but it turns out that the solution is remarkably simple. Add the following to your Global.asax file and replace the "~/errors/Unauthorized.aspx" with the path to your own .aspx error page:

PrivateSub Global_EndRequest(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMyBase.EndRequest
If Response.StatusCode = 401 AndAlso Request.IsAuthenticated = TrueThen
Response.ClearContent()
Server.Execute("~/errors/Unauthorized.aspx")
EndIf
EndSub


R.Hansen

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationMicrosoft IIS > IIS 6 Custom Errors


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT