IIS7在不同的端口上运行两个公共站点(asp.net和java) [英] IIS7 running two public sites(asp.net & java) on different ports

查看:75
本文介绍了IIS7在不同的端口上运行两个公共站点(asp.net和java)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在Windows Server 2008上机器

我在1049端口运行基于java的Web服务。

我能够在开发计算机上使用URL http:// localhost:1049 / 访问服务

但是当我部署服务时在公共服务器上从公共URL访问服务,如http://mydomain.com:1049/serviceName?method=getFile

我得到404未找到错误。



我在服务器上安装了iis,

并且能够访问我的默认asp.net站点 http ://mydomain.com/ [ ^ ]

但是要求 http://mydomain.com:1049 [ ^ ]失败。



我想知道是否有可能将请求重定向到虚拟目录到1049端口。解决方案

您好Nitin,



您收到404错误,因为IIS服务器中没有部署任何应用程序因此,您应该在端口1049上部署您的应用程序。您可以更改IIS 7服务器中的绑定设置,请参阅以下链接以获取更多信息。



http://www.iis。 net / learn / publish / using-the-ftp-service / configured-ftp-firewall-settings-in-iis-7 [ ^ ]



http://forums.asp.net/t/1417348.aspx/1 [ ^ ]



希望以上链接可以帮助您。


确保在您尝试连接的计算机与服务器本身之间的任何防火墙/路由器上打开正确的端口。



如果可以' 'telnet mydomain.com 1049端口被阻塞了。


我自己想出来了。



创建一个代理获取参数并将内容重定向到localhost:1049端口的页面,然后发送响应。



 protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack){
Response.Clear();
Response.ContentType =text / xml; charset = UTF-8;

var client = new WebClient();
string data = client.DownloadString(http:// localhost:1049 / checkDocument?data = i%20eat%20a%20apple);
Response.Write(data);

Response.Flush();
Response.End();
}
}


Hi,
On windows server 2008 machine
I have a java based web service running on port 1049.
I am able to access the service using URL http://localhost:1049/ on the development machine
but when I deployed the service on the public server to access the service from public url like http://mydomain.com:1049/serviceName?method=getFile
I get 404 not found error.

I have iis installed on the server,
and able to access my default asp.net site http://mydomain.com/[^]
however call to http://mydomain.com:1049[^] fails.

I wonder whether it is possible to redirect the requests coming to a virtual directory to the 1049 port.

解决方案

Hi Nitin,

You are getting 404 error because none of the application is deployed in IIS server on port 1049. Hence you should deploy your application on the port 1049. You can change the binding setting in IIS 7 server, Refer the below link for more information.

http://www.iis.net/learn/publish/using-the-ftp-service/configuring-ftp-firewall-settings-in-iis-7[^]

http://forums.asp.net/t/1417348.aspx/1[^]

Hope the above links help you.


Make sure the correct ports are open on any firewalls/routers that are between the machine you are trying to connect from and the server itself.

If you can''t telnet mydomain.com 1049 the port is being blocked somewhere.


I figured it out myself.

Created a proxy page which takes the parameters and redirects the content to the localhost:1049 port and then sends the response.

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack) {
        Response.Clear();
        Response.ContentType = "text/xml; charset=UTF-8";

        var client = new WebClient();
        string data = client.DownloadString("http://localhost:1049/checkDocument?data=i%20eat%20a%20apple");
        Response.Write(data);

        Response.Flush();
        Response.End();
    }
}


这篇关于IIS7在不同的端口上运行两个公共站点(asp.net和java)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