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

在 CLI 模式下將 Web 伺服器當做反向代理伺服器

請依照下列步驟,以 CLI 模式配置反向代理伺服器。例如,我們將建立配置 config1,並建立實例 rp 做為反向代理伺服器。

  1. 啟動管理伺服器:

    $ <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