1

I change my server of website .The new server has windows 10 2016 R2 OS and use IIS 10. I transfer files from old server to new server and add website and then binding port 80 to this website. Now when browse website get this error :

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

<?xml version="1.0" encoding="utf-8"?>

<configuration>
    <configSections>
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <section name="TravelEnterProject.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <connectionStrings>
        <add name="DefaultConnection" connectionString="Data Source=.;Initial Catalog=TravelEnterDB;User ID=User;Password=rLyVhrghj#A39Ac" providerName="System.Data.SqlClient" />
        <add name="TravelEnterDBEntities" connectionString="metadata=res://*/AdakDbModel.csdl|res://*/AdakDbModel.ssdl|res://*/AdakDbModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.;initial catalog=TravelEnterDB;persist security info=True;user id=User;password=rLyVhrdfffd@j#A39Ac;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
        <add name="TravelEnterDBEntities2" connectionString="metadata=res://*/Models.DbModel.TravelEnterModels.csdl|res://*/Models.DbModel.TravelEnterModels.ssdl|res://*/Models.DbModel.TravelEnterModels.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.;initial catalog=TravelEnterDB;user id=User;password=rLyVhr9dfdf39Ac;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    </connectionStrings>
    <appSettings>
        <add key="webpages:Version" value="3.0.0.0" />
        <add key="webpages:Enabled" value="false" />
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />
        <add key="fullsize" value="/uploadimage/UploadImages/" />
        <add key="Image900x500" value="/uploadimage/UploadImages/900x500/" />
        <add key="Image270x160" value="/uploadimage/UploadImages/270x160/" />
        <add key="Image70x70" value="/uploadimage/UploadImages/70x70/" />

        <add key="Sitekey" value="6LfbRCwUAAAAANSNLUZvBUMmn6Nzc-q" />
        <add key="Secretkey" value="6LfbRCwUAAAAAKDeRsyy7vcupQME1wO" />

    </appSettings>
    <system.web>
        <authentication mode="None" />
        <compilation debug="false" targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" />
        <httpCookies requireSSL="true" />
        <customErrors mode="on" />

    </system.web>
    <system.webServer>
        <stripHeaders>
            <header name="Server" />
            <header name="X-Powered-By" />
            <header name="X-Aspnet-Version" />
        </stripHeaders>
        <httpProtocol>
            <customHeaders>
                <remove name="X-Powered-By" />

                <add name="X-Frame-Options" value="SAMEORIGIN" />
                <add name="Access-Control-Allow-Origin" value="*" />
            </customHeaders>
        </httpProtocol>
        <validation validateIntegratedModeConfiguration="false" />
        <modules>
        </modules>
        <rewrite>
            <rules>
                <rule name="Redirect to HTTPS" stopProcessing="true">
                    <match url="(.*)" />

                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
                </rule>
                <rule name="charter" enabled="false">
                    <match url="^charter/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/(.*)" />
                    <action type="Rewrite" url="Charter?depCountryId={R:1}&amp;DepCityId={R:2}&amp;ArrCountryId={R:3}&amp;ArrCityId={R:4}&amp;Fromdate={R:5}&amp;DateRange={R:6}&amp;ADT={R:7}&amp;CHD={R:8}&amp;INF={R:9}&amp;S={R:10}" />
                </rule>
                <rule name="Redirect non-www to www" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="*" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="travelenter.com" />
                    </conditions>
                    <action type="Redirect" url="https://www.travelenter.com/{R:0}" />
                </rule>

            </rules>
            <outboundRules>
                <rule name="changeServerHeader">
                    <match serverVariable="RESPONSE_Server" pattern=".*" />
                    <action type="Rewrite" value="heloooo" />
                </rule>
            </outboundRules>
        </rewrite>
        <security>
            <requestFiltering>
                <verbs>
                    <add verb="TRACE" allowed="false" />
                    <add verb="HEAD" allowed="false" />
                    <add verb="OPTIONS" allowed="false" />
                </verbs>
            </requestFiltering>
        </security>
        <tracing>
            <traceFailedRequests>
                <add path="*">
                    <traceAreas>
                        <add provider="ASP" verbosity="Verbose" />
                        <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
                        <add provider="ISAPI Extension" verbosity="Verbose" />
                        <add provider="WWW Server" areas="Rewrite" verbosity="Verbose" />
                    </traceAreas>
                    <failureDefinitions timeTaken="00:00:00" statusCodes="500" verbosity="Ignore" />
                </add>
            </traceFailedRequests>
        </tracing>
        <staticContent>
            <clientCache cacheControlCustom="public" cacheControlMaxAge="96:00:00" cacheControlMode="UseMaxAge" />
        </staticContent>
        <caching>
            <profiles>
                <add extension=".woff" policy="CacheUntilChange" kernelCachePolicy="DontCache" />
                <add extension=".ico" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="00:00:30" />
                <add extension=".css" policy="DisableCache" kernelCachePolicy="DontCache" duration="24.00:00:00" />
                <add extension=".js" policy="DisableCache" kernelCachePolicy="DontCache" duration="24.00:00:00" />
                <add extension=".ttf" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="24.00:00:00" />
                <add extension=".png" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="24.00:00:00" />
                <add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="24.00:00:00" />
            </profiles>
        </caching>
        <httpErrors errorMode="Detailed" existingResponse="Replace">
            <remove statusCode="404" />
            <error statusCode="404" path="https://www.ttttttt.com/404.htm" responseMode="Redirect" />
        </httpErrors>

    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
            <parameters>
                <parameter value="v11.0" />
            </parameters>
        </defaultConnectionFactory>
        <providers>
            <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
    </entityFramework>
    <system.serviceModel>
        <bindings>
            <customBinding>
                <binding name="CustomBinding_IFlightService">
                    <textMessageEncoding messageVersion="Soap12" />
                    <httpTransport />
                </binding>
            </customBinding>
            <basicHttpBinding>
                <binding name="BindingCharter" maxReceivedMessageSize="999999999" maxBufferSize="999999999" maxBufferPoolSize="999999999" sendTimeout="00:55:00" receiveTimeout="00:09:00" openTimeout="00:10:00" closeTimeout="00:10:00" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint name="BasicHttpBinding_ICharterService" address="http://localhost:8080/CharterWs/CharterService.svc" binding="basicHttpBinding" bindingConfiguration="BindingCharter" contract="CharterMiddleWebService.ICharterService" />
            <endpoint name="CustomBinding_IFlightService" address="http://82.50.209.208:8080/FlightMiddleService/FlightService.svc" binding="customBinding" bindingConfiguration="CustomBinding_IFlightService" contract="flightReference.IFlightService" />
        </client>
    </system.serviceModel>
    <applicationSettings>
        <TravelEnterProject.Properties.Settings>
            <setting name="TravelEnterProject_AdakFlightRefrence_AdakFlight" serializeAs="String">
                <value>http://localhost:8080/FlightWS/AdakFlight.svc</value>
            </setting>
            <setting name="TravelEnterProject_RajaReference_online2Services" serializeAs="String">

                <value>https://webservices.raja.ir/online2Services.asmx</value>
            </setting>
            <setting name="TravelEnterProject_CharterFlightsReference_Service1" serializeAs="String">
                <value>http://localhost:8080/CharterFlights/Flights.svc</value>
            </setting>
            <setting name="TravelEnterProject_AutoRentService_AutoRentService" serializeAs="String">
                <value>http://service.karanehnovin.ir/AutoRentService.asmx</value>
            </setting>
            <setting name="AdakCharterLib_CharterMiddleWebService_CharterService" serializeAs="String">
                <value>http://localhost:8080/CharterWs/CharterService.svc</value>
            </setting>
            <setting name="AdakTrainLib_AdakTrainWebReference_TrainService" serializeAs="String">
                <value>http://127.0.0.1:8085/TrainService.svc</value>
            </setting>
        </TravelEnterProject.Properties.Settings>
    </applicationSettings>
