Jump to content

Access to the path 'c:\inetpub\wwwroot\hap\app_data\hapconfig.xml' is denied in 7


Recommended Posts

Posted

Hi,

 

I followed every step of the installation notes for IIS6, and I get this error message.

At the moment the App_Data folder has the following permissions:

 

Adminstrators: full control

IIS_WPG: read + write

Internet guest account: Deny write

System: Full control

Network services: Read + write

Users: read & excute

 

Also I can see that there is no file called hapconfig.xml in app_data.

The zip file downloaded from the web doesn't contain this file at all.

 

Regards

 

 

Server Error in '/hap' Application.

--------------------------------------------------------------------------------

 

Access to the path 'c:\inetpub\wwwroot\hap\app_data\hapconfig.xml' is denied.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

 

Exception Details: System.UnauthorizedAccessException: Access to the path 'c:\inetpub\wwwroot\hap\app_data\hapconfig.xml' is denied.

 

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

 

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

 

Source Error:

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

 

Stack Trace:

 

 

[unauthorizedAccessException: Access to the path 'c:\inetpub\wwwroot\hap\app_data\hapconfig.xml' is denied.]

System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +12895975

System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +2481

System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +229

System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +107

System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) +155

System.IO.StreamWriter..ctor(String path, Boolean append) +130

System.IO.File.CreateText(String path) +47

HAP.Web.Configuration.hapConfig..ctor() +148

HAP.Web.Configuration.hapConfig.get_Current() +136

HAP.Web.Setup.Page_Load(Object sender, EventArgs e) +90

System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25

System.Web.UI.Control.LoadRecursive() +71

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

 

 

 

 

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

Posted

Hello Nick,

I now gave full control to network services on app_data folder, I still get the same error message:

Access to the path 'c:\inetpub\wwwroot\hap\app_data\hapconfig.xml' is denied

There is no such file called hapconfig.xml in this folder, and it is not in the zip file for hap+ 7.2.

The documentation says:

Right click HAP and select properties

24. Deselect readonly and click ok. Allow it to reset every readonly attribute

25. Add the permission:

a. IIS_WPG and Network Service. Set them to Read & Execute permissions

b. App_Data Folder: Set to Read & Write

 

So I asume that the hap folder needs read & execute for both these users,and the app_data folder inside needs read+write for these two users.

I have now changed it to Network services: full control for the app_data folder and still gets the same error.

 

Many thanks

Posted

Hi,

It is IIS6, the identity is Network Service; re doing the remove read only didn't make any change.

Is the fact that a file called hapconfig.xml doesn't exisit in app_data folder can cause the error?

 

Thanks

Posted

Hi, I tried now giving both the IIS_WPG, and Network Services account full control to both the HAP folder and the app_data folder, but still get the same problem.

 

Also could you please tell me if this setting is correct on IIS 6:

hap.JPG

 

I set to use anonymous access and no athentication following the installation manual, I remember that in version 6 it was the other way around.

Is that way it get the permission error?

 

Regards

Posted

Hi Nick,

I can't change it to network service, just won't let me, please see screen shot.

hap1.JPG

I tried to do everything from the start following each step very carefully from your guide.

It is still the same error message.

 

Please help

 

Thanks

Posted

Hi Nick, I also have been trying to get HAP up and running. Am currently stuck when trying to set up with:

 

Access to the path 'C:\inetpub\wwwroot\HAP\app_data\hapconfig.xml' is denied.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

 

Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\HAP\app_data\hapconfig.xml' is denied.

 

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

 

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

 

Source Error:

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

 

Stack Trace:

 

[unauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\HAP\app_data\hapconfig.xml' is denied.]

System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +9718494

System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +1142

System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +82

System.IO.StreamWriter.CreateFile(String path, Boolean append) +55

System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) +121

System.IO.StreamWriter..ctor(String path, Boolean append) +33

System.IO.File.CreateText(String path) +37

HAP.Web.Configuration.hapConfig..ctor() +40

HAP.Web.Configuration.hapConfig.get_Current() +185

HAP.Web.Login.OnPreInit(EventArgs e) +19

System.Web.UI.Page.PerformPreInit() +31

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1073

 

 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

 

The only bit in your release notes I could not get to work is Add the permission ISS AppPool\HAP as I could not find that user, not sure if that may be causing this issue.

 

Windows Server 2008 - SP2 *64

Posted
IIS AppPool\HAP is only for IIS 7. You need to follow the instructions to get it to get the user. More instructions can be found on this forum if you search for it (can't remember off the top of my head). You won't find the user by searching for it, but if you follow the instructions on the documentation it will add the user
Posted
Update: Have a check with some server settings, and noticed that within the app pool, asp.net 4.0 is now showing. Changed HAP to use that, refreshed and setup page displayed. Changed HAP back to use HAP app pool and setup page continues to load - so that error has now gone :)
Posted

Hello Nick,

 

Any advice on what can I do? I still get the access deny, can't change the user from Iuser_server1 to network services just won't let me, please see screenshot in previous post.

As I said, I follow the instruction very carefully. I also delete everything and started from scratch following each step, but still get the same error.

 

Many thanks

Posted
My bad, sorry about that, yes leave that as IUSR_WO49996801. Then add permission to that user to the app_data folder. Sorry haven't used IIS6 in a while
Posted

Hi Nick,

I now changed the securtiy setting for the IUSER_SERVERNAME account from Deny to Modify on the app_data folder, and from Deny to Read & excute on the HAP folder.

I can now start the configuration page, but get and Internal Error everytime I put the Administrator username and passowrd to connect to active directory.

[ATTACH=CONFIG]11705[/ATTACH]

I am sure that the Domain UPN and username and password are correct.

 

Thanks

  • 2 weeks later...
Posted

Hi Nick,

I have updated to version 7.6 but still the configuration page doesn't conncet to active dir.

A windows saying active dir browsing is open, and nothing happens.

 

Thanks

Posted

What browser are you using, can you do some bugging for me?

 

Ok, if it's saying that WCF is working correctly.

 

Do you have access to Firebug in Firefox? If yes:

1. Load Firebug

2. Click on Console Tab

3. Reload the Setup.aspx page

4. Enter your Domain Name, Username, and Password

5. Click on the + sign next to https://hap.school.name/hap/api/setup/GetADTree

6. Go to the Response Tab, or XML Tab (Even Better) and paste the contents here

If IE9:

1. Reload the Setup.aspx

2. Press F12

3. On the Network Tab, click Start Capturing

4. Enter your Domain Name, Username, and Password

5. Click on the Students Box

6. Go back to the F12 Window

7. Stop Capturing

8. Double Click on https://hap.school.name/hap/api/setup/GetADTree

9. Copy the Response Body and Paste contents here

Posted

Can you download the HAP+ Web Logging Setup Utility from codeplex.

 

Run this app on your HAP+ server, this will create a new event log in the event viewer

 

Copy the attached HAP.Web.dll to your ~/bin/ folder

 

Re-run the setup page, and try entering the username/password again.

 

Check the HAP+ Event Log in the Event Viewer for errors

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...