使环境变量生效 [root@server ~]# source /etc/profile 注意:JAVA及TOMCAT的目录是否为安装目录; 首先安装JDK 我的软件下载都放在/home/soft里面,每个人的目录都不一样,对号入座; [root@server ~]# cp /home/soft/jdk-6u6-linux-i586.bin /usr/local/ [root@server local]# ./jdk-6u6-linux-i586.bin …………………… I. Installation and Auto-Update. The Software's installation and auto-update processes transmit a limited amount of data to Sun (or its service provider) about those specific processes to help Sun understand and optimize them. Sun does not associate the data with personally identifiable information. You can find more information about the data Sun collects at For inquiries please contact: Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. Do you agree to the above license terms? [yes or no] yes ………… the JDK installation directory) in a browser. For more information on what data Registration collects and how it is managed and used, see:
Press Enter to continue..... Done. 所有安装,按空格,到提示时输入YES,最近提示按ENTER键结束; 查看当前JAVA版本; [root@server local]# java -version java version "1.6.0_06" Java(TM) SE Runtime Environment (build 1.6.0_06-b02) Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing) 上面显示表明JAVA安装成功没有出错; [root@server local]mv jdk1.6.0_06/ java
编译安装Mod_jk [root@server local]# tar zxvf /home/soft/tomcat-connectors-1.2.26-src.tar.gz [root@server local]# cd tomcat-connectors-1.2.26-src/native/ [root@server native]# ./configure --with-java-home=/usr/local/java/ \ > --with-apxs=/usr/local/apache/bin/apxs [root@server native]# make clean; make [root@server native]# make install [root@server native]# cp apache-2.0/mod_jk.so /usr/local/apache/lib/ 以上完成编绎安装,开始设定Apache,让mod_jk 生效。 编辑 httpd.conf 在 httpd.conf 中加入mod_jk模块 # LoadModule foo_module modules/mod_foo.so LoadModule jk_module lib/mod_jk.so # Where to find workers.properties # Update this path to match your conf directory location (put workers.properties next to httpd.conf) JkWorkersFile /usr/local/apache/conf/workers.properties 这个目录是根据自己安装目录来设定,不能照搬; # Where to put jk shared memory # Update this path to match your local state directory or logs directory JkShmFile /var/log/httpd/mod_jk.shm # Where to put jk logs # Update this path to match your logs directory location (put mod_jk.log next to access_log) JkLogFile /var/log/httpd/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # Select the timestamp log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " # Send everything for context / to worker named worker1 (ajp13) JkMount /*.jsp worker1 具体设置参数为如下图;
编辑workers.properties文件; [root@server native]# vi /usr/local/apache/conf/workers.properties