环境FreeBsd 4.9 Apache1.3.29+php4.3.4+mysql4+ports 安装
首先要cvsup同步ports ,
/usr/local/bin/cvsup -g -L 2 /usr/local/etc/ports-supfile
/usr/local/bin/cvsup -g -L 2 /usr/local/etc/stable-supfile
然后进入http://www.freebsd.org/ports/java.html
进入bsd 关于java 的官方网站,把jdk-1.4.2p5 所需要软件都收集全。放到/usr/ports/distfiles 里
然后进入/usr/ports/java/jdk14
首选要下载j2sdk-1_4_2_02-linux-i586.bin
然后#sh ./j2sdk-1_4_2_02-linux-i586.bin-----解开。然后,本例中复制到
/usr/local/linux-sun-jdk1.4.2/
用setenv ALT_BOOTDIR /usr/local/linux-sun-jdk1.4.2/ (指向你解压出来的目录)
#make 这段时间很常。休息~~~
#make install
注在安装时可以有错误
make 时可以要用到环境变量。。
(应按错误提示,自己改我这句话,此例中我的需要在make 前加
freebsd# unsetenv LANG
freebsd# unsetenv JAVA_HOME
freebsd# unsetenv CLASSPATH
freebsd# setenv ALT_JAVAWS_BOOTDIR /usr/local/jdk1.4.2
freebsd# setenv ALT_BOOTDIR /usr/local/linux-sun-jdk1.4.2/
假如没有出错。
在/usr/local/下可以看见。
/usr/local/jdk1.4.2 目录。
然后测试,/usr/local/jdk1.4.2/bin/java -version
freebsd# ./java -version
java version "1.4.2-p5"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-p5-fuweb_11_dec_2003_16_38)
Java HotSpot(TM) Client VM (build 1.4.2-p5-fuweb_11_dec_2003_16_38, mixed mode)
出现以下。表示jdk 安装成功
下面安装RESIN
resin-3.0.4.tar.gz 我下的是这个包,最新的cp 到/usr/local 下
# tar zxvf resin-3.0.4.tar.gz
设置setenv JAVA_HOME /usr/local/jdk1.4.2
# ./configure --with-apxs=/usr/local/sbin/apxs
# make
# make install
然后进入/usr/local/resin-3.0.4/bin
修改httpd.sh 文件。
# You can predefine JAVA_HOME and RESIN_HOME
#
JAVA_HOME=/usr/local/jdk1.4.2
export JAVA_HOME
#
RESIN_HOME=/usr/local/resin-3.0.4
export RESIN_HOME
wq!
注APACHE 在/usr/local/etc/apache/httpd.conf 会添加以下模块,
#
# mod_caucho Resin Configuration
#
LoadModule caucho_module /usr/local/libexec/apache/mod_caucho.so
ResinConfigServer localhost 6802
假如有此些表示。整合成功
启动 resin
http://218.24.233.13:8080 成功
然后配置resin.conf
进入/usr/local/resin-3.0.4/conf
vi resin.conf
后。
编辑以下。
我的服务器做的是虚拟主机。让其中一个域名支持jsp
配置如下。
freebsd# pwd
%26lt;!--
- Resin 3.0 configuration file.
--%26gt;
%26lt;resin xmlns="http://caucho.com/ns/resin"%26gt;
%26lt;!--
- Logging configuration for the JDK logging API.
--%26gt;
%26lt;log name='' level='info' path='stdout:' timestamp='[%H:%M:%S.%s] '/%26gt;
%26lt;log name='com.caucho.java' level='fine' path='stdout:'
timestamp='[%H:%M:%S.%s] '/%26gt;
%26lt;log name='com.caucho.loader' level='config' path='stdout:'
timestamp='[%H:%M:%S.%s] '/%26gt;
%26lt;!--
- For production sites, change dependency-check-interval to something
- like 600s, so it only checks for updates every 10 minutes.
--%26gt;
%26lt;dependency-check-interval%26gt;10s%26lt;/dependency-check-interval%26gt;
%26lt;!--
- You can change the compiler to "javac" or jikes.
- The default is "internal" only because it's the most
- likely to be available.
--%26gt;
%26lt;javac compiler="internal" args=""/%26gt;
%26lt;!-- Security providers.
- %26lt;security-provider%26gt;
- com.sun.net.ssl.internal.ssl.Provider
- %26lt;/security-provider%26gt;
--%26gt;
%26lt;!-- creates the deploy directory for .ear expansion --%26gt;
%26lt;ear-deploy path='deploy'/%26gt;
%26lt;!-- creates the deploy directory for .rar expansion --%26gt;
%26lt;resource-deploy path='deploy'/%26gt;
%26lt;!-- creates a second deploy directory for .war expansion --%26gt;
%26lt;web-app-deploy path='deploy'/%26gt;
%26lt;/host-default%26gt;
%26lt;!-- includes the web-app-default for default web-app behavior --%26gt;
%26lt;resin:include path="app-default.xml"/%26gt;
%26lt;!-- configures the default host, matching any host name --%26gt;
%26lt;host id='www.hc888.com'%26gt;
%26lt;document-directory%26gt;/home/fuweb/wwwroot%26lt;/document-directory%26gt;
%26lt;!-- configures the root web-app --%26gt;
%26lt;web-app id='/'%26gt;
%26lt;!-- adds xsl to the search path --%26gt;
%26lt;class-loader%26gt;
%26lt;simple-loader path="$host-root/xsl"/%26gt;
%26lt;/class-loader%26gt;
%26lt;servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/%26gt;
%26lt;/web-app%26gt;
%26lt;/host%26gt;
%26lt;/server%26gt;
%26lt;/resin%26gt;
假如想自启动
在/usr/local/etc/rc.d 建一个ln 连接
ln -s resin.sh /usr/local/resin-3.0.4/bin/httpd.sh
后从启即可。让你www.hc888.com 目录支持jsp
test.jsp 文件
%26lt;%@page language="java"%%26gt;
2+2=%26lt;%=2+2%%26gt;
%26lt;head%26gt;
%26lt;%@page language="java"%%26gt;
2+2=%26lt;%=2+2%%26gt;
%26lt;/head%26gt;
%26lt;body%26gt;
