FreeBSD 7.0 °²×°ÅäÖÃJSP»·¾³apache+apache
ÎÒÏÈ˵Ã÷Ò»ÏÂÅäÖû·¾³µÄ´ó¸ÅÇé¿ö£º
* FreeBSD 7.0-RELEASE
* apache-2.2.9
* mod_jk-ap2-1.2.26
* diablo-jdk-1.6.0.07.02
* tomcat-6.0.16
¾ßÌåµÄ°æ±¾ÐÅÏ¢ÏÔʾÈçÏ£º
freebsd# pkg_info
apache-2.2.9_5 Version 2.2.x of Apache web server with prefork MPM.
apache-tomcat-6.0.16 Open-source Java web server by Apache, 6.x branch
diablo-jdk-1.6.0.07.02 Java Development Kit 1.6.0_07.02
mod_jk-ap2-1.2.26 Apache2 JK module for connecting to Tomcat using AJP1X
ºÃ£¬À´¿´¿´¾ßÌåµÄ×ö·¨°É£¡
µÚÒ»²½£º°²×°FreeBSD£¬²ÉÈ¡×îС»¯°²×°µÄ²½Ö裬Ëæ±ã°Ñports¸ø×°ÉÏ°É£¬·½±ãÖ±½Ó°²×°±ØÒªµÄports¡£
ÕâÀïûÓÐʲôÌرðµÄµØ·½£¬Ö»ÊÇÌáÐÑһϣ¬°²×°Íê³Éºó×¢ÒâÒª¸üе½×îеÄports tree £¡
ÓÉÓÚÊÇ×îС»¯°²×°£¬ËùÒÔÐèҪͨ¹ýports°²×°ÏÂÃ漸¸öpackage£º
* csup(cvsupµÄ°æ±¾)
* portupgrade
Íê³É°²×°ºó£¬¸üÐÂports tree£¬ÎÒʹÓÃÁËcvsup.FreeBSDChina.org ×÷Ϊ¾µÏñ£¡
µÚ¶þ²½£º°²×° JDK £FreeBSD ·¢²¼µÄ JDK 1.6 Èí¼þ°ü
´ÓportsÀ´±àÒëJDK£¡
2.1 ½ø /usr/ports/java/diablo-jdk16 £¬make£¬ÌáʾÏÂÔØjdkÎļþ£¨diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2£©µ½ /usr/ports/distfiles Ï£¬
ͨ¹ýbrower µ½ http://www.FreeBSDFoundation.org/cgi...07-b02.tar.bz2
ÏÂÔØ£¬ÐèÒªagree¡£
×¢£º Ò²¿ÉÒÔÏÂÔØdiablo-jdk-freebsd7.i386.1.6.0.07.02.tbzÎļþµ½/usr/ports/distfilesĿ¼ÏÂÈ»ºó pkg_add ¼´¿É
°²×°Ê±£¬ÐèÒª°²×°javavmwrapper-2.3.2.tbz¡£ÏÂÔØÖ®ºó·Åµ½/usr/ports/distfilesĿ¼Ï£¬°²×°diablo-jdk-freebsd7.i386.1.6.0.07.02.tbzʱ£¬»á×Ô¶¯°²×°¡£
2.2 make all install clean
2.3 ¼ì²é°²×°
freebsd# /usr/local/diablo-jdk1.6.0/bin/java -version
java version “1.6.0_07″
Diablo Java(TM) SE Runtime Environment (build 1.6.0_07-b02)
Diablo Java HotSpot(TM) Client VM (build
Ïà¹ØÎĵµ£º
·½·¨Ò»¡¢
login.html
<html>
<head>
<title>Óû§µÇ¼</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
</head>
<script language="javascript">
&nbs ......
JspÒ³ÃæÔÚURLÖд«µÝ²ÎÊý»á³öÏÖÂÒÂë
½â¾ö·½·¨ÈçÏ£º
Ò»¡¢Ê¹Óøü¸ÄTomcatµÄ·½·¨¡£Õâ¸ö·½·¨¼òµ¥£¬µ«ÊÇÐèÒª¸Ä¶¯µÄµØ·½ÊÇ·þÎñÆ÷Èí¼þ¼¶±ðµÄ£¬Èç¹ûÉÔ΢±ä¶¯ÏµÍ³½«ÎÞ·¨ÕýȷתÂ룬ÒÆÖ²ÐÔ²»¸ß¡£
1¡¢À´µ½tomcatĿ¼£¬ÕÒµ½confĿ¼ÏµÄserver.xmlÎʼۣ¬´ò¿ª£¬ÕÒµ½<Connector>±êÇ©£¬ÔÚ×îºóÌí¼ÓURIEncoding=’GBK’£¬Ð ......
£±.×îÖ±½Ó×î¼òµ¥µÄ£¬·½Ê½ÊÇ°ÑÎļþµØÖ·Ö±½Ó·Åµ½htmlÒ³ÃæµÄÒ»¸öÁ´½ÓÖС£ÕâÑù×öµÄȱµãÊÇ°ÑÎļþÔÚ·þÎñÆ÷ÉϵÄ·¾¶±©Â¶ÁË£¬²¢ÇÒ»¹ÎÞ·¨¶ÔÎļþÏÂÔؽøÐÐÆäËüµÄ¿ØÖÆ£¨ÈçȨÏÞ£©¡£Õâ¸ö¾Í²»Ð´Ê¾ÀýÁË¡£
£².ÔÚ·þÎñÆ÷¶Ë°ÑÎļþת»»³ÉÊä³öÁ÷£¬Ð´Èëµ½response£¬ÒÔresponse°ÑÎļþ´øµ½ä¯ÀÀÆ÷£¬ÓÉä¯ÀÀÆ÷À´ÌáʾÓû§ÊÇ·ñÔ¸Òâ±£´æÎ ......
index.jsp
<%@ page language="java" import="java.sql.*" import="java.lang.*" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
& ......