1

I have been at this for hours and still have not figure out what I am doing wrong. I created an MVC4 intranet site and now I am ready to deploy it to IIS on our web server. I setup a site called Portal and from Visual Studio I have performed the 1 click publish using the file system method. The files copied successfully to my site. In IIS I changed authentication to Windows and disabled Anonymous authentication. I even went into my application pool and changed the Load User Profile = true (not sure if I needed to do that). I then hit browse Portal on *:88 and I receive Internet Explorer cannot display the webpage. I checked my Modules and I see UrlRoutingModule-4.0 is managed and inherited. I must be overlooking an obvious setting as this is my first web site. Any help is appreciated. Thank you.

    physical path = c:\inetpub\wwwroot\Portal
    Site name and Application Pool = Portal (.Net 4 and Pipeline mode: integrated)
    type = http
    Host name = Portal
    Port = 88 (80 was already used and did not work)
    IP Address = *

UPDATE: Webconfig (i have custom roles) and Routconfig

<system.web>

    <roleManager enabled="true" defaultProvider="DbRoleProvider">
      <providers>
        <clear />
        <add name="DbRoleProvider"
            applicationName="Portal"
            type="Portal.WebUI.Infrastructure.DbRoleProvider"
            connectionStringName="PortalEntities" />
      </providers>
    </roleManager>

    <compilation debug="true" targetFramework="4.0" />
    <authentication mode="Windows" />
    <authorization>
      <deny users="?" />
    </authorization>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
  <handlers>
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers></system.webServer>

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "RequestInfo", action = "Index", id = UrlParameter.Optional }
            );
        }
jmzagorski
  • 1,135
  • 18
  • 42
  • What user is the App Pool configured to? Does that user have access to the local file path where the code was uploaded to? – CtrlDot Feb 07 '14 at 21:34
  • I have pass-through authentication setup and the pool is setup as ApplicationPoolIdentity – jmzagorski Feb 07 '14 at 21:36
  • Does domain user have access then? Can you show your routes config / web.config (relevant authentication section) and http output when you request your site (ie: are there any redirects happening in the background?). – CtrlDot Feb 07 '14 at 21:39
  • Anything in the IIS logs? Is there a firewall between you and the server? – CtrlDot Feb 07 '14 at 21:59
  • I changed my port back to 80 to retrace my steps. This error could be coming from my site? World Wide Web Publishing Service (WWW Service) did not register the URL prefix http://*:80/ for site 2. The necessary network binding may already be in use. The site has been disabled. The data field contains the error number. And changing it back to 88 did nothing – jmzagorski Feb 07 '14 at 22:05

2 Answers2

1

so after more experimentation and research I found my problem, and it was a result of never doing this before.

  1. My first problem was I included a host name when I was setting up my application. So when I tried to browse to www.portal.com:85 on the server it did not understand that address and could not connect to anything. However, when I removed the host name and typed in http://localhost:85 it worked. I will have to get with my infrastructure team to set that up.

  2. My second problem was security to our SQL Server. I did not know I had to setup a login for the application pool name. I used the second answer from this post Login failed for user 'IIS APPPOOL\ASP.NET v4.0' because I did not want to change the identity to LocalSystem. Once I setup a login under the SQL Server security the site was functioning. Is that the correct way of doing it?

Community
  • 1
  • 1
jmzagorski
  • 1,135
  • 18
  • 42
0

It would be helpful if you disabled friendly error messages in IE. In "Internet Options" on the Advanced tab, under Browsing deselect "Show friendly HTTP error messages". Then try again. Hopefully then you'll see what the actual issue is as an HTTP status code. Can it not find the server, are you getting a 404 (page not found), a 401 unauthorized, a 500, etc.

With that information it will be much easier to diagnose.

  • I must have something wrong, I did said but I get the same message about not displaying the webpage. When I click browse on IIS it tried to bring me to this site http://portal:88/) (with 80 I just get "http://portal/" and that does not work too, so it is not recognizing something in my config files I would guess – jmzagorski Feb 07 '14 at 21:48
  • That might be a DNS issue. Does "portal" resolve on the server to anything? You might have to edit hosts on that box – CtrlDot Feb 07 '14 at 21:59
  • it shouldn't, I changed it to RequestPortal and received the same error. – jmzagorski Feb 07 '14 at 22:08
  • I guess what I am asking is this, the url you are hitting the site with. http://:88/RequestPortal/index ? or is it http://portal:88/RequestPortal/index ?. In the second case, you will have to make sure that "portal" resolves to the correct IP – CtrlDot Feb 07 '14 at 22:24
  • I will look at that when I can get back to my desk. I manually installed MVC4 on VIsual Studio 2010. I don't have to do the deploy dependencies as In MVC3, Correct? – jmzagorski Feb 07 '14 at 22:53
  • Everything should be part of the "publish" process..... Deps are included in the output – CtrlDot Feb 07 '14 at 23:00