Install JDK in Linux and Tomcat and shell scripts to shut down the started process

Source: Internet
Author: User

Enter UNAME-A in the command line mode, for example, when the interface shows i386 that the Linux system is version 32, download the corresponding JDK version on the official website, or load it directly onto my network disk Http://pan.baidu.com/s/1cqMNd8

upload the downloaded tar package to the server path via the RZ command/usr/local and decompression by command: TAR-XF jdk-7u67-linux-i586.tar.gzEdit the system hidden file profile and add the JDK's path, command: Vi/etc/profile, in the open interface through the I command at the end of the smell of text add a script, after the addition of Save and through the command: reboot restart After the reboot is successful, the Java version can be viewed by command: Java-version
Export Java_home=/usr/local/jdk1.6.0_27 (this folder has the same name as the folder you downloaded from the JDK) export java_bin=/usr/local/jdk1.6.0_27/ Bin (ibid.) export path= $PATH: $JAVA _home/binexport classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jarexport Java_home Java_bin PATH CLASSPATH
If viewing version command error: failed/usr/local/jdk1.6.0_10/jre/lib/i386/client/libjvm.so, because/usr/local/jdk1.6.0_10/jre/lib/ I386/client/libjvm.so:cannot Restore segment Prot After Reloc:permission denied, modify the system files SELinux: 1, open/etc/selinux/ Config2, change selinux=enforcing to Selinux=disabled3, restart Linux through the above steps, that is, to complete the installation of Linux under the JDK, the next step is to install Tomcat to enter the Tomcat official website download:/http tomcat.apache.org/download-60.cgi, such as download the core download after the files extracted to/usr/local and then start tomcat
    1. #cd /usr/local/tomcat/bin/
    2. #./startup.sh
Use the above steps to complete the Tomcat installation using Tomcat sometimes the shutdown command cannot close a process that has already been started, so we can pass the KILL command, which can be used locally to edit a shell script that ends in a sh. The idea is to determine if the Tomcat process exists, kill if it exists, and do nothing if it doesn't exist.
#!/bin/sh if [-z] $ (ps-ef | grep Tomcat | Grep-v ' grep tomcat ' | Awk-f ' {print $} ' | Awk-f ' {print '} '); Then     echo "The Tomcat have Shutdwon, I want to do others" fi if [-N "$ (Ps-ef | grep Tomcat | Grep-v ' grep tomcat ' | Awk-f ' {print $} ' | Awk-f ' {print '} ');  Then     {echo "The Tomcat had STARTP, I want to kill it"; kill-9 $ (Ps-ef | grep tomcat | grep-v ' grep tomcat ' | awk-f ' {print $} ' | Awk-f ' {print '} ')} fi

Install JDK in Linux and Tomcat and shell scripts to shut down the started process

Related Article

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.