How to install and configure JSP servers under Hongqi desktop linux4.1 <br/> in the past two days, I have tried to install Web servers under Hongqi Linux Desktop 4.1, I will introduce the installation process as follows for reference by netizens who have similar requirements. <Br/> my installation requirements are to support JSP, HTML, and htm web pages. Therefore, JDK 1.5.0 + Tomcat 5.5.4 + mysql4.1.7 is the latest stable version of each software (non-beta version ). Apache is not installed yet and PHP is supported. The main reason is that users who use Linux on the desktop are basically personal websites and are mainly used for learning and testing JSP. These configurations are more than enough, in addition, it is easier to install. If you are interested in Apache and PHP, you can add and install them on your own. <Br/> note: In the following installation, the start number # represents the operation performed by the root user on the system terminal. You do not need to enter the number # In actual operations. </P> <p> 1. Download necessary software and put it in a unified directory (for example,/tmp/mydown ): <br/> 1. Download The jdk1.5.0 installation package (java5.0). File Name: jdk-1_5_0-linux-i586-rpm.bin <br/> download link: [java.sun.com] <br/> 2. Download the tomcat installation package (JSP supported), file name: jakarta-tomcat-5.5.4.tar.gz <br/> download link: [apache.freelamp.com] <br/> 3. Download the MySQL installation package (database software), file name: mysql-standard-4.1.7-pc-linux-i686.tar.gz <br/> download link: [dev.mysql.com] <br/> 4. Download The JDBC driver of MySQL, file name: mysql-connector-java-3.0.16-ga.tar.gz <br/> download link: [Dev. MYS Ql.com] </P> <p> 2. Install software <br/> 1. Install JDK (because JDK contains JRE, if JRE is installed when lumaqq is installed, uninstall the RPM package of JRE to save MB of space.) <br/> (1) installation: <br/> # cd/tmp/mydown <br/> #. /jdk-1_5_0-linux-i586-rpm.bin <br/> so that JDK is installed to the/usr/Java/jdk1.5.0 directory <br/> (2) edit the file/etc/profile, add at last: <br/> export java_home =/usr/Java/jdk1.5.0 <br/> export classpath = $ classpath: $ java_home/lib/tools. jar: $ java_home/lib/DT. jar :. <br/> export Path = $ path: $ java_home/bin <br/> (3) to make the new configuration take effect, Run the # source/etc/profile <br/> (4) test. Use a text editor to write a Java <SPAN class = 'wp _ keywordlink '> Program </span> for verification, save it in the/tmp/mydown directory, file name: helloworld. java, enter the following content: <br/> public class helloworld {<br/> Public static void main (string ARGs []) {<br/> system. out. println ("Hello, wrold"); <br/>}</P> <p> then, run: <br/> # cd/tmp/mydwon <br/> # javac helloworld. java <br/> # Java helloworld <br/> If "Hello, world" appears, it indicates that your Java compiling and running environment has been set up. </P> <p> 2. install Tomcat <br/> (1) in the graphic environment, click the jakarta-tomcat-5.5.4.tar.gz file icon on the right, and extract it to the/usr/local directory. <Br/> For ease of use, run the following command on the terminal: <br/> # cd/usr/local <br/> # ln-s jakarta-tomcat-5.5.4 Tomcat <br/> (2) edit the/etc/profile file and add: Export catalina_home =/usr/local/tomcat at the end. <br/> (3) if you require the system to start Tomcat automatically at startup (if you do not have this requirement, you do not need to do so), modify/usr/local/tomcat/bin/startup. SH: <br/> export java_home =/usr/Java/jdk1.5.0 <br/> export classpath = $ classpath: $ java_home/lib/tools. jar: $ java_home/lib/DT. jar :. <br/> export Path = $ path: $ java_home/bin <br/> exp ORT catalina_home =/usr/local/tomcat <br/>/usr/local/tomcat/bin/Catalina. sh start </P> <p> and in/etc/rc. d/RC. add:/usr/local/tomcat/bin/startup to local. sh </P> <p> (4) run # source/etc/profile to make the configuration take effect and run/usr/local/tomcat/bin/startup. sh start Tomcat <br/> (5) test. Enter [localhost: 8080] in the browser. If the welcome page of Tomcat appears, the installation is successful. </P> <p> 3. Install mysql <br/> (1) in the graphic environment, click the mysql-standard-4.1.7-pc-linux-i686.tar.gz file icon on the right, and extract the package to the/usr/local directory. <Br/> For ease of use, run the following command on the terminal: <br/> # cd/usr/local <br/> # ln-s mysql-standard-4.1.7-pc-linux-i686 mysql <br/> and then run: <br/> # cd mysql <br/> # scripts/mysql_install_db user = mysql <br/> # chown-r root. <br/> # chown-r Mysql Data <br/> # chgrp-r MySQL. <br/> # bin/mysqld_safe user = MySQL & <br/> (2) test, <br/> # cd/usr/local/MySQL/bin <br/> #. /MySQL <br/> if you can see the mysql> symbol, the installation is successful. </P> <p> 4. Install the MySQL JDBC driver <br/> (1) press the mysql-connector-java-3.0.16-ga.tar.gz file icon in the graphic environment and decompress it to the current directory (/tmp/mydown) <br/> (2) copy the extracted mysql-connector-java-3.0.16-ga-bin.jar to/usr/local/tomcat/common/lib <br/> (3) add MySQL user permissions to access the database from the Local Machine (run JSP required ), do not enter the content in the brackets: <br/> # cd/usr/local/MySQL/bin <br/> #. /MySQL <br/> mysql> grant all privileges on *. * to MySQL (User Name) @ localhost. localdomain (local host name) identified by ''(password); <br/> mysql> q Uit </P> <p> 3. Complete testing of Tomcat + JDK + MYSQL: <br/> 1. Create a subdirectory test under/usr/local/tomcat/webapps. <br/> 2. Copy the directory (note that the entire directory is used) usr/local/tomcat/webapps/root/WEB-INF to the new test directory <br/> 3. Create an index under the test directory. JSP file: <br/> <% @ page contenttype = "text/html; charset = gb2312" %> <br/> <% @ page import = "Java. SQL. * "%> <br/> <title> test JSP page (Tomcat + MySQL) under Hongqi desktop linux4.1 </title> <body> <br/> <% class. forname ("org. gjt. mm. mySQL. driver "). newinstance (); <br/> Str Ing url = "JDBC: mysql: // localhost: 3306/MySQL? User = root & Password = & useunicode = true & characterencoding = gb2312 "; <br/> connection conn = drivermanager. getconnection (URL); <br/> statement stmt = Conn. createstatement (resultset. type_scroll_sensitive, resultset. concur_updatable); <br/> string SQL = "select * from user"; <br/> resultset rs1_stmt.exe cutequery (SQL ); %> <br/> <Table> <tr> <TD> the content of your first field is: </TD> <br/> <TD> the content of your second field is: </TD> <br/> </tr> <br/> <% while (RS. next ()) {%> <Br/> <tr> <TD> <br/> <% = Rs. getstring (1) %> </TD> <br/> <% = Rs. getstring (2) %> </TD> </tr> <br/> <% }%> <br/> </table> <br/> <% Out. print ("Tomcat + JDK + MySQL complete test. Congratulations! database operation successful! "); %> <Br/> <% Rs. close (); <br/> stmt. close (); <br/> Conn. close (); <br/>%> <br/> </body> </P> <p> 4. Test the function. In the browser, enter [localhost: 8080]. if "Tomcat + JDK + MySQL complete test is displayed, congratulations! The database operation is successful! ", It indicates that the overall configuration of Tomcat + JDK + MySQL is successful. <Br/>