- 浏览: 582746 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (174)
- JBPM (3)
- WWF (0)
- JavaScript (11)
- J2EE (40)
- OperationSystem (11)
- 数据库 (12)
- CSS (1)
- Ajax (2)
- J2SE (30)
- Tools (10)
- 服务器中间件 (3)
- 异常 (0)
- Flex (5)
- jQuery (11)
- html (9)
- Ejb (1)
- HTML5 Shiv–让该死的IE系列支持HTML5吧 (1)
- Spring (9)
- Quartz (3)
- log4j (1)
- maven (1)
- cpdetector (1)
- JSON (1)
- log4jdbc (1)
- asm (8)
- FusionCharts (1)
- jqplot (1)
- highcharts (1)
- excanvas (1)
- html5 (1)
- jpcap介绍 (1)
- weblogic (3)
- URLURLClassLoader (0)
- URLClassLoader (1)
- ant (2)
- ivy (2)
- nexus (1)
- IT (0)
- LoadRunner (1)
- SCSS (1)
- ruby (1)
- webstorm (1)
- typescript (1)
- Jboss7 (1)
- wildfly (1)
- oracle (5)
- esb (0)
- dubbo (2)
- zookeeper (3)
- eclipse (1)
- Android (2)
- Studio (1)
- Google (1)
- 微信 (1)
- 企业号 (1)
- Linux (13)
- Oracle12c (1)
- Hadoop (1)
- InletexEMC (1)
- Windows (1)
- Netty (3)
- Marshalling (2)
- Protobuf (1)
- gcc (1)
- Git (1)
- GitLab (1)
- shell (2)
- java (3)
- Spring4 (1)
- hibernate4 (1)
- postgresql (1)
- ApacheServer (2)
- Tomcat (2)
- ApacheHttpServer (2)
- realvnc (1)
- redhat (7)
- vncviewer (1)
- LVS (4)
- LVS-DR (1)
- RedHat6.5 (5)
- LVS-NAT (1)
- LVS-IPTUNNEL (2)
- LVS-TUN (1)
- keepalived (2)
- yum (1)
- iso (1)
- VMware (1)
- redhat5 (1)
- ha (1)
- nginx (2)
- proguard (1)
- Mat (1)
- DTFJ (1)
- axis2 (1)
- web service (1)
- centos (1)
- random (1)
- urandom (1)
- apache (1)
- IBM (1)
- cve (1)
- 漏洞 (1)
- JDBC (1)
- DataSource (1)
- jdk (1)
- tuxedo (2)
- wtc (1)
最新评论
-
skying007:
好资料,谢谢分享给啊
FusionCharts在服务器端导出图片(J2EE版) -
cgnnzg:
大神好 可以发一份源码给我学习么 多谢了 978241085 ...
springmvc+dubbo+zookeeper -
jifengjianhao:
求源码:854606899@qq.com
springmvc+dubbo+zookeeper -
wdloyeu:
shihuan8@163.com邮箱网盘在哪,没找到。能给份源 ...
Java Socket长连接示例代码 -
huangshangyuanji:
求代码:45613032@qq.com
springmvc+dubbo+zookeeper
Apache Http Server2.2采用ajp协议配置tomcat7负载均衡
http://httpd.apache.org/docs/2.2/install.html
http://httpd.apache.org/docs/2.2/programs/configure.html
192.168.1.177--->apache http server 2.2.31
192.168.1.178--->apache-tomcat-7.0.73
192.168.1.179--->apache-tomcat-7.0.73
ssh登录192.168.1.177
[root@apachehs opt]# vi /etc/hosts
192.168.1.177 apachehs
[root@apachehs opt]# yum install gcc
[root@apachehs opt]# yum install -y gcc gcc-c++
[root@apachehs opt]# yum -y install zlib-devel
[root@apachehs opt]# yum -y install openssl-devel
下面安装apr、apr-util、pcre
[root@apachehs opt]# tar -xvf apr-1.5.2.tar.gz
[root@apachehs opt]# cd apr-1.5.2
[root@apachehs apr-1.5.2]# vi configure
? $RM "$cfgfile"
添加#注释掉这一行
[root@apachehs apr-1.5.2]# ./configure --prefix=/usr/local/apr
[root@apachehs apr-1.5.2]# make && make install
[root@apachehs apr-1.5.2]# cd ..
[root@apachehs opt]# tar xvf apr-util-1.5.4.tar.gz
[root@apachehs opt]# cd apr-util-1.5.4
[root@apachehs apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-
apr=/usr/local/apr/bin/apr-1-config
[root@apachehs apr-util-1.5.4]# make && make install
[root@apachehs apr-util-1.5.4]# cd ..
[root@apachehs opt]# unzip pcre-8.38.zip -d /opt/
[root@apachehs opt]# cd pcre-8.38
[root@apachehs pcre-8.38]# vi configure
? $RM "$cfgfile"
添加#注释掉这一行
[root@apachehs pcre-8.38]# ./configure --prefix=/usr/local/pcre
[root@apachehs pcre-8.38]# make && make install
下面安装Apache Http Server
[root@apachehs src]# tar xvf httpd-2.2.32.tar.gz
[root@apachehs src]# cd httpd-2.2.32
[root@apachehs httpd-2.2.32]# vi configure
? "$ap_cv_void_ptr_lt_long"
if test "$ap_cv_void_ptr_lt_long" = "yes"; then
as_fn_error $? "Size of \"void *\" is less than size of \"long\"" "$LINENO" 5
fi
改成
if test "$ap_cv_void_ptr_lt_long" != "yes"; then
as_fn_error $? "Size of \"void *\" is less than size of \"long\"" "$LINENO" 5
fi
[root@apachehs httpd-2.2.32]# ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre --enable-module=so --enable-so --enable-authn-anon=shared --enable-authn-dbm=shared --enable-authz-dbm=shared --enable-auth-digest=shared --enable-cache=shared --enable-cern-meta=shared --enable-charset-lite=shared --enable-dav=shared --enable-dav-fs=shared --enable-dav-lock=shared --enable-deflate=shared --enable-disk-cache=shared --enable-expires=shared --enable-ext-filter=shared --enable-file-cache=shared --enable-headers=shared --enable-info=shared --enable-logio=shared --enable-mem-cache=shared --enable-mime-magic=shared --enable-isapi=shared --enable-proxy=shared --enable-proxy-ajp=shared --enable-proxy-balancer=shared --enable-proxy-connect=shared --enable-proxy-ftp=shared --enable-proxy-http=shared --enable-rewrite=shared --enable-speling=shared --enable-ssl=shared --enable-unique-id=shared --enable-usertrack=shared --enable-vhost-alias=shared --enable-bucketeer=shared --enable-case-filter=shared --enable-case-filter-in=shared --enable-echo=shared --enable-example=shared --enable-optional-fn-export=shared --enable-optional-fn-import=shared --enable-optional-hook-export=shared --enable-optional-hook-import=shared
[root@apachehs httpd-2.2.32]# make
[root@apachehs httpd-2.2.32]# make install
[root@apachehs httpd-2.2.32]# cd /usr/local/apache/conf
[root@apachehs conf]# ls
extra httpd.conf magic mime.types original
下面开始配置Apache Http Server
[root@apachehs local]# vi httpd.conf
找到#Listen 80...一行,在下面添加
Listen 192.168.1.177:10080
找到#ServerName ...一行,在下面添加
ServerName 192.168.1.177:10080
[root@apachehs conf]# vi /etc/httpd/conf/httpd.conf
添加
ServerName 192.168.1.177:10080
[root@apachehs conf]# cd /usr/local/apache/bin
[root@apachehs bin]# ./httpd -l
Compiled in modules:
core.c
mod_authn_file.c
mod_authn_default.c
mod_authz_host.c
mod_authz_groupfile.c
mod_authz_user.c
mod_authz_default.c
mod_auth_basic.c
mod_include.c
mod_filter.c
mod_log_config.c
mod_env.c
mod_setenvif.c
mod_version.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_cgi.c
mod_negotiation.c
mod_dir.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_so.c
[root@apachehs bin]# ./httpd -t -D DUMP_MODULES
Loaded Modules:
core_module (static)
authn_file_module (static)
authn_default_module (static)
authz_host_module (static)
authz_groupfile_module (static)
authz_user_module (static)
authz_default_module (static)
auth_basic_module (static)
include_module (static)
filter_module (static)
log_config_module (static)
env_module (static)
setenvif_module (static)
version_module (static)
mpm_prefork_module (static)
http_module (static)
mime_module (static)
status_module (static)
autoindex_module (static)
asis_module (static)
cgi_module (static)
negotiation_module (static)
dir_module (static)
actions_module (static)
userdir_module (static)
alias_module (static)
so_module (static)
Syntax OK
为Apache2.2添加mod_proxy模块:
先找到apache源码中modules/proxy目录并进入,然后使用bin/apxs进行编译安装。这里只是提供了安装扩展模块的方法,在实际安装过程中并没有执行,因为上面的安装过程已经安装了负载均衡的代理模块。
[root@apachehs ~]# cd /usr/local/src/httpd-2.2.31/modules/proxy
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy.c proxy_util.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_ajp.c ajp*.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_balancer.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_connect.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_http.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_ftp.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_scgi.c
-c表示进行编译,-i表示将生成的模块安装到apache的modules目录下,-a选项在httpd.conf中增加一条LoadModule指令以载入刚安装的模块,或者如
果此指令已存在,则启用之。
apxs会根据源码判断模块的名称,或者(在失败的情况下)根据文件名推测模块名称,可以用-n选项显式地指定模块名称。
安装成功以后将在apache的modules目录下生成mod_proxy.so文件,并且在httpd.conf中加入了一行
下面开始配置Apache Http Server
[root@apachehs home]# vi httpd.conf
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
找到#Listen 80...一行,在下面添加
Listen 192.168.1.177:10080
找到#ServerName ...一行,在下面添加
ServerName 192.168.1.177:10080
在文件的最后加上如下几行:
ProxyRequests Off
<Proxy balancer://clu>
BalancerMember ajp://192.168.1.178:8009 loadfactor=1
BalancerMember ajp://192.168.1.179:8009 loadfactor=1
</Proxy>
[root@apachehs conf]# vi extra/httpd-vhosts.conf
<VirtualHost *:10080>
# ServerAdmin shihuan830619@163.com
# DocumentRoot "/home/webserver/apache/docs/dummy-host.example.com"
ServerName 192.168.1.177:10080
# ServerAlias www.shihuan.example.com
ProxyPass / balancer://clu/ stickysession=JSESSIONID nofailover=On
ProxyPassReverse / balancer://clu/
ErrorLog "logs/cluster-error.log"
CustomLog "logs/custer-access.log" common
</VirtualHost>
[root@apachehs conf]# vi /etc/httpd/conf/httpd.conf
添加
ServerName 192.168.1.177:10080
[root@apachehs home]# /home/webserver/apache/bin/apachectl -k start
[root@apachehs home]# /home/webserver/apache/bin/apachectl -k stop
----------------------------------------------------------------------------------
ssh登录192.168.1.178
[root@tomcat1 home]# vi /etc/hosts
192.168.1.178 tomcat1
[root@tomcat1 home]# rpm -ivh jdk-7u80-linux-x64.rpm
[root@tomcat1 home]# vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.7.0_80
export PATH=$JAVA_HOME/bin:$PATH
[root@tomcat1 home]# source /etc/profile
[root@tomcat1 home]# java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
[root@tomcat1 home]# tar xvf apache-tomcat-8.0.32.tar.gz
[root@tomcat1 home]# cd apache-tomcat-8.0.32/conf
[root@tomcat1 conf]# vi server.xml
关注
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
[root@tomcat1 conf]# cd ../bin
[root@tomcat1 bin]# ./startup.sh
[root@tomcat1 bin]# ./shutdown.sh
----------------------------------------------------------------------------------
ssh登录192.168.1.179
[root@tomcat2 home]# vi /etc/hosts
192.168.1.179 tomcat2
[root@tomcat2 home]# rpm -ivh jdk-7u80-linux-x64.rpm
[root@tomcat2 home]# vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.7.0_80
export PATH=$JAVA_HOME/bin:$PATH
[root@tomcat2 home]# source /etc/profile
[root@tomcat2 home]# java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
[root@tomcat2 home]# tar xvf apache-tomcat-8.0.32.tar.gz
[root@tomcat2 home]# cd apache-tomcat-8.0.32/conf
[root@tomcat2 conf]# vi server.xml
关注
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
[root@tomcat2 conf]# cd ../bin
[root@tomcat2 bin]# ./startup.sh
[root@tomcat2 bin]# ./shutdown.sh
----------------------------------------------------------------------------------
最后启动测试两个tomcat和apacheserver,启动顺序不能错
[root@tomcat1 bin]# ./startup.sh
[root@tomcat2 bin]# ./startup.sh
[root@apachehs home]# /home/webserver/apache/bin/apachectl -k start
在浏览器的地址栏里输入 http://192.168.1.177:10080/
http://httpd.apache.org/docs/2.2/programs/configure.html
192.168.1.177--->apache http server 2.2.31
192.168.1.178--->apache-tomcat-7.0.73
192.168.1.179--->apache-tomcat-7.0.73
ssh登录192.168.1.177
[root@apachehs opt]# vi /etc/hosts
192.168.1.177 apachehs
[root@apachehs opt]# yum install gcc
[root@apachehs opt]# yum install -y gcc gcc-c++
[root@apachehs opt]# yum -y install zlib-devel
[root@apachehs opt]# yum -y install openssl-devel
下面安装apr、apr-util、pcre
[root@apachehs opt]# tar -xvf apr-1.5.2.tar.gz
[root@apachehs opt]# cd apr-1.5.2
[root@apachehs apr-1.5.2]# vi configure
? $RM "$cfgfile"
添加#注释掉这一行
[root@apachehs apr-1.5.2]# ./configure --prefix=/usr/local/apr
[root@apachehs apr-1.5.2]# make && make install
[root@apachehs apr-1.5.2]# cd ..
[root@apachehs opt]# tar xvf apr-util-1.5.4.tar.gz
[root@apachehs opt]# cd apr-util-1.5.4
[root@apachehs apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-
apr=/usr/local/apr/bin/apr-1-config
[root@apachehs apr-util-1.5.4]# make && make install
[root@apachehs apr-util-1.5.4]# cd ..
[root@apachehs opt]# unzip pcre-8.38.zip -d /opt/
[root@apachehs opt]# cd pcre-8.38
[root@apachehs pcre-8.38]# vi configure
? $RM "$cfgfile"
添加#注释掉这一行
[root@apachehs pcre-8.38]# ./configure --prefix=/usr/local/pcre
[root@apachehs pcre-8.38]# make && make install
下面安装Apache Http Server
[root@apachehs src]# tar xvf httpd-2.2.32.tar.gz
[root@apachehs src]# cd httpd-2.2.32
[root@apachehs httpd-2.2.32]# vi configure
? "$ap_cv_void_ptr_lt_long"
if test "$ap_cv_void_ptr_lt_long" = "yes"; then
as_fn_error $? "Size of \"void *\" is less than size of \"long\"" "$LINENO" 5
fi
改成
if test "$ap_cv_void_ptr_lt_long" != "yes"; then
as_fn_error $? "Size of \"void *\" is less than size of \"long\"" "$LINENO" 5
fi
[root@apachehs httpd-2.2.32]# ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre --enable-module=so --enable-so --enable-authn-anon=shared --enable-authn-dbm=shared --enable-authz-dbm=shared --enable-auth-digest=shared --enable-cache=shared --enable-cern-meta=shared --enable-charset-lite=shared --enable-dav=shared --enable-dav-fs=shared --enable-dav-lock=shared --enable-deflate=shared --enable-disk-cache=shared --enable-expires=shared --enable-ext-filter=shared --enable-file-cache=shared --enable-headers=shared --enable-info=shared --enable-logio=shared --enable-mem-cache=shared --enable-mime-magic=shared --enable-isapi=shared --enable-proxy=shared --enable-proxy-ajp=shared --enable-proxy-balancer=shared --enable-proxy-connect=shared --enable-proxy-ftp=shared --enable-proxy-http=shared --enable-rewrite=shared --enable-speling=shared --enable-ssl=shared --enable-unique-id=shared --enable-usertrack=shared --enable-vhost-alias=shared --enable-bucketeer=shared --enable-case-filter=shared --enable-case-filter-in=shared --enable-echo=shared --enable-example=shared --enable-optional-fn-export=shared --enable-optional-fn-import=shared --enable-optional-hook-export=shared --enable-optional-hook-import=shared
[root@apachehs httpd-2.2.32]# make
[root@apachehs httpd-2.2.32]# make install
[root@apachehs httpd-2.2.32]# cd /usr/local/apache/conf
[root@apachehs conf]# ls
extra httpd.conf magic mime.types original
下面开始配置Apache Http Server
[root@apachehs local]# vi httpd.conf
找到#Listen 80...一行,在下面添加
Listen 192.168.1.177:10080
找到#ServerName ...一行,在下面添加
ServerName 192.168.1.177:10080
[root@apachehs conf]# vi /etc/httpd/conf/httpd.conf
添加
ServerName 192.168.1.177:10080
[root@apachehs conf]# cd /usr/local/apache/bin
[root@apachehs bin]# ./httpd -l
Compiled in modules:
core.c
mod_authn_file.c
mod_authn_default.c
mod_authz_host.c
mod_authz_groupfile.c
mod_authz_user.c
mod_authz_default.c
mod_auth_basic.c
mod_include.c
mod_filter.c
mod_log_config.c
mod_env.c
mod_setenvif.c
mod_version.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_cgi.c
mod_negotiation.c
mod_dir.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_so.c
[root@apachehs bin]# ./httpd -t -D DUMP_MODULES
Loaded Modules:
core_module (static)
authn_file_module (static)
authn_default_module (static)
authz_host_module (static)
authz_groupfile_module (static)
authz_user_module (static)
authz_default_module (static)
auth_basic_module (static)
include_module (static)
filter_module (static)
log_config_module (static)
env_module (static)
setenvif_module (static)
version_module (static)
mpm_prefork_module (static)
http_module (static)
mime_module (static)
status_module (static)
autoindex_module (static)
asis_module (static)
cgi_module (static)
negotiation_module (static)
dir_module (static)
actions_module (static)
userdir_module (static)
alias_module (static)
so_module (static)
Syntax OK
为Apache2.2添加mod_proxy模块:
先找到apache源码中modules/proxy目录并进入,然后使用bin/apxs进行编译安装。这里只是提供了安装扩展模块的方法,在实际安装过程中并没有执行,因为上面的安装过程已经安装了负载均衡的代理模块。
[root@apachehs ~]# cd /usr/local/src/httpd-2.2.31/modules/proxy
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy.c proxy_util.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_ajp.c ajp*.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_balancer.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_connect.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_http.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_ftp.c
[root@apachehs proxy]# /usr/local/apache/bin/apxs -c -i -a mod_proxy_scgi.c
-c表示进行编译,-i表示将生成的模块安装到apache的modules目录下,-a选项在httpd.conf中增加一条LoadModule指令以载入刚安装的模块,或者如
果此指令已存在,则启用之。
apxs会根据源码判断模块的名称,或者(在失败的情况下)根据文件名推测模块名称,可以用-n选项显式地指定模块名称。
安装成功以后将在apache的modules目录下生成mod_proxy.so文件,并且在httpd.conf中加入了一行
下面开始配置Apache Http Server
[root@apachehs home]# vi httpd.conf
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
找到#Listen 80...一行,在下面添加
Listen 192.168.1.177:10080
找到#ServerName ...一行,在下面添加
ServerName 192.168.1.177:10080
在文件的最后加上如下几行:
ProxyRequests Off
<Proxy balancer://clu>
BalancerMember ajp://192.168.1.178:8009 loadfactor=1
BalancerMember ajp://192.168.1.179:8009 loadfactor=1
</Proxy>
[root@apachehs conf]# vi extra/httpd-vhosts.conf
<VirtualHost *:10080>
# ServerAdmin shihuan830619@163.com
# DocumentRoot "/home/webserver/apache/docs/dummy-host.example.com"
ServerName 192.168.1.177:10080
# ServerAlias www.shihuan.example.com
ProxyPass / balancer://clu/ stickysession=JSESSIONID nofailover=On
ProxyPassReverse / balancer://clu/
ErrorLog "logs/cluster-error.log"
CustomLog "logs/custer-access.log" common
</VirtualHost>
[root@apachehs conf]# vi /etc/httpd/conf/httpd.conf
添加
ServerName 192.168.1.177:10080
[root@apachehs home]# /home/webserver/apache/bin/apachectl -k start
[root@apachehs home]# /home/webserver/apache/bin/apachectl -k stop
----------------------------------------------------------------------------------
ssh登录192.168.1.178
[root@tomcat1 home]# vi /etc/hosts
192.168.1.178 tomcat1
[root@tomcat1 home]# rpm -ivh jdk-7u80-linux-x64.rpm
[root@tomcat1 home]# vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.7.0_80
export PATH=$JAVA_HOME/bin:$PATH
[root@tomcat1 home]# source /etc/profile
[root@tomcat1 home]# java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
[root@tomcat1 home]# tar xvf apache-tomcat-8.0.32.tar.gz
[root@tomcat1 home]# cd apache-tomcat-8.0.32/conf
[root@tomcat1 conf]# vi server.xml
关注
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
[root@tomcat1 conf]# cd ../bin
[root@tomcat1 bin]# ./startup.sh
[root@tomcat1 bin]# ./shutdown.sh
----------------------------------------------------------------------------------
ssh登录192.168.1.179
[root@tomcat2 home]# vi /etc/hosts
192.168.1.179 tomcat2
[root@tomcat2 home]# rpm -ivh jdk-7u80-linux-x64.rpm
[root@tomcat2 home]# vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.7.0_80
export PATH=$JAVA_HOME/bin:$PATH
[root@tomcat2 home]# source /etc/profile
[root@tomcat2 home]# java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
[root@tomcat2 home]# tar xvf apache-tomcat-8.0.32.tar.gz
[root@tomcat2 home]# cd apache-tomcat-8.0.32/conf
[root@tomcat2 conf]# vi server.xml
关注
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
[root@tomcat2 conf]# cd ../bin
[root@tomcat2 bin]# ./startup.sh
[root@tomcat2 bin]# ./shutdown.sh
----------------------------------------------------------------------------------
最后启动测试两个tomcat和apacheserver,启动顺序不能错
[root@tomcat1 bin]# ./startup.sh
[root@tomcat2 bin]# ./startup.sh
[root@apachehs home]# /home/webserver/apache/bin/apachectl -k start
在浏览器的地址栏里输入 http://192.168.1.177:10080/
相关推荐
【Apache2.2和Tomcat7集成负载均衡】 在现代Web应用环境中,为了提供高可用性和性能优化,经常需要将HTTP服务器(如Apache)与应用服务器(如Tomcat)进行集成,并实现负载均衡。Apache2.2和Tomcat7的集成能够充分...
在Windows环境下,Apache2.2和Tomcat6的组合是一个常见的Web服务器架构,用于搭建集群、实现负载均衡和处理session共享。Apache作为前端反向代理服务器,负责分发请求到后端的多个Tomcat实例,以提高应用的可用性和...
Apache2.2与Tomcat6.0的组合可以构建一个高效、可靠的负载均衡服务器系统,以分散客户端请求到多个后端应用服务器,提高整体服务的可用性和响应速度。以下是搭建和配置的关键步骤及知识点: 1. **Apache2.2安装配置...
总结来说,Apache2.2与Tomcat7集群配置涉及的技术主要包括Apache的mod_jk模块、集群理论、负载均衡策略、会话复制、故障转移以及相关配置文件的设置。熟练掌握这些知识点,对于构建高性能的Java Web服务至关重要。
- 负载均衡:如果负载较大,可以配置多个Tomcat实例,使用Apache的负载均衡模块分发请求。 - Caching:使用缓存模块如mod_expires和mod_cache,提高静态内容的响应速度。 - JNDI资源:在Tomcat中配置JNDI资源,使...
mod_proxy_ajp则是Apache 2.2及以上版本的内置模块,同样支持AJP协议。这两种模块都允许Apache直接将请求传递给Tomcat,而无需通过HTTP,从而减少了网络延迟,提高了性能。 1. mod_jk:安装并配置mod_jk模块后,...
### Apache+mod_jk+Tomcat负载均衡配置详解 #### 一、背景介绍 随着互联网技术的迅猛发展,单一服务器已经难以满足日益增长的服务需求。负载均衡技术应运而生,成为提高服务可用性和扩展性的关键手段之一。本文将...
在Apache Tomcat与Apache HTTP Server的集成中,一般不需要这个文件,除非你使用了特定的负载均衡或反向代理解决方案,如 mod_jk 或 mod_proxy_ajp。这些模块允许Apache和Tomcat之间通过AJP协议通信,`uriworkermap....
标题中的“tomcat7+apache2.2集群、负载均衡”指的是使用Apache HTTP Server 2.2.16与Tomcat 7.0.41构建的集群环境,通过负载均衡技术来分发请求,提高服务的可用性和响应速度。在这样的集群中,Apache作为前端...
本文将详细介绍如何在Apache Tomcat 7.0和Apache 2.2环境下配置负载均衡,并实现session复制。 **环境配置** 1. 安装JDK1.6:首先确保安装了Sun JDK 1.6,将其安装在默认路径,例如`C:\Program Files\Java\jdk1.6.0...
总的来说,Apache2.2+Tomcat6.0的负载均衡配置通过利用Apache的mod_jk模块,实现了对多个Tomcat实例的负载均衡,提高了Web服务的可用性和性能。这种配置在大型网站和企业级应用中非常常见,以应对大量并发请求。
3. **负载均衡配置**:为了提高系统的可用性和性能,可以通过负载均衡来分发请求。这里以简单的轮询方式为例,配置两个 Tomcat 实例: ```apacheconf BalancerMember ajp://127.0.0.1:8009/loadfactor=1 ...
5. 设置粘性session,可能需要配置负载均衡器或者在Apache中使用mod_proxy_ajp模块。 通过以上配置,我们可以创建一个能够处理高并发、提供session一致性且易于扩展的Web服务架构。这种架构对于大型网站或企业级...
Apache 2.4 和 Tomcat 7 的整合配置主要依赖于 mod_jk 模块,这是一个 Apache HTTP 服务器的模块,用于与 Tomcat 进行负载均衡和通信。`mod_jk.so` 是该模块的动态链接库文件,用于在 Apache 和 Tomcat 之间建立连接...