简体   繁体   English

设置动态服务器

[英]setting up a dynamic server

Hi I'm a web developer working in a start-up company who works on a mobile app (iOS and Android) the app have a db on a web platform and I want to make a static mid server which will send the clients the address (on login) they should work with. 嗨,我是一家在一家初创公司工作的网络开发人员,他在移动应用程序(iOS和Android)上工作,该应用程序在网络平台上具有数据库,我想制作一个静态的中间服务器,它将向客户发送地址(登录时)他们应该一起使用。 for example if the client need to make HTTP requestst to the address xx.yy.zz he will first ask for it from a static address lets say aa.bb.cc (that basiaclly means that if the address for http requests is being changed it's value should only need to be changed in aa.bb.cc and not on the client side - which dont need to upgrade or do nothing). 例如,如果客户端需要向地址xx.yy.zz发出HTTP请求,他首先会从一个静态地址中请求它,例如说aa.bb.cc(这意味着如果http请求的地址被更改,值仅应在aa.bb.cc中进行更改,而无需在客户端上进行更改-无需升级或不执行任何操作)。

any suggestions, comments, ways to implemet ,guides etc we be highly appreciated, tnx in advance =) 任何建议,评论,实现方式,指南等,我们都非常感谢,提前tnx =)

ps it's quite similar to proxy the only difference is im not saving cache but managing a db. ps与代理非常相似,唯一的区别是不保存缓存而是管理数据库。

I do not understand what your problem is. 我不明白您的问题是什么。 If you send the client the address xx.yy.zz it should use for further server-communication, the client simply has to store that xx.yy.zz somewhere and then use it as the server-address to connect to. 如果将地址xx.yy.zz发送给客户端,该地址应用于进一步的服务器通信,则客户端只需将xx.yy.zz存储在某个地方,然后将其用作连接的服务器地址。 So perhaps you want to know how to store the address? 那么,也许您想知道如何存储地址? In Android you can store it in the Preferences or keep it in a variable in your Application and so on... there's plenty of examples how to store some data for the apps lifetime. 在Android中,您可以将其存储在“首选项”中,或将其保留在应用程序的变量中,依此类推……有很多示例说明了如何在应用程序生命周期内存储一些数据。

Your question is very useful and right. 您的问题非常有用且正确。 Actually it happens in every application having some server access. 实际上,它发生在每个具有某些服务器访问权限的应用程序中。 The concept is called webserver-appserver configuration and this is useful as per the security concerns also. 该概念称为“ webserver-appserver配置”,并且从安全性角度考虑也很有用。

Application should not go directly to your AppServer it may be risky some times. 应用程序不应直接进入您的AppServer,这有时可能会有风险。 So what you can do make an Apache webserver as your static server and put your Application Server behind a firewall.So while making a request from device, what device has to know only the webserver IP and port and then the webserver have a configuration file to redirect the request to your Application Server (with IP and port) that will be unknown for the device. 因此,您可以将Apache Web服务器用作静态服务器,并将您的Application Server置于防火墙之后。因此,在从设备发出请求时,什么设备必须只知道Web服务器的IP和端口,然后Web服务器才具有配置文件即可将请求重定向到您的应用服务器(具有IP和端口),该请求对于设备是未知的。

Go through this url for better understanding of redirection from Apache Web Server to another server, not a big task you just need to edit the configuration files: 浏览此URL以更好地了解从Apache Web服务器到另一台服务器的重定向,这不是一项大的任务,您只需要编辑配置文件即可:

http://library.linode.com/web-servers/apache/configuration/redirecting-urls http://library.linode.com/web-servers/apache/configuration/redirecting-urls

if you want security for your appserver its better not to use the default port(8080) between webserver and appserver use some specified port and open them only for communication(take request from webserver sending the response) between them not all. 如果您想为您的应用服务器提供安全性,最好不要在网络服务器和应用服务器之间使用默认端口(8080),并且使用某些指定端口并仅将它们打开以进行通信(从网络服务器获取请求以发送响应),而不是全部打开。

and if you want know more about security and ports go through this: 如果您想进一步了解安全性和端口,请遵循以下步骤:

http://www.grouppolicy.biz/2010/07/how-to-manage-windows-firewall-settings-using-group-policy/ http://www.grouppolicy.biz/2010/07/how-to-manage-windows-firewall-settings-using-group-policy/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM