一、安装环境:
FreeBSD 6.0-RELEASE
二、安装软件:
httpd-2.0.58.tar.gz
apache-tomcat-5.5.17.tar.gz
mod_jk2.0.4-freebsd4.9-i386-apache2.0.48.tgz
diablo-jdk-freebsd6-1.5.0.06.00.tbz
三、安装apache
tar xvzf httpd-2.2.0.tar.gz
cd httpd-2.2.0
./configure --prefix=/usr/local/apache2 --enable-so --enable-shared=max \
--with-mpm=worker --enable-deflate --enable-headers --enable-rewrite \
--enable-proxy --enable-proxy --enable-ssl --with-ssl=/usr/local/ssl \
--enable-modules=all
make
make install
启动apache:
/opt/apache2/bin/apachectl start
四、安装j2sdk
pkg_add -r javavmwrapper
pkg_add diablo-jdk-freebsd5-1.5.0.06.00.tbz
(参考:
http://blogs.huihoo.com/?p=198)
测试是否安装成功:
java -version
如果出现版本信息,说明j2sdk安装成功!
设置环境变量:
vi /etc/profile
添加如下内容:
#####java evn set#####
JAVA_HOME=/usr/local/diablo-jdk1.5.0
CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
PATH=$PATH:$JAVA_HOME:$JAVA_HOME/bin
CATALINA_HOME=/usr/local/tomcat
export JAVA_HOME CLASSPATH PATH CATALINA_HOME
source /etc/profile
五、安装tomcat
tar xzf apache-tomcat-5.5.17.tar.gz
cp apache-tomcat-5.5.17 /usr/local/tomcat #直接拷贝过来就可以使用
六、整合apache+tomcat
tar xzf mod_jk2.0.4-freebsd4.9-i386-apache2.0.48.tgz
cp libexec/apache2/mod_jk2.so /usr/local/apache2/modules/
vi /usr/local/apache2/conf/httpd.conf
LoadModule jk2_module modules/mod_jk2.so
vi /usr/local/apache2/conf/workers2.properties
[shm]
file=/usr/local/apache2/logs/shm.file
size=1048576
# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
# Uri mapping
[uri:/*.jsp]
worker=ajp13:localhost:8009
/usr/local/tomcat/bin/startup.sh
/usr/local/apache2/bin/apachectl restart
七、测试:
阅读(1011) | 评论(0) | 转发(0) |