首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当为多个站点设置IIS 10时,需要530个有效的主机名

当为多个站点设置IIS 10时,需要530个有效的主机名
EN

Server Fault用户
提问于 2017-12-08 09:52:40
回答 4查看 23K关注 0票数 8

我已经将IIS配置为有多个FTP站点,使用以下说明:https://docs.microsoft.com/en-us/iis/publish/using-the-ftp-service/using-ftp-virtual-host-names-in-iis-7

请参阅下面的配置。

在IIS中,我配置了基本身份验证,并使用用户mysite_ftp作为“Connect as”,在测试设置时,我在授权和授权上都会得到绿色的复选标记。

IIS设置:

当我使用Filezilla尝试连接时,我得到了以下日志:

尝试使用VPS主机名: h2746286.stratoserver.net

代码语言:javascript
运行
复制
Status: Resolving address of h2746286.stratoserver.net
Status: Connecting to 85.214.200.30:21...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Command:    USER tv_ftp
Response:   331 Valid hostname is expected.
Command:    PASS ***********
Response:   503 Login with USER first.
Error:  Critical error: Could not connect to server

尝试使用主机名: www.telefonievergelijken.nl

代码语言:javascript
运行
复制
Status: Resolving address of www.telefonievergelijken.nl
Status: Connecting to 85.214.200.30:21...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Command:    USER tv_ftp
Response:   331 Valid hostname is expected.
Command:    PASS ***********
Response:   503 Login with USER first.
Error:  Critical error: Could not connect to server

尝试使用主机名: ftp.telefonievergelijken.nl

代码语言:javascript
运行
复制
Status: Resolving address of ftp.telefonievergelijken.nl
Status: Connecting to 85.214.200.30:21...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Command:    USER tv_ftp
Response:   331 Valid hostname is expected.
Command:    PASS ***********
Response:   503 Login with USER first.
Error:  Critical error: Could not connect to server

applicationHost.config

代码语言:javascript
运行
复制
<sectionGroup name="system.ftpServer">
    <section name="log" overrideModeDefault="Deny" allowDefinition="AppHostOnly" />
    <section name="firewallSupport" overrideModeDefault="Deny" allowDefinition="AppHostOnly" />
    <section name="caching" overrideModeDefault="Deny" allowDefinition="AppHostOnly" />
    <section name="providerDefinitions" overrideModeDefault="Deny" />
    <sectionGroup name="security">
        <section name="ipSecurity" overrideModeDefault="Deny" />
        <section name="requestFiltering" overrideModeDefault="Deny" />
        <section name="authorization" overrideModeDefault="Deny" />
        <section name="authentication" overrideModeDefault="Deny" />
    </sectionGroup>
    <section name="serverRuntime" overrideModeDefault="Deny" allowDefinition="AppHostOnly" />
</sectionGroup>

