[root@jie3 ~]
[root@jie3 conf]
<Connector port=
"80"
protocol=
"HTTP/1.1"
connectionTimeout=
"20000"
redirectPort=
"8443"
/>
<Connector port=
"8009"
protocol=
"AJP/1.3"
redirectPort=
"8443"
/>
<Engine name=
"Catalina"
defaultHost=
"www.test.com"
>
<Realm className=
"org.apache.catalina.realm.LockOutRealm"
>
<Realm className=
"org.apache.catalina.realm.UserDatabaseRealm"
resourceName=
"UserDatabase"
/>
<
/Realm
>
<Host name=
"www.test.com"
appBase=
"/tomcat/test"
unpackWARs=
"true"
autoDeploy=
"true"
>
<Context path=
""
docBase=
"/tomcat/test"
/>
<Valve className=
"org.apache.catalina.valves.AccessLogValve"
directory=
"logs"
prefix=
"test_access_log."
suffix=
".txt"
pattern=
"%h %l %u %t "%r" %s %b"
/>
<
/Host
>
<
/Engine
>
================================部分配置文件==========================
[root@jie3 conf]
Using CATALINA_BASE:
/usr/local/tomcat
Using CATALINA_HOME:
/usr/local/tomcat
Using CATALINA_TMPDIR:
/usr/local/tomcat/temp
Using JRE_HOME:
/usr/java/latest
Using CLASSPATH:
/usr/local/tomcat/bin/bootstrap
.jar:
/usr/local/tomcat/bin/tomcat-juli
.jar
[root@jie3 conf]
Using CATALINA_BASE:
/usr/local/tomcat
Using CATALINA_HOME:
/usr/local/tomcat
Using CATALINA_TMPDIR:
/usr/local/tomcat/temp
Using JRE_HOME:
/usr/java/latest
Using CLASSPATH:
/usr/local/tomcat/bin/bootstrap
.jar:
/usr/local/tomcat/bin/tomcat-juli
.jar
[root@jie3 conf]
[root@jie3 conf]
[root@jie3
test
]
<%@ page language=
"java"
%>
<%@ page
import
=
"com.mysql.jdbc.Driver"
%>
<%@ page
import
=
"java.sql.*"
%>
<%
String driverName=
"com.mysql.jdbc.Driver"
;
String userName=
"jie"
;
String userPasswd=
"jie123"
;
String dbName=
"test"
;
String url=
"jdbc:mysql://172.16.22.200/"
+dbName+
"?user="
+userName+
"&password="
+userPasswd;
Class.forName(
"com.mysql.jdbc.Driver"
).newInstance();
try
{
Connection connection=DriverManager.getConnection(url);
out.println(
"TomcatA, tomcat connect mysql is ok!"
);
connection.close();
}
catch( Exception e )
{
out.println(
"connent mysql error:"
+ e );
}
%>
======================================================================
[root@jie4 ~]
mysql> grant all on *.* to
'jie'
@
'172.16.%.%'
identified by
'jie123'
;
mysql> flush privileges;