【发布时间】:2019-02-08 14:27:38
【问题描述】:
我有一个服务器设置,上面有 3 个项目,但在 ubuntu 的不同端口上运行,但 IP 相同。这是一个使用 sbt 工具编译并在端口上运行的 java 应用程序
x.x.x.x:7000
x.x.x.x:7001
x.x.x.x:7002
所以我想将域映射到这些端口,以便
x.x.x.x:7000 => admin.domain.com
x.x.x.x:7001 => users.domain.com
x.x.x.x:7002 => domain2.com
我安装了 apache2 并想用它做虚拟主机。问题是没有文档根,因为这些项目首先被编译并提供给端口..
我有这个
<VirtualHost x.x.x.x:7000>
ServerAdmin admin@oneshoppoint.com
ServerName www.admin.oneshoppoint.com
</VirtualHost>
主机文件
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
x.x.x.xmetadata.google.internal metadata
35.236.121.166:7000 admin.oneshoppoint.com
x.x.x.x yates.c.modified-badge-211108.internal yates # Added by Google
x.x.x.xmetadata.google.internal # Added by Google
虽然没用,有什么建议吗?
【问题讨论】:
-
呃,你的反向代理定义在哪里?
-
你的 /etc/hosts 配置是什么?
-
@Marged Hw 我要使用它吗?
-
@FrancescoSimeoli 我已经更新了问题并添加了它。请检查
-
不能在hosts文件中指定端口
标签: ubuntu apache2 virtualhost