静态IP到swicth想要使用本地sql服务器进行Web [英] static ip to a swicth want to use local sql server for web

查看:97
本文介绍了静态IP到swicth想要使用本地sql服务器进行Web的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家

我们的交换机带有一个静态IP,所有服务器都可以连接到Internet.
其中一台服务器用于sqlserver2008.

我将我们的网站发布到Internet,但是我必须使用我们的本地sqlserver,因为其他本地应用程序正在连接到它.

但是有两个问题:

1.我不知道如何指定IP到连接字符串(首先使用EF4 SQL)
2.该解决方案包含许多项目,其中1个项目用于数据访问和EF4,但我发布了asp.net项目.这是个问题吗?如果是,我如何在Internet中拥有数据访问项目(它是一个类库)?

hi experts

we have a static ip that comes to our switch and all servers are able to connect to internet.
one of the servers is for sqlserver 2008 .

i published our website to internet but i must use our local sqlserver because other local applications are connecting to it.

but 2 problems:

1. i don''t know how to specify the ip to connection string (using EF4 SQL first)
2. the solution contains many projects and 1 project is for data access and EF4 but i published the asp.net project. is it a problem? if yes how can i have data access project (it''s a class library) in internet?

推荐答案

A)您只有一个静态IP,并且有一个路由器NAT?
如果是这样:请在内联网上也使用静态ip.使用本地DNS服务器,或仅使用服务器的NetBios名称.
B)您想将SQL服务发布到互联网吗?
不要那样做!只允许从外部访问前端(Web服务器),并且只能访问http端口!不要在LAN上使用WAN IP!
回答您的问题:
1)您可以像在连接字符串中使用主机名一样使用IP地址
2)我不明白.请更精确.

第二种解释:
您的局域网外有一个Web服务器.您是否想通过路由器从Web服务器访问SQL Server?
好吧...这不是一个好主意.您可以使用端口转发等来完成此操作,但这不是方法.在SQL 2000中有一个http活页夹,但我认为没有更多了.
但是您可以将所有业务逻辑集中在LAN内,并通过https将WCF或其他类型的服务发布到前端.但是您应该只在其中保留表示层.
A) You have one single static IP, and a router with NAT?
If so: use static ip also on the intranet. Use local DNS server, or simply NetBios names of the server.
B) You want to publish the SQL service to the internet?
Dont do that! Allow only the front-end (web server) to be accessed from outside, and only the http ports! Dont use the WAN IP on the LAN!
Answer to you questions:
1) you can use the IP address as you would use the hostname in the connection string
2) I dont understand. Please be more precise.

Second interpretation:
You have a web server outside your LAN. And you want to access the SQL server from the web server via your router?
Well... that''s not a good idea. You can do it with port forwarding and so on, but this is not the way. There was a http binder in SQL 2000, but I think there is no more.
But you can concentrate all you business logic inside your LAN, and publish a WCF or other kind of service via https to your frontend. But you should leave only the presentation layer in it.


1. EF没关系.在Web Config中设置IP:source = tcp:< ip>,< pot number =">
例如:tcp:11.223.2.1,1143
2.没问题.当您发布网站时,它会处理所有资源
1. EF doesn''t matter. Set IP in Web Config: source = tcp:<ip>,<pot number="">
for ex: tcp:11.223.2.1,1143
2. no any problem. when you publish the website it handles all resourced


这篇关于静态IP到swicth想要使用本地sql服务器进行Web的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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