快速入門操作手冊

簡介

此文件說明 Web 伺服器端上 JK 使用的組態檔,適用於「急躁」使用者。

  • workers.properties 是 Web 伺服器使用的強制性檔案,且適用於所有 JK 實作(Apache HTTP 伺服器的 mod_jk、Microsoft IIS 的 ISAPI)。
  • Web 伺服器附加元件設定在 Web 伺服器端。

我們將在此提供最低伺服器組態和範例 workers.properties,以便您能快速安裝和檢查組態。

最低 workers.properties

以下是最低的 workers.properties,僅使用 ajp13 將 Web 伺服器連線到 Tomcat 引擎,完整文件可在 工作程序操作手冊 中取得。

# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

最低 Apache HTTP 伺服器組態

以下是 Apache 組態的一些非常基本資訊,可取得更完整的 Apache 操作手冊

您應先在 Apache 模組目錄中安裝 mod_jk.so(unix)或 mod_jk.dll(Windows)(請參閱 Apache 文件以找出位置)。

Unix 上模組目錄的常見位置

  • /usr/lib/apache/
  • /usr/lib/apache2/
  • /usr/local/apache/libexec/
  • /usr/local/apache/modules/

Windows 上模組目錄的常見位置

  • C:\Program Files\Apache Group\Apache\modules\
  • C:\Program Files\Apache Group\Apache2\modules\

您可以在 此處 找到預先建置的二進位檔連結

以下是應直接設定在 httpd.conf 中或從其他檔案包含的最小值

Unix 上的組態目錄常見位置

  • /etc/httpd/conf/
  • /etc/httpd2/conf/
  • /usr/local/apache/conf/

Windows 上的組態目錄常見位置

  • C:\Program Files\Apache Group\Apache\conf\
  • C:\Program Files\Apache Group\Apache2\conf\

# Load mod_jk module
# Update this path to match your modules location
LoadModule    jk_module  modules/mod_jk.so
# Declare the module for <IfModule directive> (remove this line for Apache 2.x)
AddModule     mod_jk.c
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile /etc/httpd/conf/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile     /var/log/httpd/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile     /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel    info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# Send everything for context /examples to worker named worker1 (ajp13)
JkMount  /examples/* worker1

Microsoft IIS 最小組態

提供一份針對 Microsoft IIS 網路伺服器的 HowTo

即將新增更多資訊!

測試組態

(重新)啟動網路伺服器並瀏覽至 https://127.0.0.1/examples/