سؤال

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 }
            );
        }
هل كانت مفيدة؟

المحلول

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?

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top