基于Tomcat+Oracle的应用程序安装配置手册

类别:Java 点击:0 评论:0 推荐:

例子运行环境描述:

操作系统为Windows 2000 Server

IP为10.70.38.10

 

工具下载地址:

Poi下载地址

http://www.apache.org/dist/jakarta/poi/dev/bin/

Tomcat下载地址

http://apache.linuxforum.net/dist/jakarta/tomcat-4/v4.1.30/bin/jakarta-tomcat-4.1.30.zip

Oracle JDBC驱动程序下载地址

原名称classes12.jar

JDK下载地址

http://192.18.97.239/ECom/EComTicketServlet/BEGINjsecom16k.sun.com-2122:413d12bb:da314062975fa899/-2147483648/508345371/1/449522/449474/508345371/2ts+/westCoastFSEND/j2eesdk-1.4-oth-JPR/j2eesdk-1.4-oth-JPR:1/j2eesdk-1_4-windows.exe

 

 

原文件清单:

PlanManagement//文件夹

Oracle.jar//Oracle数据库JDBC驱动

//Java豆

JDK的安装

 

第一步:直接运行J2SDK1_3_0-Win.exe,一路回车安装,这里默认的安装路径为C:\\JDK1_3

 

第二步:配置环境变量

在我的电脑上点击鼠标右键-属性-点选高级-点选环境变量

 

弹出环境变量对话框,新建以下变量名和值:

 

-------------------------------------

 

变量名:path

 

变量值:C:\JDK1_3\bin

 

变量名:JAVA_HOME

 

变量值:C:\jdk1_3

 

变量名:CLASSPATH

 

变量值:.\;C:\JDK1_3\lib\dt.jar;C:\JDK1_3\lib\tools.jar;

 

第三步:重新启动计算机使配置的环境变量生效

 

 

TOMCAT安装

 

第一步:直接运行安装Jakarta-tomcat-4.0.4.exe,我这里默认的安装路径是C:\Apache Tomcat 4.0这时如果单独启动TOMCAT(到Tomca目录下运行startup.bat启动Tomcat或在菜单栏运行start tomcat).

第二步:配置Tomcat,将原文件夹拷贝到D:盘形成D:\PlanManagement,用记事本打开C:\Apache Tomcat 4.0\conf\ server.xml文件修改全文为

注意:红色为笔者加的注释,实际应用时可以删除.

<Server port="8005" shutdown="SHUTDOWN" debug="0">

<Service name="PlanManagement">

<!-决定端口号,此处设置为80是默认端口,如果有冲突[比如IIS的默认Web站点没有停止可以设置为其它:例8080等.] -->

  <Connector port="80" minProcessors="5" maxProcessors="75"

               enableLookups="true" redirectPort="8443"

               acceptCount="10" debug="0" connectionTimeout="-1"/>

<Engine name="PlanManagement" defaultHost="planmanagement" debug="0">

<!-设置虚拟主机:planmanagement主机名应该在C:\WINNT\system32\drivers\etc\hosts文件中有IP映射例: 10.70.38.10       planmanagement,appBase关键字描述应用程序基础目录 -->

<Host name="planmanagement" debug="0" appBase="D:\PlanManagement" unpackWARs="true">

<!-设置当前文档基础目录 -->

        <Context path="" docBase="D:\PlanManagement" debug="0">

<!-设置日志存放目录 -->

          <Logger className="org.apache.catalina.logger.FileLogger" directory="LogDefineByDigitalTitan" prefix="LogDefineByDigitalTitan." suffix=".txt"

              timestamp="true"/>

<!-设置数据库连接池名称为jdbc/OracleDB为程序代码应用. -->

          <Resource name="jdbc/OracleDB" auth="Container" type="javax.sql.DataSource"/>

          <ResourceParams name="jdbc/OracleDB">

                            

            <parameter>

                                    

              <name>factory</name>

                                   

              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>

                            

            </parameter>

                             

            <parameter>

                                   

              <name>driverClassName</name>

<!-描述Oracle驱动程序目录地址 -->                                   

              <value>oracle.jdbc.driver.OracleDriver</value>

                            

            </parameter>

                            

            <parameter>

                                    

              <name>url</name>

<!-设置Oracle数据库服务器网络地址 -->                                   

              <value>jdbc:oracle:thin:@10.70.38.10:1521:Thor</value>

                            

            </parameter>

                            

            <parameter>

<!-设置Oracle数据库服务器授权用户帐号 -->                                   

              <name>username</name>

                                   

              <value>java</value>

                            

            </parameter>

<!-设置Oracle数据库服务器授权用户口令 -->                            

            <parameter>

                                   

              <name>password</name>

                                   

              <value>java</value>

                            

            </parameter>

                            

            <parameter>

                                   

              <name>maxActive</name>

                                   

              <value>100</value>

                            

            </parameter>

                            

            <parameter>

                                   

              <name>maxIdle</name>

                                   

              <value>98</value>

                            

            </parameter>

                            

            <parameter>

                                   

              <name>maxWait</name>

                                   

              <value>-1</value>

                            

            </parameter>

                            

          </ResourceParams>

        </Context>

      </Host>

    </Engine>

  </Service>

</Server>

另设置系统默认访问页.

用记事本打开C:\Apache Tomcat 4.0\conf\ web.xml文件修改为

注意:红色部分为添加的内容.

......

    <welcome-file-list>

        <welcome-file>index.html</welcome-file>

        <welcome-file>index.htm</welcome-file>

        <welcome-file>index.jsp</welcome-file>

        <welcome-file>Index.jsp</welcome-file>

    </welcome-file-list>

 

</web-app>

确认安装好了Oracle-OracleNT,修改Oracle数据库服务器的IP地址和用户帐号和口令.

确认Oracle的数据库JDBC驱动已经拷贝到C:\Apache Tomcat 4.0\common\lib\Oracle.jar

确认Java豆拷贝到C:\Apache Tomcat 4.0\common\classes目录.

 

启动Tomcat服务器.在浏览器中输入URL

Http://LocalHost/访问

本文地址:http://com.8s8s.com/it/it15568.htm