欢迎光临自己的路个人博客站!

自己的路个人网站-自己的路个人博客

自己的路个人博客网站

关注在二实小学习、生活、运动的个人博客

您当前的位置:主页 > 开源无价 >

FREEBSD7下整合apache和tomcat

发布时间:2015-09-06 11:33 点击: 编辑:admin

学校网站服务器采用FREEBSD7.0、SQUID+APACH+MYSQL+PHP环境,最近想把学校的新闻系统换成JAVA的JSP系统,SQUID+APACH+MYSQL+PHP已经安装好了不再重复(前面博文写过了)今天重点写一下JSP环境的安装和整合APACHE与TOMCAT。 Sb2_&5  
OK /K!f3o+  
先下载:http://www.FreeBSDFoundation.org/cgi-bin/download?download=diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2 +[n#{;]<  
下载好:把diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2放到:/usr/ports/distfiles/ rf+}J_  
#cd /usr/ports/java/diablo-jdk16 b9?Vpu`?  
#make install clean pl,XS6mB  
安装到/usr/local目录下自己改名为jdk1.6.0 #Cs/.(<  
再到http://tomcat.apache.org/下载apache-tomcat-6.0.18.tar.gz o M@%2M_O(  
#mv apache-tomcat-6.0.18.tar.gz /home/zkxx 4<1V  
#cd /home/zkxx Z)(#D($-  
#tar zxvf apache-tomcat-6.0.18.tar.gz >HwVP.~HN  
#mv apache-tomcat-6.0.18 tomcat !JDuVqW  
#ee /etc/profile @0H0!9'  
export JAVA_HOME=/usr/local/jdk1.6.0 #>~A-k)  
export CATALINA_HOME=/home/zkxx/tomcat <Mo{o2F=  
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar DTi^* Wj  
#cd /home/zkxx/tomcat/bin #] Do_Z  
#./startup.sh s` , g4ce`  
Using CATALINA_BASE:   /home/zkxx/tomcat 7}c[GC)F  
Using CATALINA_HOME:   /home/zkxx/tomcat }4c$_  
Using CATALINA_TMPDIR: /home/zkxx/tomcat/temp i,Jz 7OX  
Using JRE_HOME:       /usr/local/jdk1.6.0 lQ [JA[  
访问:http://Myip:8080 OK看到了那只猫猫 -g 9CW[  
下面Apache 与 Tomcat 的整合 b/#<::D `  
#cd /usr/ports/www/mod_jk-apache2 BjjuZN&  
#make install clean Ft:_6T%  
#ee /usr/local/etc/apache/httpd.conf 3|3ad'  
加入 =q"0GUei3  
#Load mod_jk <0l:B ;3  
LoadModule jk_module       modules/mod_jk.so \0qFOjVj  
#cd /usr/local/apache/include 1T,Bd!g  
#ee mod_jk.conf >E,/|K*  
# Replace jsp-hostname with the hostname of your JSP server, as m<MN. R7  
# specified in workers.properties [a^<2V!vMn  
LoadModule jk_module /usr/local/apache/modules/mod_jk.so fl_a@QdB#  
<IfModule mod_jk.c> W^H[rX}=  
JkWorkersFile  /usr/local/apache/include/workers.properties =7 -k D3  
JkLogFile  /var/log/jk.log t3Iij0b~  
JkShmFile  /var/log/jk-runtime-status %a-fxV[  
JkLogLevel error EScy!p\*  
# Sample JkMounts.  Replace these with the paths you would 1_n5:  
# like to mount from your JSP server \/y&l\ k)  
JkMount /*.jsp ajp13 .e S* F  
JkMount /servlet/* ajp13 P[ Vf$ q<  
JkMount /examples/* ajp13 : f RGXrn  
</IfModule> pl 1CEoe  
创建 mod_jk 的日志文件,并设定其归属的用户和组: ! <>`G0  
#touch /var/log/mod_jk.log  `zcpaE.@  
#chown www:www /var/log/mod_jk.log BUsAEw M  
#cd /usr/local/apache/include "9H#pj -  
#ee workers.properties ~^eC?F(  
# Incredibly simple workers.properties file, intended for connecting 9Bu=8P?  
# to one host, via AJP13.  See the tomcat documentation for @v}M\$N?  
# information on more exotic configuration options. Bq \WG= Fd  
# IBv9xP]BZ  
# Change jsp-hostname to the hostname of your JSP server. MXY!N /  
# O@KAh5EB  
worker.list=ajp13 r P&.`m88n  
worker.ajp13.port=8009 0OVxx> p/x  
worker.ajp13.host=localhost t*!Q9GC_  
worker.ajp13.type=ajp13 , @6_sl  
worker.ajp13.lbfactor=1 p \,PY  
更改 workers.properties 文件归属的用户和组: WAh{*$Rpl  
#chown www:www workers.properties }Xy<F?Mh  
重启APACHE和TOMCAT 80O[pf*?  
上传一个JSP文件访问http://www.yxzkxx.net/jsp/test.jsp R&s\h"=*  
OK,这样APACHE和TOMCAT就整合好了~~  GVzG 

最近访客

    热评文章

      Powered by FREEBSD NGINX PHP MYSQL FREEBSD NGINX PHP MYSQL