Environment: FreeBsd 4.9 Apache1.3.29+php4.3.4+mysql4+ports. To install,
you must first synchronize ports with cvsup,
/usr/local/bin/cvsup -g -L 2 /usr/local/etc/ports-supfile
/usr/local/ bin/cvsup -g -L 2 /usr/local/etc/stable-supfile
and then go to http://www.freebsd.org/ports/java.html
to enter bsd’s official website about java, and put jdk-1.4.2p5 All required software is collected. Put it in /usr/ports/distfiles
Then enter /usr/ports/java/jdk14.
The first choice is to download j2sdk-1_4_2_02-linux-i586.bin
and then #sh ./j2sdk-1_4_2_02-linux-i586.bin-----unlock. Then, in this example: copy to
/usr/local/linux-sun-jdk1.4.2/
and use setenv ALT_BOOTDIR /usr/local/linux-sun-jdk1.4.2/ (point to the directory you extracted)
#make This is a common time. Rest~~~
#make install
Note: There may be errors during installation.
Environment variables may be used when making. .
(You should follow the error message and change my sentence yourself. In this example, I need to addfreebsd# unsetenv LANG
before make
.
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/if
there is no error.
It can be seen under /usr/local/.
/usr/local/jdk1.4.2 directory.
Then test, /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)
The following appears. Indicates that jdk is installed successfully
Next, install RESIN
resin-3.0.4.tar.gz. I downloaded this package. The latest cp goes to /usr/local
# tar zxvf resin-3.0.4.tar.gz
Set setenv JAVA_HOME /usr/local/jdk1.4.2
# ./configure --with-apxs=/usr/local/sbin/apxs
#make
# make install
and then enter /usr/local/resin-3.0.4/bin
Modify the httpd.sh file.
# 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!
Note: APACHE will add the following modules to /usr/local/etc/apache/httpd.conf,
#
# mod_caucho Resin Configuration
#
LoadModule caucho_module /usr/local/libexec/apache/mod_caucho.so
ResinConfigServer localhost 6802
If there are any such representations. Integration successfully
started resin
http://218.24.233.13:8080 is successful
and then configure resin.conf
and enter /usr/local/resin-3.0.4/conf
vi resin.conf
.
Edited below.
My server is a virtual host. Let one of the domain names support jsp
The configuration is as follows.
freebsd#pwd
<!--
- Resin 3.0 configuration file.
-->
<resin xmlns=" http://caucho.com/ns/resin ">
<!--
- Logging configuration for the JDK logging API.
-->
<log name='' level='info' path='stdout:' timestamp='[%H:%M:%S.%s] '/>
<log name='com.caucho.java' level='fine' path='stdout:'
timestamp='[%H:%M:%S.%s] '/>
<log name='com.caucho.loader' level='config' path='stdout:'
timestamp='[%H:%M:%S.%s] '/>
<!--
- For production sites, change dependency-check-interval to something
- like 600s, so it only checks for updates every 10 minutes.
-->
<dependency-check-interval>10s</dependency-check-interval>
<!--
- You can change the compiler to "javac" or jikes.
- The default is "internal" only because it's the most
- likely to be available.
-->
<javac compiler="internal" args=""/>
<!-- Security providers.
- <security-provider>
- com.sun.net.ssl.internal.ssl.Provider
- </security-provider>
-->
<!-- creates the deploy directory for .ear expansion -->
<ear-deploy path='deploy'/>
<!-- creates the deploy directory for .rar expansion -->
<resource-deploy path='deploy'/>
<!-- creates a second deploy directory for .war expansion -->
<web-app-deploy path='deploy'/>
</host-default>
<!-- includes the web-app-default for default web-app behavior -->
<resin:include path="app-default.xml"/>
<!-- configures the default host, matching any host name -->
<host id='www.hc888.com'>
<document-directory>/home/fuweb/wwwroot</document-directory>
<!-- configures the root web-app -->
<web-app id='/'>
<!-- adds xsl to the search path -->
<class-loader>
<simple-loader path="$host-root/xsl"/>
</class-loader>
<servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>
</web-app>
</host>
</server>
</resin>
If you want to start automatically,
create an ln in /usr/local/etc/rc.d and connect
ln -s resin.sh /usr/local/resin-3.0.4/bin/httpd.sh
and then start it. Let your www.hc888.com directory support the jsp
test.jsp file
< %@page language="java"%>
2+2=<%=2+2%>
<head>
< %@page language="java"%>
2+2=<%=2+2%>
</head>
<body>