Skip to main content

Possible resolution to 'Not Authorized' error in local IIS

Back-end Development

You are not authorized to view this page is a common error seen by developers setting up a local instance of IIS on their machine.  This error can appear for a number of reasons, and depending on what setup you have can be solved a number of ways.   As you might guess, this is a permissions error, and is related to the folder permissions where your site is served. On an installation of Windows Server there are steps one can go through for correcting this problem by going through the security settings.  But be aware, many of the possible resolutions out there are actually red herrings, and while they might fix the problem indirectly, they also might not.

On a regular install of Windows XP, many of the security options are not available.  You don't have the administrative tools to manage Active Directory permissions and web site permissions.  You can try changing settings with regard to Directory Security in IIS properties.  Or manage the Sharing and Security settings for a folder in Windows Explorer.  And if you're lucky, doing some of these things might change the underlying permissions in a way that fixes the issue.  But it may only be a matter of time before adding a file presents you with the same issue that cannot be solved the same way. Managing permissions within Windows is something I am not super-familiar with.  It is significantly different than the comparatively simple way of setting permissions in UNIX/Linux with the chown, chmod, and chgrp commands.  Especially working with XP and not Windows Server.  Thankfully, I have discovered a command line tool that should fix any of the permission issues.  And it is something that should already be installed on every Windows environment. Here are the steps to success.

  1. Open up the command window (Start -> Run... -> type 'cmd' and hit OK)
  2. Change the current directory to the location of your webroot
  3. Run the following command

cacls . /e /c /t /g Everyone:C This will then give you a long log of the permissions being changed throughout the directory structure.  Once this process completes, the problem should go away. Part of what causes this problem to begin with is running a website in a directory outside of inetpub .  Apparently there are things going on below the surface in Windows that handle the permissions depending on what directory you are using.  If you're like me, and prefer to run the website directly from where you are working on it with a tool like XP Pro IIS Admin, then you might run into this.

Need a fresh perspective on a tough project?

Let’s talk about how RDG can help.

Contact Us