apache - 单个域的多个 IP
问题描述
我正在托管具有相同域和子域的多个应用程序。让我们同意有 3 个应用程序具有这些服务器配置和一个 mywebsite.com 域
server1 ip is 123.234.345.23 ,and the app is located on app.mywebsite.com
server2 ip is 12.222.88.222 ,and the app is located on test.mywebsite.com
server1 ip is 123.123.123.23 ,and the app is located on mywebsite.com
我像这样在 3 台服务器上创建了一个虚拟主机配置
<VirtualHost *:80>
ServerAdmin contacts@myemail.com
ServerName mywebsite.com
ServerAlias www.mywebsite.com
DocumentRoot /var/www/html/mywebsite
<Directory /var/www/html/mywebsite>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/mywebsite.com_error.log
CustomLog ${APACHE_LOG_DIR}/mywebsite.com_access.log combined
</VirtualHost>
我已经使用域的 DNS 配置了 3 个 IP 地址。server1 dns
Type: A, Name: @, Value: 123.234.345.23
Type: A, Name: *, Value: 123.234.345.23
server2 dns
Type: A, Name: @, Value: 12.222.88.222
Type: A, Name: *, Value: 12.222.88.222
server3 dns
Type: A, Name: @, Value: 123.123.123.23
Type: A, Name: *, Value: 123.123.123.23
当我尝试访问 server2 和 server3 时,它总是将我重定向到 server1。我该如何解决这个问题?请注意,我没有进行负载平衡,它只是根据需要进行重定向。
解决方案
推荐阅读
- python - 如何修复变换透视功能错误地以错误的方向返回图像
- javascript - 引用具有未定义值的变量
- here-api - HERE Maps Mobile SDK 导航和 Xamarin
- sql-server - 带有最近添加的关键字的 SQL Server 函数如何支持旧版本的 SQL Server
- postgresql - postgresql - 如何在聚合表和连接表输出中显示空值?
- python - Python Pandas - 根据多个条件清理数据列
- sml - 来自 2 个列表 SML 的交替元素
- objective-c - 从 Swift 访问 Objective-C #define 常量
- python - 仅使用列表列表中的某些项目创建 dict
- laravel - 如何在 eloquent 的子查询函数中使用“Select()”