请按照下面的步骤在 CLI 模式下配置反向代理。例如,创建一个配置 (config1) 以及一个作为反向代理的实例 (rp)。
启动 Administration Server:
$ <install-dir>/admin-server/bin/startserv
调用 CLI shell:
<install-dir>/admin-server/bin/wadm -user <username>
现在,将会看到 wadm shell
创建 config1:
wadm>create-config --http-port 8080 --server-name config1 --server-user root config1
为 config1 配置创建实例:
wadm>create-instance --config config1 <host-name>
在创建的配置中添加 Web 应用程序:
wadm>add-webapp --config config1 -vs config1 --uri/test <warfile>
部署 Web 应用程序
wadm> deploy-config --user=admin --password-file=admin.pwd --host=serverhost --port=8989 config1
创建 rp 配置:
wadm>create-config --http-port 8081 --server-name rp --server-user root rp
执行以下命令,以便将 rp 配置作为反向代理:
wadm>create-reverse-proxy --config rp --vs rp --uri-prefix/--server http://<host-name>:8080
为 rp 配置创建实例
wadm>create-instance --config rp <host-name>
启动实例:
wadm>start-instance --config config1 <host-name>
wadm>start-instance --config rp <hostname>
现在,可通过 rp 实例查看在 config1 中部署的 Web 应用程序。
http://<rp instance hostname>:8081/test