软件下载:tomcat 5.5.9 jk 1.2.14 安装tomcat 将下载的tomcat放到/usr/local目录下解压缩 将解压缩后目录改为tomcat 启动tomcat 输出如下代表启动成功 这个时候应该可以通过访问服务器的8080端口出现tomcat服务器的默认界面了。 安装jk 1.2.14 将文件jakarta-tomcat-connectors-1.2.14-src.tar.gz在/usr/local目录解压缩 编译安装 到这里jk 1.2.14已经安装好了。 配置apache可以解释jsp文件 拷贝mod_jk.so文件到/usr/libexec/apache目录下 拷贝/usr/local/tomcat/conf/workers.properties.minimal文件到/etc/apache/workers.properties文件 写入/etc/apache/mod_jk.conf文件,内容如下 # Sample JkMounts. Replace these with the paths you would 编辑/etc/apache/httpd.conf文件,加入如下内容 将/var/www/htdocs目录链接到/usr/local/tomcat/webapps/ROOT目录 重新启动tomcat和apache 现在直接访问服务器/index.jsp就可以显示tomcat界面了。例如我的服务器是192.168.0.254 index.html index.php index.jsp
http://mirror.vmmatrix.net/apache/dist/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9.tar.gz
http://www.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1.2.14/jakarta-tomcat-connectors-1.2.14-src.tar.gz
./startup.sh
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/lib/java
如下
tar zxvf jakarta-tomcat-connectors*.tar.gz
./buildconfig.sh
./configure ?with-apxs="/usr/sbin/apxs” ?with-java-home="/usr/lib/java
make
make install
JkWorkersFile /etc/apache/workers.properties
JkLogFile /var/log/mod_jk.log
JkLogLevel warn
# like to mount from your JSP server.
JkMount /*.jsp ajp13w
JkMount /servlet/* ajp13w
JkMount /examples/* ajp13w
</IfModule>
AddModule mod_jk.c
Include /etc/apache/mod_jk.conf
注意:要先将原ROOT目录改名
mv ROOT ROOTBAK
ln -s /var/www/htdocs /usr/local/tomcat/webapps/ROOT
cp -r /usr/local/tomcat/webapps/ROOTBAK/* /usr/local/tomcat/webapps/ROOT/
./shutdown.sh
./startup.sh
/etc/rc.d/rc.httpd restart
我在/var/www/htdocs/目录下有index.html index.php index.jsp三个文件
下面是分别访问的截图
祝好运!