It should be noted that when compiling Apache must join the DSO support, if not, please add the--ENABLE-MODULE=SO option to recompile Apache
Install resin:
Download the resin installation package
/usr/local
# tar -zxvf resin-2.1.4.tar.gz
/usr/local
# cd resin-2.1.4/bin
/usr/local/resin-2.1.4/bin
# httpd.sh start
If there are no error messages
Take a look at http://ip:8080/.
You can see the resin of the page to indicate that the resin was successfully run alone
Here are the more important integration resin and Apache
First Compile Mod_caucho
Download Resin's Source code
/usr/local# tar -zxvf resin-2.1.4-src.tar.gz /usr/local
# cd resin-2.1.4-src /usr/local/resin-2.1.4-src
# ./configure --with-apxs=/usr/local/apache/bin/apxs 或者 /usr/local/resin-2.1.4-src
# ./configure --with-apxs=/usr/local/apache /usr/local/apache为apache的安装路径
然后 /usr/local/resin-2.1.4-src
# make
# make install
修改resin-2.1.4/conf/resin.conf
<!--
- The root file directory of the server. Apache users will change
- this to /usr/local/apache/htdocs and IIS users will change it
- to d:inetpubwwwroot
-->;
<doc-dir>;/usr/local/apache/htdocs/</doc-dir>;
<!-- the http port -->;
This section will change Doc-dir to own Doc dir, I am here is/usr/local/apache/htdocs/
Modify Httpd.conf
Join
LoadModule caucho_module /usr/local/apache/libexec/mod_caucho.so
AddModule mod_caucho.c
<IfModule mod_caucho.c>;
CauchoConfigFile /usr/local/resin-2.1.4/conf/resin.conf
<Location /caucho-status>;
SetHandler caucho-status
</Location>;
</IfModule>;
Restart Apache and resin
/usr/local/resin-2.1.4/bin/httpd.sh stop
/usr/local/apache/bin/apachectl stop
/usr/local/resin-2.1.4/bin/httpd.sh start
/usr/local/apache/bin/apachectl start
Browser Open
http://ip/caucho-status/
If you appear
Status:caucho Servlet Engine
It means no problem.
Test
Create a test.jsp under the/usr/local/apache/htdocs/
/usr/local/apache/htdocs# VI test.jsp
<%@page language="java"%>;
2+2=<%=2+2%>;
Browser Open http://ip/test.jsp
If you can see
2+2=4
Then it was a success.