【正文】
figure withapxs=/opt/apache/bin/apxs make make install cd /usr/local/ cp /opt/apache/modules/ 系統(tǒng)整合 修改 vi /opt/apache/conf/ 在文件最末尾加上如下語句 Load mod_jk LoadModule jk_module modules/ Configure mod_jk JkWorkersFile conf/ JkLogFile logs/ JkLogLevel info JkMount /*.jsp loadbalancer JkMount /servlet/* loadbalancer JkMount /application/* loadbalancer 創(chuàng)建 文件 vi /opt/apache/conf/ 添加下列語句 In Unix, we use forward slashes: ps=/ list the workers by name =tomcat1, tomcat2, loadbalancer First tomcat server =8009 = =ajp13 Specify the size of the open connection cache. Specifies the load balance factor when used with a load balancing worker. Note: lbfactor must be 0 Low lbfactor means less work done by the worker. =100 Second tomcat server =8009 = =ajp13 Specify the size of the open connection cache. Specifies the load balance factor when used with a load balancing worker. Note: lbfactor must be 0 Low lbfactor means less work done by the worker. =100 Load Balancer worker The loadbalancer (type lb) worker performs weighted roundrobin load balancing with sticky sessions. Note: If a worker dies, the load balancer will check its state once in a while. Until then all work is redirected to peer worker. =lb =tomcat1, tomcat2 END 修改 vi /usr/local/tomcat/conf/ Connector port=8009 protocolHandlerClassName= redirectPort=8443 protocol=AJP/ / 第 101 行 在 119 行左右加入如下語句(去注釋) Engine name=Standalone defaultHost=localhost jvmRoute=tomcat1/Engine 若第二臺 tomcat,將 jvmRoute 的修改為 tomcat2 系統(tǒng)整合完畢 啟動 apache 和 tomcat 服務(wù) /usr/local/apache/bin/apachectl start /usr/local/tomcat/bin/ start 將如下內(nèi)容添加至 /etc/,以便系統(tǒng)啟動后開啟 apache,tomcat 服務(wù) vi /etc/ 添加 /usr/local/tomcat/bin/ start /opt/apache/bin/apachectl start 注意: JSP 頁面要訪問 ORACLE 數(shù)據(jù)庫時(shí),保證數(shù)據(jù)庫打開的同時(shí)做如下操作: 將 ORACLE 安裝目錄(本文中的 /opt/ora9/product/)下的 和 拷貝到 TOMCAT的安裝目錄下的庫中(本文中的 /usr/local/tomcat/mon/lib) ,然 后 重 新啟 動 TOMCAT , 這 樣 才能 聯(lián) 接 ORACLE 數(shù) 據(jù) 庫 , 不 然 會出 現(xiàn) 找不 到 錯(cuò)誤。