如何同时安装并支持PHP和JSP
发表于:2007-07-14来源:作者:点击数:
标签:
第一篇:如何在 Linux 下装 PHP +JSP的 (来自php.exe) 这里我使用的是apache_1.3.9;ApacheJServ-1.1b3;gnujsp1.0.0 全部是tar.gz格式, tar -zxvf apache.tar.gz tar -zxvf ApacheJServ-1.1b3 tar -zxvf gnujsp.tar.gz tar -zxvf jsdk.tar.gz cd apache_1.3.
第一篇:如何在
Linux下装
PHP+JSP的
(来自php.exe)
这里我使用的是apache_1.3.9;ApacheJServ-1.1b3;gnujsp1.0.0
全部是tar.gz格式,
tar -zxvf apache.tar.gz
tar -zxvf ApacheJServ-1.1b3
tar -zxvf gnujsp.tar.gz
tar -zxvf jsdk.tar.gz
cd apache_1.3.9
./configure --prefix=/www
make install
cd ../php-3.0.12
./configure --with-
mysql=/mysql --with-apache=../apache_1.3.9 --enable-track-vars
make
make install
cd ../ApacheJServ-1.1b3
./configure --prefix=/usr/local/jserv --with-apache-src=../apache_1.3.9 --with-jdk-home=/jdk117_v3 --with-JSDK=../JSDK/lib/jsdk.jar
make install
cd ../apache_1.3.9
./configure --prefix=/www --activate-module=src/modules/php3/libphp3.a --activate-module=/src/modules/jserv/libjserv.a
make
make install
然后开始配置PHP(略)
接着来配置JSP
1.把gnujsp10.jar,servlet-2.0-plus.jar拷到/www/htdocs/servlets目录下
2.修改jserv.conf,加上
ApJServAction .jsp /servlets/gnujsp
ApjServMount /java /root(这个目录主要是用来存放jsp生成的java
和class文件,可视具体情况而定)
4.修改jserv.properties,加入
wrapper.classpath=/jdk117_v3/lib/classes.zip
wrapper.classpath=/usr/local/jserv/libexec/ApacheJServ.jar
wrapper.classpath=/home/riso/webserversrc/JSDK/lib/jsdk.jar
wrapper.classpath=/www/htdocs/servlets/gnujsp10.jar
wrapper.classpath=/www/htdocs/servlets/servlet-2.0-plus.jar
5.修改zone.properties,加入
servlet.gnujsp.code=org.gjt.jsp.JspServlet
servlet.gnujsp.JspServlet.initArgs=checkclass=true
servlet.gnujsp.JspServlet.initArgs=scratchdir=/home/httpd/java
servlet.gnujsp.JspServlet.initArgs=compiler=/jdk117_v3/bin/javac -encoding %encoding% -classpath %classpath% -d %scratchdir% -deprecation%source%
当然,还要将jserv.conf文件include到httpd.conf中去
cd /www/bin/
./apachectl start
测试一下http://XXX.XXX.XXX.XXX/jserv/
(先在jserv.conf文件中加入访问权限)
成功!
将gnujsp自带的三个例子文件拷贝到/www/htdocs下
测试http://XXX.XXX.XXX.XXX/hello.jsp
测试http://XXX.XXX.XXX.XXX/date.jsp
测试http://XXX.XXX.XXX.XXX/snoop.jsp
第二篇:php,gunjsp的安装,配置
(转载自网易 club
.netease.com)
安装jdk,jsdk于/usr/local/jdk,/usr/local/jdk/jsdk
install mysql:
./configure --prefix=/usr/local/mysql
--enable-shared
--enable-large-files
--with-comment
make
make install
install apache:
./configure --prefix=/usr/local/apache
--enable-rule=SHARED_CORE
--enable-module=so
make
make install
install php:
./configure --with-mysql=/usr/local/mysql
--with-apxs=/usr/local/apache/bin/apxs
--enable-track-vars
--disable-de
bug --enable-ftp
--with-java=/usr/local/jdk
make
make install
install apachej:
./configure --prefix=/usr/local/apache/jserv
--with-apxs=/usr/local/apache/bin/apxs
--with-jdk-home=/usr/local/jdk
--with-JSDK=/usr/local/jdk/jsdk/lib/jsdk.jar
--disable-debugging
make
make install
install gnujsp:
cp gnujsp-1.0.0 /usr/local/jdk/gnujsp
jsp的配置:
/usr/local/apache/conf/jserv/jserv.conf
加入
ApJServMount /alph /alph
ApJServMount /alph /alph/gnujsp
/usr/local/apache/conf/jserv/jserv.properties
加入
wrapper.classpath=/usr/local/jdk/jre/lib/rt.jar
wrapper.classpath=/usr/local/jdk/lib/tools.jar
alph.properties=/usr/local/apache/conf/jserv/alph.properties
更改
zones=root => zones=root,alph
/usr/local/apache/conf/jserv
新建alph.properties
repositories=/usr/local/jdk/gnujsp/lib/gnujsp10.jar
repositories=/usr/local/jdk/gnujsp/lib/servlet-2.0-plus.jar
repositories=/usr/local/jdk/gnujsp/lib/gnujsp10test.jar
autoreload.classes=true
autoreload.file=true
servlet.gnujsp.code=org.gjt.jsp.JspServlet
servlet.gnujsp.initArgs=checkclass=true
servlet.gnujsp.initArgs=pagebase=//
servlet.gnujsp.initArgs=scratchdir=/var/apache/jsp (新建/var/apache
/jsp目录,注意读写权限)
servlet.gnujsp.initArgs=debug=true
servlet.gnujsp.initArgs=compiler=builtin-javac -classpath %classpath%:
%scratchdir%:/usr/local/jdk/gnujsp/lib/gnujsp10.jar:/usr/local/jdk/gnu
jsp/lib/servlet-2.0-plus.jar:/usr/local/jdk/gnujsp/lib/gnujsp10test.ja
r -d %scratchdir% -deprecation %source%
servlet.gnujsp.initArgs=jserv=true
servlet.gnujsp.initArgs=pathdebug=falsea
原文转自:http://www.ltesting.net