JBoss+Apache集群配置Word文档格式.docx
《JBoss+Apache集群配置Word文档格式.docx》由会员分享,可在线阅读,更多相关《JBoss+Apache集群配置Word文档格式.docx(12页珍藏版)》请在冰点文库上搜索。
name="
jboss.web"
defaultHost="
localhost"
>
修改为:
jvmRoute="
node1"
其中jvmRoute是用来让apache识别的节点名称,一个节点一个名称,注意不要有重复的(可以结合IP设置)。
同理编辑192.168.0.3的%JBoss_Home%\server\default\deploy\jbossweb-tomcat55.sar\server.xml
注意把jvmRoute设置为node2,可以设置成别的只要和192.168.0.2的不重复就行,但是要和Apache的workers.properties(稍后介绍)下的配置一致。
在%JBoss_Home%\server\default\deploy\jbossweb-tomcat55.sar\ROOT.war\目录下添加一个新文件夹\test,并在里面添加如下3个jsp文件:
index.jsp
%@
page
contentType="
text/html;
charset=ISO8859_1"
%>
2.
3.<
html>
4.<
head>
5.<
title>
Test<
/title>
6.<
meta
http-equiv="
Content-Type"
content="
charset=gb2312"
7.<
/head>
8.
9.<
body
onload="
document.form.name.focus()"
10.<
br>
<
11.<
center>
12.The
host
is
:
%=.InetAddress.getLocalHost().toString()%>
13.Your
session
id
%=session.getId()%>
14.Your
detail
%=session.toString()%>
15.Your
context
%=session.getSessionContext()%>
16.Please
input
your
name:
17.<
form
action="
test_action.jsp"
method="
POST"
form"
18.
type="
input"
name"
/>
19.
submit"
value="
提交"
20.<
/form>
21.<
/center>
22.<
/body>
23.<
/html>
test_action.jsp
Test
Action<
8.<
%
9.
String
name
=
request.getParameter("
);
10.
session.setAttribute("
name);
11.
.InetAddress.getLocalHost().toString();
12.%>
13.<
body>
14.<
15.<
16.<
17.The
%=host%>
18.Your
19.Your
20.Your
21.Your
%=name%>
22.This
set
into
the
session.<
23.Please
click
a
href="
session.jsp"
here<
/a>
to
check
valid
or
not.
24.<
25.<
26.<
session.jsp
null;
if(session.getAttribute("
)!
=null)
(String)session.getAttribute("
12.
13.%>
18.The
23.
if(name!
=null){
24.
out.print("
Your
"
+name+"
25.
The
valid."
26.
}
27.
else{
28.
invalid!
!
29.
30.%>
31.<
index.jsp"
Return!
32.<
33.<
34.<
35.
36.
session.invalidate();
37.%>
38.<
编辑%JBoss_Home%\server\default\deploy\jbossweb-tomcat55.sar\ROOT.war\WEB-INF\web.xml在<
web-app>
节点下增加如下代码:
distributable/>
完成后web.xml代码如下:
?
xml
version="
1.0"
encoding="
ISO-8859-1"
DOCTYPE
web-app
4.
PUBLIC
-//Sun
Microsystems,
Inc.//DTD
Web
Application
2.3//EN"
5.
6.