IIS 站点配置文件

IIS 站点配置文件 

C:/Windows/System32/inetsrv/config/applicationHost.config

配置文件示例:

    <system.applicationHost>
<!-- 应用程序池配置 列队大小 回收时间 .net版本  -->
        <applicationPools>
            <add name="DefaultAppPool" queueLength="65535" managedRuntimeVersion="v4.0">
                <recycling>
                    <periodicRestart time="00:00:00" />
                </recycling>
                <processModel idleTimeout="00:00:00" />
            </add>
            <add name="ASP.NET v4.0" managedRuntimeVersion="v4.0" />
            <add name="ASP.NET v4.0 Classic" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" />
            <add name="test" queueLength="50000" managedRuntimeVersion="v4.0">
                <processModel idleTimeout="10:00:00" />
                <recycling>
                    <periodicRestart time="00:00:00" />
                </recycling>
            </add>
            <add name="test2" queueLength="50000" autoStart="true" managedRuntimeVersion="v4.0">
                <processModel idleTimeout="10:00:00" />
                <recycling>
                    <periodicRestart time="00:00:00" />
                </recycling>
            </add>

            <applicationPoolDefaults>
                <processModel identityType="ApplicationPoolIdentity" />
            </applicationPoolDefaults>
        </applicationPools>

        <listenerAdapters>
            <add name="http" />
            <add name="net.tcp" identity="S-1-5-80-3579033775-2824656752-1522793541-1960352512-462907086" />
            <add name="net.pipe" identity="S-1-5-80-2943419899-937267781-4189664001-1229628381-3982115073" />
            <add name="net.msmq" identity="S-1-5-80-89244771-1762554971-1007993102-348796144-2203111529" />
            <add name="msmq.formatname" identity="S-1-5-80-89244771-1762554971-1007993102-348796144-2203111529" />
        </listenerAdapters>
     <!--  开启 iis 日志 -->
        <log>
            <centralBinaryLogFile enabled="true" directory="%SystemDrive%\inetpub\logs\LogFiles" />
            <centralW3CLogFile enabled="true" directory="%SystemDrive%\inetpub\logs\LogFiles" />
        </log>
     <!--  设置iis站点 配需虚拟目录 -->
        <sites>
            <site name="test" id="1" serverAutoStart="true">
                <application path="/" applicationPool="test">
                    <virtualDirectory path="/" physicalPath="D:\wwwroot\test" />
                    <virtualDirectory path="/html2" physicalPath="D:\wwwroot\html2" />
                    <virtualDirectory path="/html3" physicalPath="D:\wwwroot\html3" />
                </application>
          <!-- test 站点下 设置 应用程序 --> <application path="/server2" applicationPool="test"> <virtualDirectory path="/" physicalPath="D:\wwwroot\server2_html4" /> <virtualDirectory path="/html" physicalPath="D:\wwwroot\html" /> </application>
          <!-- 配置协议端口 链接超时 10s --> <bindings> <binding protocol="http" bindingInformation="*:80:" /> <binding protocol="https" bindingInformation="*:443:" /> </bindings> <limits connectionTimeout="00:00:10" /> </site>
        <!-- 设置站点2 配置虚拟目录 应用程序server3 --> <site name="test2" id="2" serverAutoStart="true"> <application path="/" applicationPool="test2"> <virtualDirectory path="/" physicalPath="D:\wwwroot\test2" /> </application> <application path="/server3" applicationPool="test2"> <virtualDirectory path="/" physicalPath="D:\wwwroot\server3" /> <virtualDirectory path="/html" physicalPath="D:\wwwroot\server3-html" /> </application> <bindings> <binding protocol="https" bindingInformation="*:10443:" /> </bindings> <limits connectionTimeout="00:00:10" /> </site>
        <!-- iis 默认日志 默认开启 --> <siteDefaults> <logFile logFormat="W3C" directory="%SystemDrive%\inetpub\logs\LogFiles" /> <traceFailedRequestsLogging directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles" /> </siteDefaults> <applicationDefaults applicationPool="DefaultAppPool" /> <virtualDirectoryDefaults allowSubDirConfig="true" /> </sites> <webLimits /> </system.applicationHost> <system.webServer> <asp /> <caching enabled="true" enableKernelCache="true"> </caching> <cgi />      <!-- 默认首页 --> <defaultDocument enabled="true"> <files> <add value="Default.htm" /> <add value="Default.asp" /> <add value="index.htm" /> <add value="index.html" /> <add value="iisstart.htm" /> <add value="default.aspx" /> </files> </defaultDocument> <directoryBrowse enabled="false" /> <fastCgi />

编辑配置文件自动生成IIS站点文件;

注意文件权限。

 

posted @ 2019-08-12 14:11  01234567  阅读(5123)  评论(0编辑  收藏  举报