Avatar of bmanmike39
bmanmike39
 asked on

401 Site Error on new Azure Win 2012 server. need help to identify problem

I receiving the following error when I Try to view my web site on my Azure win 2012 server.  Note, I have one site running, and it works fine, and I am using the same IP for both. But I can't get the second one running.

I have done the following:
Given read, write permissions to the directory and  IIS_IUSER  and Network services.
set the headers and application pool and set the ports to 80.

The file are in the directory but will not show.  I have a simple index.html file but still get 404

Thanks for any help in advance.

Error:
401

401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied.

Windows Server 2012Azure

Avatar of undefined
Last Comment
btan

8/22/2022 - Mon
David Johnson, CD

on the site in question in iis you have to change the authentication to 'anonymous Authentication' and authorization to 'allow all users'
remember each site must have one of the following items to be unique
ip address/port/host name

a 401 error (authentication failure) is not a 404 (not found error)
btan

Can check that NTLM is done as priority e.g.
1.) Open iis and select the website that is causing the 401
2.) Open the "Authentication" property under the "IIS" header
3.) Click the "Windows Authentication" item and click "Providers"
4.) Have NTLM above the Negotiate .

Next, if you have the anonymous access to use specific credentials in the applicationHost.config file of IIS. Then configure the application pool running the virtual directory to use the same credentials configured for anonymous access e.g. in the virtual directory, open up the Authentication, and edit the Anonymous access credentials accordingly. That include full rights to IUSR as mentioned by David
bmanmike39

ASKER
I had already done this. I was finally able to get it to work.  I think it was that there was no web config file in the directory. but i was using an html file, not a aspx file. On IIS is a webconfig file necessary regardless of file type?
Your help has saved me hundreds of hours of internet surfing.
fblack61
David Johnson, CD

the initial setting is the apphost.config a web.config inherits the apphost.config settings and can be used to customize the web site settings.
bmanmike39

ASKER
So when I setup a new site on the server, does the root have to have a webconfig file in it, Or will this produce an error?
David Johnson, CD

no as long as it can use the settings in the apphost.configthis is what controlles the apphost.config
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
btan

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question