如何将 Capistrano 与位于防火墙后面的服务器一起使用?
我有一点情况。 我已经阅读了大约 41 个关于 Capistrano 的不同教程/书籍/视频,但没有一个涉及异常情况。 他们都假设简单的设置——根据我的经验,这种情况很少见。
基本上我的情况如下:
1)我正在家里的系统上开发应用程序
2)我的目标是在公司路由器后面运行的办公室服务器上运行应用程序。 我已将所有适当的端口(21、22、80、3000 等)转发到计算机,因此就外部通信而言一切都很好。
3) 我使用 GIT 进行版本控制,并将更新推送到服务器本身。
我的困惑来自两个方面:
1)如何识别 Capistrano 配方中所有适当的角色? 我是基于外部 IP 还是内部 IP?
2) 我如何告诉 Capistrano 在同一台机器上本地查找(而不是尝试跳出)GIT 存储库? 当然,这是假设 Capistrano 在服务器上执行任何操作。
注意:我面临的一个大问题是办公室中没有一台机器可以从网络内部访问主 IP——据说是为了防止 DOS 和各种其他麻烦——所以如果由于某种原因服务器需要假装信息位于外部计算机上,但实际上它是本地的,这是行不通的。
I have a bit of a situation. I've consumed about fourty-eleven different tutorials/books/videos on Capistrano, and none of them touch on out-of-the-norm cases. They all assume straightforward setups -- which, in my experience, is rarely the case.
Basically my situation is as follows:
1) I am developing the application on a system at home
2) My goal is to run the application on a server at the office running behind the company router. I have all the appropriate ports (21,22,80,3000,etc) forwarded to the machine so all is well as far as outside communication.
3) I'm using GIT for version control, and I PUSH my updates to the server itself.
My confusion comes in two areas:
1) How do I identify all the appropriate roles in the Capistrano recipe? Do I base them on the external IP or the internal?
2) How do I tell Capistrano to look locally (instead of trying to bounce out) on the same machine for the GIT repository? Of course, this assumes that Capistrano does anything at all from the server.
NOTE: One of the big issues I'm facing is the fact that none of the machines in the office can access the main IP from inside the network -- supposedly a protection from DOS and various other troubles -- so if for some reason the server needs to pretend the information is on an external machine when it's really local, it won't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您需要查看 ':deploy_via' 命令; 特别是“复制”:
http://www.capify.org/index.php/Understanding_Deployment_Strategies
将您的家庭计算机视为远程计算机,将服务器视为本地计算机,这需要本地副本进行部署。
I think you need to look at the ':deploy_via' command; specifically 'copy':
http://www.capify.org/index.php/Understanding_Deployment_Strategies
Consider your home computer as remote, and the server as local, and this takes a local copy for the deployment.