Publishing an MVC4 App on IIS 7.5 but Having Permission Issues - asp.net-mvc

I published an intranet on IIS 7.5. If I try to go to the website, I get "403 - Forbidden: Access is denied - You do not have permission to view this directory or page using the credentials that you supplied".
If I right click on the application folder on IIS Manager and go to Manage Application and then Browse, I get "HTTP Error 403.14 - Forbidden - The Web server is configured to not list the contents of this directory". It then proceeds to tell me that A default document is not configured etc. etc. I do have a default document listed in the web.config file as follows:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="false" />
<modules runAllManagedModulesForAllRequests="true" />
<defaultDocument>
<files>
<add value="Index.cshtml" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
What am I doing wrong? Many thanks.

check the folders permissions: right click on the folder, click on properties go to Security and add the appropriate user (like IUSR_...). hope it helps.

It turned out I was publishing the app completely the wrong way. I was going by how previous ASP.Net apps created as Websites and not Solutions were published. This MVC app needed to be placed in inetpub/wwwroot folder in the server. If I published through Visual Studio I think this would have happened anyway. I didn't have VS in the server. So I placed the files manually there (just copied from my local inetpub/wwwroot since I successfully published there earlier). The last thing I needed to do was go to IIS Manager and converting the project folder into an Application. Now cooking on gas.

Related

Umbraco backoffice - Models Builder/Generate Models is missing

Running locally, logged in as admin, the "Models Builder" section is just not there. My co-worder, when running it locally with the same login sees it just fine:
But I am just missing that section for whatever reason.
Here is my Web.Config
<add key="Umbraco.ModelsBuilder.Enable" value="true"/>
<add key="Umbraco.ModelsBuilder.ModelsMode" value="AppData"/>
What am I missing? Thank you.
Have you tried using a different web browser? It could be the Umbraco js files are being cached on your machine, so try clearing your temporary internet files.
Also, press F12 to open the developer tools in your web browser and check if there are any errors logged in the console.

Windows protocol installer won't run from a browser

We have IT Hit WebDAV Server and IT Hit WebDAV Ajax Library running in a Windows development environment. All is working well except when a user tries to run the protocol installer from the webpage popup message. The popup says “Select OK to download the protocol installer”. When I click okay, it opens a new tab with a 404 error. I can see in the URL that it is looking in the correct folder, and the msi file IS in that folder.
I tried it in 3 different browsers with the same results. I also tried running the WebDavServer wizard project and get the same results. The only way I’ve found to get it to run from a browser is through the AjaxFileBrowser app. In there, the popup message is different and it works when you click the link for the Windows version.
Do you have any ideas for why it’s not running from the browser?
Here are some suggestions:
The MIME-map is not configured. By default IIS has a mapping for .msi and .gz extensions, but maybe it is deleted from IIS for some reason. Here is how to set MIME mapping in web.config:
<staticContent>
<mimeMap fileExtension=".pkg" mimeType="application/octet-stream" />
<mimeMap fileExtension=".deb" mimeType="application/octet-stream" />
<mimeMap fileExtension=".msi" mimeType="application/octet-stream" />
<mimeMap fileExtension=".gz" mimeType="application/x-gzip" />
</staticContent>
Your WebDAV Ajax Library files are located under the WebDAV path. Your server engine is processing all requests in your code so they do not reach the file system. Just move your static files to some other folder, outside of WebDAV. In case of IT Hit WebDAV samples, the static files are typically located in /AjaxFileBrowser/ folder.

MVC 4 deployed to IIS 8 Page can't be Displayed

I am trying to deploy a MVC 4 application to IIS 8 on Windows Server 2012.
I am copying the files to the server by using Publish > File System.
I have created a new web site in IIS on the server, pointed this to the correct directory, but when trying to view the site I see 'This page can’t be displayed'.
I have never deployed an MVC application before, so may have missed something very simple.
After spending a lot of time searching on the Web, I have:
Ensured the correct version of .NET (4.0) is installed, and is selected within a new Application Pool created specifically for my app
Disabled Directory Browsing
Ensured the System.Web.MVC.dll is copied into the Bin folder
Added the following to web.config:
Below:
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="managedHandler" />
</modules>
I am very grateful for any help or suggestions!
Martin
Oh dear...it looks like the problem was caused by my using Port 110 in the web site bindings. I think this is a reserved Port.
Hope some of the bullets above help someone else anyway.

MVC Site Compression not working

I have done and checked the following.
1. made sure components are installed...
Made sure everything is enabled for the server in IIS
Made sure the site has modules enabled
Enabled the settings in web.config
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>
My site here http://tinyurl.com/lv44hl4 according to few sites when i enter my url in it says not compressed, for example
http://tinyurl.com/nzfv9z4 (GZIP TEST SITE WITH MY URL)
Am i missing something? (using IIS8, mvc5 and .net 4.5.1)
Ctrl-Shift-I will open developer tools in Google Chrome. According to that your content is compressed via gzip.

How to deploy a website to a local IIS

I'm trying to deploy a website to my local IIS for the first time
I added a new website to my local IIS (also created a directory for it)
I published it with File System method from VS2012 to this directory (checked - it's in there)
I clicked Manage WebSite > Browse
This shows an error:
HTTP Error 403.14 - Forbidden The Web server is configured to not list
the contents of this directory.
I found on the web that I should enable Directory Browsing. I tried it.
Now it shows me my app root directory instead of loading the web app (that's not what I wanted...)
How to make IIS launch my web app?
You need to grant permission to that folder.
When i deploy on IIS i grant "network service" read write access to the folder
You will need to launch the IIS Management Console and within the Default Website, your website folder should hopefully be listed. Do a right click on the website folder and click "Convert to Application"
You may want to consider using Web Deploy as it will simplify the deployment process.
If it's an MVC app, then the default controller & action in the routing need to correspond with a controller & action in your app. By default this would be the Index action in HomeController. If your default is some other combination, change the defaults in the routing config.
If you have a home/index controller/action, then check your server is configured to run aspx pages. do this by simply creating a default.aspx with some text in it & see if it's served when you browse the folder.
Directory Browsing should be disabled, as it would allow someone to browse the files on your server. I know it's your localhost, but good practice & all that.
I finally found it. It wasn's an IIS problem. One of my colleagues added the following lines to the Web.config
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
...
</handlers>
...
</system.webServer>
Removing them fixed the problem.

Resources