Tomcat 6.x 和 Apache 2.2.11 集群负载均衡搭建
本文根据 http://www.cnblogs.com/shiyangxt/archive/2009/02/26/1398902.html 整理,如有不明,请参阅原文。 所需软件: Apache 2.2.11 Tomcat 6.x压缩版(.zip, .tar等压缩格式的版本)。 2. 配置步骤: 1) 安装Apache 2.2.11。tomcat 集群负载均衡需要apache服务器来配合实现,所以我们需要安装apache。另外,由于apache 2.2.11已经集成了jk2等负载工具,这将简化我们的配置。可以用安装版或解压版安装apache。 如果用windows下安装版安装,根据向导填写相应参数即可完成。 如果用压缩版,需要将apache解压到一个目录下面,然后打开$APACHE_HOME/conf/httd.conf, 根据实际配置下面参数: #apache安装根目录 ServerRoot “D:/devCenter/cluster_lab/Apache2.2 " #端口 Listen 80 # ServerAdmin 邮件 #http文档根目录 DocumentRoot “D:/devCenter/cluster_lab/Apache2.2/htdocs” # # This should be changed to whatever you set DocumentRoot to. # <Directory “D:/devCenter/cluster_lab/Apache2.2/htdocs”> # # Possible values for the Options directive are “None”, “All”, # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that “MultiViews” must be named *explicitly* — “Options All” # doesn’t give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be “All”, “None”, or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all <IfModule alias_module> # directives as to Alias. ScriptAlias /cgi-bin/ “D:/devCenter/cluster_lab/Apache2.2/cgi-bin/” # # “D:/devCenter/cluster_lab/Apache2.2/cgi-bin” should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory “D:/devCenter/cluster_lab/Apache2.2/cgi-bin”> AllowOverride None Options None Order allow,deny Allow from all 2) 启动apache, 然后通过http://localhost/来测试,检查apache是否已经启动。 ...