Installation of Tomcat under Linux

Source: Internet
Author: User

Write in front: Because the project uses jdk1.6 development, the corresponding server should install jdk1.6 and TOMCAT6 1, the environment variable configuration:Open/ETC/BASHRC Configuration environment variable Java_home=/usr/appsoft/jdk1.6.0_45/jreexport java_home classpath=& #36; java_home/lib/dt.jar:& #36; java_home/lib/tools.jar:& #36; Classpathexport CLASSPATH catalina_base=/usr/appsoft/tomcatexport catalina_base catalina_home= $CATALINA _baseexport Catalina_home path=\ $JAVA _home/bin:\ $CATALINA _home/bin:\ $PATHexport PATH 2. Make the environment variable effective:Execute after configuring environment variables: #source/ETC/BASHRC make environment variables effective 3. Install the Java Operating environment:A) upload the jdk-6u45-linux-i586.bin to the target machine's/usr/appsoft/software directory; b) open a terminal on the target machine and execute the following command in the terminal: #cd/usr/appsoft/software     #./jdk-6u45-linux-i586.bin after running will have a jdk1.6.0_45 directory C under/usr/appsoft/software) Move the jdk1.6.0_45 that is running Jdk-6u45-linux-i586.bin decompression to/usr/appsoft/. Specifically, execute the following command in the terminal: #mv jdk1.6.0_45/usr/appsoft 4. Tomcat Installation:The Tomcat installation package is named Apache-tomcat-6.0.20.zip, which is a binary release package that does not need to be compiled and can be used directly after decompression. The installation process is actually the archive file decompression process, and the extracted directory to rename, specifically: a) in binary mode to upload apache-tomcat-6.0.20.zip to/usr/appsoft/software. b) Decompression Apache-tomcat-6.0.20.zip, that is, enter the command in the terminal #unzip APACHE-TOMCAT-6.0.20.ZIPC) After the decompression is complete/usr/appsoft/software folder apache-to mcat-6.0.20. Move the folder to/usr/appsoft, and rename it to Tomcat. Enter the command in the terminal #mv Apache-tomcat-6.0.20/usr/appsoft/tomcat 5. Release procedureUpload the Iesweb.zip to/usr/appsoft/tomcat/webapps and unzip the #unzip Iesweb.zip 6. Start TomcatGo to the/usr/appsoft/tomcat/bin directory and execute the following command: #./catalina.sh run # ps-ef |grep java | Grep-v grep | grep Tomcat to see how the Tomcat process kills the Tomcat process: #kill-9 Process number 7. Verify that the publication is successfulEnter in the browser: http://localhost:8080/iesweb/jsp/login.jsp Verify that the login interface appears, such as the login interface, but the verification code can not be displayed in the "Problem handling" section of the method to resolve. Problem Handling:
    • Installing Java and Tomcat may have no permissions on Jdk-6u45-linux-i586.bin and Apache-tomcat-6.0.20.zip, need to add permissions: # chmod +x Jdk-6u45-linux-i586.bin Apache-tomcat-6.0.20.zip
    • No permissions required to execute catalina.sh: # chmod +x catalina.sh
    • Start tomcat times wrong: The BASEDIR environment variable is not defined correctly
This environment variable are needed to run the This program, check environment variables without errors, may be permissions issues: # chmod 777-r/usr/appsoft/tomcat/bin/ /c4>
    • After the program is published, "Verification code cannot display the problem": and reported the error: Linux Could not initialize class Java.awt.image.BufferedImage,
Workaround: Open the file/usr/appsoft/tomcat/bin/catalina.sh, at all similar to the following code:"$_runjava" $JAVA _opts $CATALINA _opts \-djava.endorsed.dirs= "$JAVA _endorsed_dirs"-classpath "$CLASSPATH" \-djava.security.manager \-djava.security.policy== "$CATALINA _base"/conf/catalina.policy \-dcatalina.base= "$CATALINA _base" \-dcatalina.home= "$CATALINA _home" \-djava.io.tmpdir= "$CATALINA _tmpdir" \ add a sentence at the tail:-djava.awt.headless=true \ The following changes are included:exec "$_runjava" $JAVA _opts $CATALINA _opts \-djava.endorsed.dirs= "$JAVA _endorsed_dirs"-classpath "$CLASSPATH" \-dcatalina.base= "$CATALINA _base" \-dcatalina.home= "$CATALINA _home" \-djava.io.tmpdir= "$CATALINA _tmpdir" \-djava.awt.headless=true \ take tomcat6.0 For example, a total of seven places such a place, modified well can be. This article references the following articles:
    • Linux tomcat6.0 and JDK installation detailed steps: http://blog.csdn.net/bingyingao/article/details/5614773
    • tomcat-Error The BASEDIR environment variable is not defined correctly:http://blog.csdn.net/evils798/article/details/7284594
  --------------------------------------------Linux Could not initialize class Java.awt.image.BufferedImage--------------------------------------------website Verification code suddenly unable to display, and reported the following error. Javax.servlet.ServletException:java.lang.NoClassDefFoundError:Could not initialize Class java.awt.image.bufferedimage  Online Search, in the catalina.sh add a sentence "-djava.awt.headless=true \", Problem solving. It is generally found that the user who started Tomcat was unable to access Xserver, including Xserver no boot or no access .  the following is a paste: 1. What is headless mode?  headless mode is a configuration mode of the system. In this mode, the system is missing a display device, keyboard, or mouse.  2. When to use and headless mode? Headless mode is not what we would like to see, but in fact we often need to work in this mode, especially the server-side program developers. Because servers (such as hosts that provide Web services) tend to lack the aforementioned devices, they also need to use the features they provide to generate the appropriate data to provide to the client (such as the browser's host with the associated display device, keyboard, and mouse).  3. How to use and headless mode? Generally in the program starts to activate headless mode, tell the program, now you want to work in headless mode, do not expect the hardware to help, you have to rely on the system's computational ability to simulate these characteristics to: System.setproperty (" Java.awt.headless "," true ");  modify the ${tomcat_home}/bin/catalina.sh or ${tomcat_home}/bin/catalina.bat file: at all similar to the following code:     "$_runjava" $JAVA _opts $CATALINA _opts \     -djava.endorsed.dirs= "$JAVA _endorsed_dirs"-classpath "$CLASSPATH" \     - Djava.security.manager \     -djava.security.policy== "$CATALINA _base"/conf/ Catalina.policy \     -dcatalina.base= "$CATALINA _base" \     - Dcatalina.home= "$CATALINA _home" \     -djava.io.tmpdir= "$CATALINA _tmpdir" \  Add a sentence at the end:       -djava.awt.headless=true \  modified content as follows:    exec "$_ Runjava "$JAVA _opts $CATALINA _opts \     -djava.endorsed.dirs=" $JAVA _endorsed_dirs "- Classpath "$CLASSPATH" \     -dcatalina.base= "$CATALINA _base" \      -dcatalina.home= "$CATALINA _home" \     -djava.io.tmpdir= "$CATALINA _tmpdir" \       -djava.awt.headless=true \  Take tomcat6.0 For example, a total of seven places such a place, modified well can.  

Installation of Tomcat under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.