简体   繁体   English

如何在不为特定域提供服务的情况下向Apache发送特定域的请求?

[英]How do I send requests for a specific domain to Apache without it serving that domain yet?

I have an AWS EC2 server that hosts 3 domains with Apache 2. This server sits behind an AWS ELB load balancer which sends it requests. 我有一台托管有Apache 2的3个域的AWS EC2服务器。该服务器位于发送请求的AWS ELB负载均衡器的后面。 If I want to update this server, instead of taking the server down, I can create a new identical EC2 server and install all the software using the same scripts that built the first server and when it is ready I can add the new server to the ELB and then remove the old server. 如果要更新此服务器,而不是关闭服务器,则可以创建一个新的相同EC2服务器,并使用与构建第一个服务器相同的脚本安装所有软件,并在准备就绪时将新服务器添加到该服务器中。 ELB,然后删除旧服务器。 This gives me zero downtime which is great. 这给了我零停机时间,这很棒。

But before I remove the old server how do test the new server to prove everything is working and it is serving those 3 domains? 但是,在删除旧服务器之前,如何测试新服务器以证明一切正常,并且正在为这3个域提供服务? DNS points to the ELB for these domains, the ELB sendsthe requests to the server, and the Apache install on the server routes the traffic to the appropriate site depending on what subdomain was requested. DNS指向这些域的ELB,ELB将请求发送到服务器,服务器上的Apache安装根据请求的子域将流量路由到适当的站点。 Is there a way make a request to the new server via IP address since that is the only way to address it before it is behind the ELB but tell it I want to make a request to a specific subdomain? 有没有一种方法可以通过IP地址向新服务器发出请求,因为这是在ELB后面解决该问题的唯一方法,但告诉我要向特定子域发出请求? If not how else can I prove all 3 sites are running and working properly without just adding it to the ELB, removing the old server, and crossing my fingers? 如果不是,我怎么能证明所有3个站点都在正常运行,而又不只是将其添加到ELB中,删除旧服务器并用力过?

PS Sorry for the poor title. PS对不起,标题不好。 Please edit it if you can think of a better one that better represents what I am asking. 如果您能想到一个更好的代表我所要求的更好的东西,请对其进行编辑。

Use ELB healthcheck to perform the check. 使用ELB运行状况检查执行检查。 I recommend you to enable Apache server status mod. 我建议您启用Apache服务器状态模块。 Use health check against /server-status and if it returns 200 for certain period of time, ELB will mark the instance as active and healthy. 对/ server-status使用运行状况检查,如果在一定时间内返回200,ELB会将实例标记为活动且运行状况良好。

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

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