httpd+tomcat负载均衡
2015-12-03 14:30
645 查看
Windows Apache + Tomcat 负载均衡
环境准备
jdk 1.6apache 2.2.* (解压版)
tomcat 6,7,8 (解压版)
设置java环境变量: JAVA_HOME='到bin目录之前的路径,不要有符号结尾'; PATH 前追加 '%JAVA_HOME%\bin;'解压版tomcat会用到这两个环境变量 [tomcat下载](http://tomcat.apache.org)选择 Deployer 版本 zip 下载, 解压后直接 运行 bin\startup.bat运行 [apache下载](http://httpd.apache.org/download.cgi) apache(httpd)官方不提供windows版下载 可以网上查找 解压版本
apache + 1个 tomcat运行
apache整合tomcat必须要有Tomcat Connectors (mod_jk) 的支持 在tomcat官网Tomcat Connectors处下载 jakarta-tomcat-connectors-jk2.0.2-win32-apache1.3.27.zip 解压后将 mod_jk.so 文件拷贝到 apache modules目录下# 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
# The advanced router LB worker worker.list=router worker.router.type=lb worker.router.balance_workers=worker1,worker2 # Define the first member worker worker.worker1.type=ajp13 worker.worker1.host=localhost worker.worker1.port=8009 # Define preferred failover node for worker1 #worker.worker1.redirect=worker2 # Define the second member worker worker.worker2.type=ajp13 worker.worker2.host=localhost worker.worker2.port=8010 # Disable worker2 for all requests except failover #worker.worker2.activation=disabled
# Load mod_jk module # Update this path to match your modules location LoadModule jk_module C:\Apache22\modules\mod_jk.so # Where to find workers.properties # Update this path to match your conf directory location (put workers.properties next to httpd.conf) JkWorkersFile C:\Apache22\conf\workersBalancer.properties # Where to put jk logs # Update this path to match your logs directory location (put mod_jk.log next to access_log) JkLogFile C:\Apache22\logs\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 /* router
相关文章推荐
- Apache Rewrite 规则详解
- Apache HTTP Server 与 Tomcat 的三种连接方式介绍
- PHP@Linux vs MS-SQL Server database (using FreeTDS)
- Httpd服务
- linux httpd apache程序启动出错
- httpd: Could not reliably determine the server's fully qualified domain name
- [Q&A] 初次yum安装httpd 遇到的问题
- Centos6.0之httpd+heartbeat+nfs实现httpd热备及资源统一管理
- 服务器大量报400错误
- Linux下 Apache Httpd服务器安装
- selinux未禁用导致httpd无法使用非80等默认端口
- TinyHTTPD
- Apach httpd-2.2.21 多个端口映射到8080
- windows 不能在本地计算机启动apache2.2
- linux下LAMP环境手工搭建
- 原来天真的认为apache的访问控制的方法一直不会变,但2.4.6和2.0.52确实有区别,why change?
- worker模式的探究
- PHP+win+tomcat+mysql+httpd环境搭建记录2
- linux 根据端口查找进程号
- 把Apache Httpd 转换为系统服务