如何最小化开发服务器和生产服务器之间的差异?
很多时候,我们在自己的个人系统中构建 Web 应用程序,并使用 WAMP、XAMPP 等软件包中的本地服务器。但是,我们系统上的配置很难与托管该应用程序的服务器 100% 匹配。这大大增加了调试的复杂性。特别是当您托管的服务器配置为隐藏错误时。依靠错误日志来调试所有内容是一个令人不舒服的选择,而且也不能保证可用。
我们可以采取哪些措施来尽量减少这种差异?
你们可能会说,这取决于网络服务器,因为服务器之间的配置可能不同。即使在这种情况下,或者在共享托管中,我也想知道在托管应用程序甚至开始构建应用程序之前要采取的指示。
Lots of time, We build a web application in our own personal system, with a local server that comes in packages like WAMP, XAMPP. But, the configuration we have on our system hardly matches 100% with the server where we host that application. This adds up to the debugging complexity a lot. Specially when the server you host is configured to hide the errors. Relying on error logs to debug everything, is a uncomfortable options, which is also not guaranteed to be available.
What are the measures we can take to minimise such differences?
You guys might say, it depends on web server as the configuration might be different from server to server. Even in this case, or shared hosting, I would like to know of the pointers to take, before hosting a application or even start building it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们使用的临时服务器是我们的部署服务器的克隆。通过登台服务器(使用版本控制)运行代码既快速又可靠,可以确保新代码/代码更改在实时环境中按预期工作。
也就是说,我们使用 Ubuntu 服务器,我也选择使用 Ubuntu 作为我的开发环境,这让事情变得更加容易。
We use a staging server that is a clone of our deployment server. Running code by the staging server (using version control) is both fast and a reliable way to ensure that the new code/code changes work as expected on the live environment.
That said, we use Ubuntu servers and I've opted to use Ubuntu as my development environment as well, makes stuff so much easier.