Procedures and considerations for deploying a Java Web project with Tomcat under Linux
I. Installing JDK to http://www.oracle.com/technetwork/java/javase/downloads/index.html download Java SE 6 Update 27
Choose Linux x64-rpm Installer or Linux x86-rpm based on the operating system Installer
Download Jdk-6u27-linux-x64-rpm.bin and put it in the/home directory, of course, anywhere else.
Note: Linux is case-sensitive!!! Add executable permissions to this file: chmod +x Jdk-6u27-linux-x64-rpm.bin
Then execute this file:. jdk-6u27-linux-x64-rpm.bin
Configure the Java environment variables to modify the/etc/profile file:
Vi/etc/profile then press the letter I into the insert mode, Shift+insert paste; ESC exits edit; : Wq save exit; : q! does not save the exit;
Add the following lines at the end:
#set Java evironment java_home=/usr/java/jdk1.6.0_27
Classpath=.: $JAVA _home/lib.tools.jar
Path= $JAVA _home/bin: $PATH export java_home CLASSPATH PATH
Use the echo command at the terminal to check environment variable settings:
#echo $JAVA _home
#echo $CLASSPATH
#echo $PATH
Check that the JDK is installed successfully: #java-version If you see the JVM version and related information, the installation is successful
Two. Tomcat Configuration deployment
(1) file upload: Download apache-tomcat-6.0.33.tar.gz on the Tomcat website and upload it to the Linux server
(2) Unzip the file as follows: TAR-ZXVF apache-tomcat-6.0.33.tar.gz-c/usr/local
(3) The compressed file is decompressed into the/usr/local directory, forming a new folder apache-tomcat-6.0.33, which is all the Tomcat-related execution profiles. (4) Modify the configuration file to increase the environment variable information of Java. Under/usr/local/apache-tomcat-6.0.33/bin file catalina.sh Add the following information to the file header (note case):
Export java_home=/usr/java/jdk1.6.0_27
Export classpath=.: $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/lib export path= $PATH: $JAVA _home/bin: $JAVA _home/jre/ Bin
(5) There is an executable program under the/usr/local/apache-tomcat-5.5.17/bin
Start Tomcat #./startup.sh Close Tomcat #./shutdown.sh
To see if the startup is successful, you can enter PS Axuwf|grep java, and if a lot of results occur, the boot succeeds.
You can also netstat-lnpt to see if Port 8088 is used. If it is used, the boot is successful.
(6) test Tomcat open IE, enter the URL http://ip address: 8080 You can see Tomcat's launch Welcome page to prove that Tomcat is configured correctly
The default port number can be modified in Tomcat/conf/server.xml: For example, change to 8088, note: Do not add elements as in Windows
Three. Deployment of Java Web Apps
Export the Web application into the war package file in Eclipse and copy it into the Tomcat/wabapps directory
The folder of the referenced items is also tested in the Tomcat/wabapps directory
Enter HTTP://IP address when you start Tomcat access again after closing: 8088/war file name/....
For example, if the war file is named Wapinfo.war, enter the HTTP://IP address: 8088/wapinfo/.... To access
To facilitate the management of the project, you can modify the/root/apache-tomcat-6.0.33/conf/tomcat-users.xml file,
At the end plus click the Tomcat Manager link in the upper left corner of the Tomcat Welcome page, enter admin,123456 to view the running apps.
Database error: [Table ' ac_posts ' is marked as crashed and should being repaired] SELECT a.*, b.post_content from Ac_posts a INNER JOIN ac_posts_content b on a.id = b.ID WHERE a.id in (80019,3758,28849,406596,421172,3759,375488,192743,301709) ORDE R by FIELD (a.ID, 80019,3758,28849,406596,421172,3759,375488,192743,301709);
Procedures and considerations for deploying a Java Web project with Tomcat under Linux