</configuration>

compilation section in machine.config :

<section name="compilation" type="System.Web.Configuration.CompilationSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" requirePermission="false"/>

my web.config file has no this section . Where should I place this? And is there any other problem?

enter image description here

Community
  • 1
  • 1
hmahdavi
  • 2,250
  • 3
  • 38
  • 90
  • 1
    https://www.jexusmanager.com/en/latest/tutorials/oob-500.html check what Jexus Manager reports. – Lex Li May 13 '18 at 06:28
  • Do you have URL rewrite module installed? That's a separate download / not installed by default. – MisterSmith May 13 '18 at 09:42
  • 1
    In addition to @MisterSmith suggestion you can also check the event viewer (Control Panel->Administrative Tools->Even Viewer) system or application logs for troubleshooting – Mohsin Mehmood May 13 '18 at 09:49
  • @Mohsin Mehmood Your mean is " Event Viwer " ? – hmahdavi May 13 '18 at 10:08
  • Is the web.config mentioned in that error actually the webroot, or is it in a folder inside the webroot? – MisterSmith May 13 '18 at 10:08
  • @MisterSmith full path of web.config is : C:\inetpub\wwwroot\\ – hmahdavi May 13 '18 at 10:12
  • @programmer138200 yes I meant Event viewer – Mohsin Mehmood May 13 '18 at 10:51
  • @MohsinMehmood I check Event viewer but no log exist for iis – hmahdavi May 13 '18 at 11:20
  • You checked both system and application logs? Don’t apply any filter just look for errors. Also you confirmed that url rewrite module is installed? – Mohsin Mehmood May 13 '18 at 11:29
  • @MohsinMehmood I check system and application logs. first clear all logs then browse website and click on iis modules but no error loged – hmahdavi May 13 '18 at 11:43
  • 1
    Another suggestion! Go to IIS, select your website in left pane and then click HttpHandlers in the right pane to ensure the http handlers list show up. Also, check that UrlRewrite icon showing up in the right pane with your website selected. If yes double click url-rewrite to ensure rules are listed there – Mohsin Mehmood May 13 '18 at 11:53
  • I have not httpHandlers in iis section and when double click on the UrlRewrite get error : --------------------------- URL Rewrite --------------------------- There was an error while performing this operation. Details: Filename: \\?\C:\inetpub\wwwroot\NewTravelEnter\web.config Error: --------------------------- OK --------------------------- – hmahdavi May 13 '18 at 11:59

1 Answers1

3

After some troubleshooting it was found that url rewrite module was missing.

Url rewrite module can be downloaded and installed from https://www.microsoft.com/en-us/download/details.aspx?id=47337

Mohsin Mehmood
  • 4,156
  • 2
  • 12
  • 18
  • URL Rewrite --------------------------- There was an error while performing this operation. Details: Filename: \\?\C:\inetpub\wwwroot\NewTravelEnter\web.config Error: --------------------------- OK --------------------------- – You specified this error when loading urlrewrite module. Check this StackOverflow [thread](https://stackoverflow.com/questions/22199424/there-was-an-error-while-performing-this-operation). You may need to repair UrlReWrite module installation – Mohsin Mehmood May 14 '18 at 06:05
  • I publish my website project and replace generated web.config file with old web.config file. Then this problem solved. – hmahdavi May 24 '18 at 05:10