且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当通过VPN将PHP应用程序连接到MSSQL时,我应该考虑什么?

更新时间:2023-10-22 20:23:40

有没有其他方法可以做到吗? SSL可能吗?

Is there any other way you could do it? SSL perhaps? Nevertheless, my view on the subject.


延迟:我应该得到多少钱?会不会疯狂?是否会中断我的申请?

Latency: How much should I expect? Will it vary wildly? Will it "break my application"?

取决于连接本身和一些各种因素。例如,我们在我们的两个办事处之间运行24/7的OpenVPN连接,即使在高峰期(重P2P流量,不要问:)连接是稳定的,没有观察到很多延迟。我们不时遇到的唯一问题是ISP问题。当一个人下来,工作停止一边。你需要考虑它并实现某种故障安全机制。如果没有,您的应用程序将中断。

Depends on the connection itself and some various factors. For example, we have an OpenVPN connection between our two offices running 24/7, even during high peaks (heavy P2P traffic, don't ask :) the connection is stable and not much latency is observed. The only problem we are experiencing from time to time are ISP issues. When one goes down, work stops for one side. You need to take it into account and implement some sort of fail safe mechanism. If not, your application will "break".


关闭连接:我应该期望我的连接只保持打开吗?

Closed connection: Should I expect my connection to just stay open? Is reopening it in PHP trivial/fast enough?

我不建议PHP应用程序处理VPN连接,它应该专注于确保业务逻辑正常工作,并在网络/服务器上保留所有连接处理。如果你把所有这些逻辑应用到应用程序,如果VPN连接改变,你将需要重写它。呼叫我懒惰,但我喜欢抽象:)

I don't recommend PHP application handling VPN connection, it should focus on making sure business logic works properly and leave all connection handling on the networking/server. If you are to put all this logic into application and if VPN connection changes, you will need to rewrite it. Call me lazy, but I like abstraction :)


VPN客户端配置:这是非常困难吗?是否有更多的服务器设置需要更改,除了打开端口?

VPN client configuration: Is this going to extremely difficult? Are there more server settings that need changing besides opening a port?

难以回答这一个,因为没有关于VPN客户端的信息/服务器使用,也不是任何VPN服务器配置。它可以像打开港口一样简单,或像没有任何先前的做法,跑马拉松一样困难。

Hard to answer this one as there is no information on the VPN client/server used, nor any VPN server configuration. It can be as easy as opening the port or as hard as running a marathon without any prior practice.


在PHP中连接到数据库:是否需要执行特殊步骤,因为它是通过VPN?

Connecting to DB in PHP: Are there special steps I must take because it's over a VPN?

你不应该,只要确保连接后DB是可访问的。你会亲的

You shouldn't, just make sure DB is accessible once connected. You will pro