ÔÚLinuxÏ´ jsp »·¾³ÅäÖÃ
ºìÆì×ÀÃæLinux4.1Ï°²×°ºÍÅäÖÃJSP·þÎñÆ÷È«¹¥ÂÔ
ÕâÁ½ÌìÊÔ×ÅÔÚºìÆìLinux×ÀÃæ°æ4.1Ï°²×°WEB·þÎñÆ÷£¬Òѳɹ¦°²×°£¬ÏÖ°ÑÎҵݲװ¹ý³Ì½éÉÜÈçÏ£¬ÒÔ¸øÓÐÏàËÆÐèÇóµÄÍøÓѲο¼¡£
ÎҵݲװҪÇóÊÇÖ§³ÖJSP¡¢html¡¢htmÍøÒ³£¬ËùÒÔÑ¡ÓÃJDK1.5.0+Tomcat5.5.4+mySQL4.1.7£¬ÕâЩ¶¼Êǵ±Ç°¸÷Èí¼þ×îеÄÎȶ¨°æ±¾£¨·Ç²âÊ԰棩¡£ÔÝûÓа²×°ApacheºÍÖ§³ÖPHP£¬Ö÷ÒªÊÇ¿¼Âǵ½ÓÃ×ÀÃæ°æLinuxµÄÍøÓÑ»ù±¾ÊǸöÈËÍøÕ¾£¬Ö÷ÒªÊÇΪѧϰ¡¢²âÊÔJSP¶øÓã¬ÓÃÕâЩÅäÖÃÒѾÊǴ´ÂÓÐÓ࣬¿öÇÒ¸üÄÜÇá×°ÉÏÕó£¬Èô¶ÔApacheºÍPHP¸ÐÐËȤµÄ»°¿ÉÒÔ×Ô¼ºÌí¼Ó°²×°¡£
×¢Ò⣬ÔÚÏÂÃæµÄ°²×°ÖУ¬¿ªÍ·´ø#ºÅµÄ´ú±írootÓû§ÔÚϵͳÖÕ¶ËϵIJÙ×÷£¬Êµ¼Ê²Ù×÷ʱ²»ÓÃÊäÈë#ºÅ¡£
Ò»¡¢ÏÂÔØÏà¹ØµÄ±ØÒªÈí¼þ£¬·Åµ½Ò»¸öͳһĿ¼£¨Èç/tmp/myDown£©£º
1¡¢ÏÂÔØJDK1.5.0°²×°°ü£¨¼´JAVA5.0£©£¬ÎļþÃû£ºjdk-1_5_0-linux-i586-rpm.bin
ÏÂÔØÁ´½Ó£º[java.sun.com]
2¡¢ÏÂÔØTomcat°²×°°ü£¨Ö§³ÖJSP£©£¬ÎļþÃû£ºjakarta-tomcat-5.5.4.tar.gz
ÏÂÔØÁ´½Ó£º[apache.freelamp.com]
3¡¢ÏÂÔØmySQL°²×°°ü£¨Êý¾Ý¿âÈí¼þ£©£¬ÎļþÃû£ºmysql-standard-4.1.7-pc-linux-i686.tar.gz
ÏÂÔØÁ´½Ó£º[dev.mysql.com]
4¡¢ÏÂÔØmySQLµÄJDBCÇý¶¯£¬ÎļþÃû£ºmysql-connector-java-3.0.16-ga.tar.gz
ÏÂÔØÁ´½Ó£º[dev.mysql.com]
¶þ¡¢°²×°Èí¼þ
1¡¢°²×°JDK£¨ÒòJDK°üº¬JRE£¬ÈôÔÀ´×°LumaQQʱ°²×°ÁËJRE£¬ÇëÏÈжÔØJREµÄrpm°ü£¬¿É½ÚÊ¡85M¿Õ¼ä£©
£¨1£©°²×°£º
#cd /tmp/myDown
#./jdk-1_5_0-linux-i586-rpm.bin
ÕâÑùJDK¾Í°²×°µ½ÁË/usr/java/jdk1.5.0Ŀ¼
£¨2£©±à¼Îļþ/etc/profile£¬ÔÚ×îºó¼ÓÈ룺
export JAVA_HOME=/usr/java/jdk1.5.0
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export PATH=$PATH:$JAVA_HOME/bin
£¨3£©ÎªÈÃÐÂÅäÖÃÉúЧ£¬ÔËÐÐ#source /etc/profile
£¨4£©²âÊÔ£¬ÓÃÎı¾±à¼Æ÷дһ¸öjava³ÌÐòÀ´ÑéÖ¤£¬±£´æÔÚ/tmp/myDownĿ¼£¬ÎļþÃû£ºHelloWorld.java£¬ÊäÈëÈçÏÂÄÚÈÝ£º
public class HelloWorld{
public static void main(String args[]){
System.out.println("Hello£¬Wrold");
}
}
È»ºó£¬ÔÚÖÕ¶ËÏÂÖ´ÐУº
#cd /tmp/myDwon
#javac HelloWorld.java
#java HelloWorld
ÕâʱÈç¹û³öÏÖ"Hello,World"£¬¾Í˵Ã÷ÄãµÄJAVA±àÒë¡¢ÔËÐл·¾³´î½¨ºÃÁË¡£
2¡¢°²×°Tomcat
£¨1£©ÔÚͼÐλ·¾³ÏÂÓÒ¼üµ¥»÷jakarta-tomcat-5.5.4.tar.gzÎļþͼ±ê£¬Ñ¡Ôñ½âѹµ½/usr/localĿ¼¡£
Ϊ·½±ãʹÓã¬ÔÚÖÕ¶ËÏÂÖ´ÐУº
#cd /usr/local
#ln
Ïà¹ØÎĵµ£º
Ò»¸öÕ¾µã·þÎñÆ÷ÖÐËùÓеÄÓû§¹«ÓÃÒ»¸öapplication¶ÔÏ󣬵±Õ¾µã·þÎñÆ÷¿ªÆôʱ£¬¸Ã¶ÔÏó¾Í±»´´½¨£¬Ö±µ½ÍøÕ¾¹Ø±Õ£»Ò²¾ÍÊÇ˵£º¸Ã¶ÔÏóÒ»µ©±»´´½¨ÁË£¬Ëü½«±»±£´æÔÚ·þÎñÆ÷ÉÏ£»ËüµÄÉúÃüÖÜÆÚÓë·þÎñÆ÷µÄÉúÃüÖÜÆÚÏàͬ£»³£Ó÷½·¨ÈçÏÂ
setAttribute(String name,Object o)£º½«Ãû×ÖΪname£¬ÖµÎªoµÄÊý¾Ý´æ´¢µ½appli ......
¸Ã¶ÔÏóÊÇjavax.servlet.ServletResponseÀàµÄʵÀý£¬Æä×÷ÓøպÃÓërequest¶ÔÏóÏà·´£¬request¶ÔÏóÊÇ°üº¬ÁË¿Í»§ÇëÇóµÄÓйØÐÅÏ¢£¬¶øresponse¶ÔÏóÊÇ°üº¬ÁËÏìÓ¦¿Í»§ÇëÇóµÄÓйØÐÅÏ¢£»³£Ó÷½·¨ÈçÏÂ
addCookie(Cookie c)£ºÌí¼ÓÒ»¸öCookie¶ÔÏó£¬ÓÃÀ´±£´æ¿Í»§¶ËµÄÓû§ÐÅÏ¢
sendRedirect(URL)£º½«µ±Ç°¿Í»§¶ËµÄ ......
Cookie¶ÔÏóÊÇÓÉWeb·þÎñÆ÷²úÉúºó±£´æÔÚä¯ÀÀÆ÷ÖеÄÐÅÏ¢£¬Ëü¿ÉÒÔÓÃÀ´±£´æһЩСÁ¿µÄÐÅÏ¢ÔÚä¯ÀÀÆ÷ÖУ»¸Ã¶ÔÏó²»ÊôÓÚJspµÄÄÚÖöÔÏó£¬ËüÐèÒª¹¹Ôì²ÅÄÜʹÓÃ
1. ¹¹Ô죺
Cookie cookie¶ÔÏóÃû=new Cookie(cookie±äÁ¿Ãû£¬cookieÖÐËù´æ´¢µÄ¶ÔÏó)
2. cookieµÄдÈëÓë¶ÁÈ¡
&nbs ......
ʲôÊǸùÎļþϵͳ
¸ùÎļþϵͳÊ×ÏÈÊÇÒ»ÖÖÎļþϵͳ£¬µ«ÊÇÏà¶ÔÓÚÆÕͨµÄÎļþϵͳ£¬ËüµÄÌØÊâÖ®´¦ÔÚÓÚ£¬ËüÊÇÄÚºËÆô¶¯Ê±ËùmountµÄµÚÒ»¸öÎļþϵͳ£¬Äں˴úÂëÓ³ÏñÎļþ±£´æÔÚ¸ùÎļþϵͳÖУ¬¶øϵͳÒýµ¼Æô¶¯³ÌÐò»áÔÚ¸ùÎļþϵͳ¹ÒÔØÖ®ºó´ÓÖаÑһЩ»ù±¾µÄ³õʼ»¯½Å±¾ºÍ·þÎñµÈ¼ÓÔص½ÄÚ´æÖÐÈ¥ÔËÐС£
ÎÒÃÇÊ×ÏÈ´ÓÖ÷»úÉÏËù°²×°µÄLinux²Ù×÷ϵͳ ......
LinuxÍø¿¨µÄ¶Áд±à³Ìzz
LinuxϵͳµÄËùÓÐÉ豸¶¼ÊÇÒÔÎļþµÄÐÎʽ´æÔڵģ¬ËùÒÔ¶ÔϵͳµÄ²Ù×÷¿ÉÒÔת»»Îª¶ÔÎļþµÄ²Ù×÷¡£±¾³ÌÐòʵÏÖ¶ÔÍø¿¨Õâ¸öÓ²¼þÉ豸½øÐжÁÈ¡²Ù×÷£¬¼´Ò²ÊǶÔÉ豸µÄÎļþ½øÐжÁд²Ù×÷¡£´úÂë¿´ËÆÂé·³£¬µ«È´²»¸´ÔÓ¡£
Ö÷ÒªµÄϵͳº¯ÊýÓУºsocket(),ioctl(),memcpy(),strcpy()¡£
Á½¸ö¸´ÔӵĽṹÌ壺sockaddr_in,ifreq¡ ......