Sun Java System Web Server 7.0 Update 3 管理员指南

在 CLI 模式下将 Web Server 用作反向代理

请按照下面的步骤在 CLI 模式下配置反向代理。例如,创建一个配置 (config1) 以及一个作为反向代理的实例 (rp)。

  1. 启动 Administration Server:

    $ <install-dir>/admin-server/bin/startserv

  2. 调用 CLI shell:

    <install-dir>/admin-server/bin/wadm -user <username>

    现在,将会看到 wadm shell

  3. 创建 config1

    wadm>create-config --http-port 8080 --server-name config1 --server-user root config1

  4. config1 配置创建实例:

    wadm>create-instance --config config1 <host-name>

  5. 在创建的配置中添加 Web 应用程序:

    wadm>add-webapp --config config1 -vs config1 --uri/test <warfile>

  6. 部署 Web 应用程序

    wadm> deploy-config --user=admin --password-file=admin.pwd --host=serverhost --port=8989 config1

  7. 创建 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

  8. rp 配置创建实例

    wadm>create-instance --config rp <host-name>

  9. 启动实例:

    wadm>start-instance --config config1 <host-name>

    wadm>start-instance --config rp <hostname>

现在,可通过 rp 实例查看在 config1 中部署的 Web 应用程序。

http://<rp instance hostname>:8081/test