<sites>
    <site name="othersite" id="2">
        <application path="/" applicationPool=".NET v4.5">
            <virtualDirectory path="/" physicalPath="E:\othersite\wwwroot" userName="othersite_web" password="[enc:IISCngProvider:b1dn9+We00KRNWUB6shbPm/hLtBOF2hOG9We5zVgaEmYL5C/fDLxDc3QH9Rnvi79SjeM+Rauk/bQWEBzJnw=:enc]" />
        </application>
        <bindings>
            <binding protocol="http" bindingInformation="*:80:www.othersite.nl" />
            <binding protocol="http" bindingInformation="*:80:othersite.nl" />
        </bindings>
    </site>
    <site name="telefonievergelijken" id="3">
        <application path="/" applicationPool=".NET v4.5">
            <virtualDirectory path="/" physicalPath="E:\telefonievergelijken\wwwroot" userName="tv_web" password="[enc:IISCngProvider:x+PhGwZweUwR53tUgGTdEGui8k4gIJRASehxKVtsPoTtxNIA8aRe8WUwvdLuEdzSQicrJVDwen7e/C6x9qfiFyudqtZYwhXuo=:enc]" />
        </application>
        <bindings>
            <binding protocol="http" bindingInformation="*:80:www.telefonievergelijken.nl" />
            <binding protocol="http" bindingInformation="*:80:telefonievergelijken.nl" />
        </bindings>
        <traceFailedRequestsLogging enabled="true" directory="E:\IISData\LogFiles\FailedReqLogFiles" />
    </site>
    <site name="FTP-othersite" id="1">
        <application path="/">
            <virtualDirectory path="/" physicalPath="E:\othersite\wwwroot" />
        </application>
        <bindings>
            <binding protocol="ftp" bindingInformation="127.0.0.1:21:" />
        </bindings>
        <ftpServer>
            <security>
                <ssl controlChannelPolicy="SslAllow" dataChannelPolicy="SslAllow" />
                <authentication>
                    <basicAuthentication enabled="true" />
                </authentication>
            </security>
        </ftpServer>
    </site>
    <site name="FTP-TV" id="4">
        <application path="/">
            <virtualDirectory path="/" physicalPath="E:\telefonievergelijken\wwwroot" userName="tv_ftp" password="[enc:IISCngProvider:xYxqamuKq02/xUcvZGTdEGui8gh3w6XT0hEegnCMZbVIxeWIOypRIZ1u8UAOG/AJg=:enc]" />
        </application>
        <bindings>
            <binding protocol="ftp" bindingInformation="127.0.0.1:21:www.telefonievergelijken.nl" />
        </bindings>
        <ftpServer>
            <security>
                <ssl controlChannelPolicy="SslAllow" dataChannelPolicy="SslAllow" />
                <authentication>
                    <basicAuthentication enabled="true" />
                </authentication>
            </security>
        </ftpServer>
    </site>
    <siteDefaults>
        <logFile logFormat="W3C" directory="E:\IISData\LogFiles" />
        <traceFailedRequestsLogging directory="E:\IISData\LogFiles\FailedReqLogFiles" />
        <ftpServer>
            <logFile directory="E:\IISData\LogFiles\FTPLogs" />
            <security>
                <authentication>
                    <basicAuthentication enabled="false" />
                </authentication>
            </security>
        </ftpServer>
    </siteDefaults>
    <applicationDefaults applicationPool="DefaultAppPool" />
    <virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>        

更新1

啊,我把127.0.0.1的IP地址改成了VPS的外部IP地址。当我试图连接ftp.telefonievergelijken.nl|tv_ftp时,我会得到日志记录错误:

代码语言:javascript
运行
复制
Error:  Could not connect to server
Status: Waiting to retry...
Status: Resolving address of ftp.telefonievergelijken.nl|tv_ftp
Status: Connection attempt failed with "EAI_NONAME - Neither nodename nor servname provided, or not known".

更新2

更改连接的用户名设置:

EN

回答 4

Server Fault用户

回答已采纳

发布于 2017-12-11 16:12:29

您似乎试图使用当前在IIS中任何绑定到FTP站点的绑定中未配置的主机名连接到FTP站点。

我只是基于您所包含的Filezilla的错误输出,因为您已经从输出中删除了主机名(即使是示例形式),所以没有更多的内容可以继续了。

您需要在FTP站点上配置一个绑定,该绑定与用于连接FTP站点的主机名相匹配(无论是来自Filezilla还是任何其他FTP客户端)。

编辑:从您更新的post信息中,我注意到您的FTP站点绑定确实配置错误--您目前只将FTP站点绑定到本地主机环回地址(127.0.0.1)。您需要将其绑定到一个非环回地址,该地址是外部可路由的。根据您的环境,这可能是您的外部IP地址(如果直接映射到服务器)或内部IP地址(如果您配置了NAT )。根据当前信息,我的猜测是必须配置另一个FTP站点,该站点拦截这些请求并向您显示无效的主机名错误。正确配置此FTP站点后,所有站点都应按预期运行。

此外,@Dre的回答也是至关重要的(因此您也应该将其付诸表决)--如果有多个FTP站点绑定到相同的IP地址,则需要以hostname|user格式在FTP客户端的“user”字段中指定主机名

票数 7
EN

Server Fault用户

发布于 2017-12-13 23:42:44

当配置两个或多个主机名时,ftp客户端必须在用户名中发送正确的虚拟主机名和用户名。用垂直行符号分隔站点名称和用户:

www.example.com|MyUser

因此,在您的FTP客户端中,将此用于用户名:

代码语言:javascript
运行
复制
ftp.telefonievergelijken.nl|tv_ftp
票数 12
EN

Server Fault用户

发布于 2022-05-31 11:11:29

在将IIS 10.0实例配置为仅在外部URL上绑定后,我收到了此错误。我的更正是给内部IP增加一个附加的绑定。成功解析到外部URL的FTP连接。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/887176

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档