Install JDK and Tomcat in Linux (CentOS)
Install jdk and tomcat of tar.gz in CentOS 6.5.
Refer to: Configure and install Tomcat and configure the JDK environment in Linux (CentOS ).
1. Install jdk: I installed a Virtual Machine (CentOS) on Windows.
1. First download tar.gz, that is, a compressed package jdk
2. Create a directory under the path you want to install (mkdir/usr/jdk is installed under usr/jdk)
3. Drag the jdk compressed package on the windows machine to the usr/jdk directory you just created (you can drag it directly to the virtual directory)
4、if you drag the tar.gz compressed package to usr/jdk and report an error, it may be that you did not grant rwx or other permissions to this directory. You can use chmod777 jdk to grant this directory permissions.
5. decompress the tar.gz compressed package: tar-zxvf jdk.1.7.0.tar.gz (compressed file name). decompress the package and rename the original file name of mv (jdk1.7)
6. After decompression, the original package is not deleted. You can use rm-r 'package name' to delete the package.
7. Configure the environment: Use vim/etc/profile to open the file. Add three variables at the bottom: (here we will describe the installation path of/usr/JDK)
JAVA_HOME =/usr/JDK/jdk1.7
CLASSPATH =.; $ JAVA_HOME/lib/tools. jar
PATH = $ JAVA_HOME/bin: $ PATH
8. Set these three variables to the environment variable: export JAVA_HOME classpath path.
9. Save/etc/profile and exit (use ESC to exit vim's editing mode to normal mode, and then press shift +: Enter command mode and press wq! Force save the file content and exit the vim editor. This command is used to forcibly write data in the memory buffer to the file specified when vim is started, and then exit the vim editor .)
10. Make the file take effect immediately: source/etc/profile (the source command is usually used to re-execute the modified initialization file to make it take effect immediately without logging out and logging on again)
11. If you do not execute step 10, you can restart reboot (init 6 ).
12. Check whether jdk is successfully installed and used:
[Root @ bkjia tomcat] # java-version
Java version "1.7.0 _ 55"
Java (TM) SE RuntimeEnvironment (build 1.7.0 _ 55-b13)
Java HotSpot (TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
If java-version is output, the jdk has been installed successfully!
2. install tomcat (the premise is that jdk is installed correctly)
1. Copy tomcat to the/usr/tomcat directory to be installed.
2. decompress the package .tar.gz: tar-zxvf filename.tar.gz
3. Rename the extracted file:
Mv oldfilename (apache-tomcat-8.0.3) newfilename (apacht-tomcat8)
4. Start the unzipped tomcat/usr/tomcat/apache-tomcat8/bin/startup. sh if no error is reported, and the following information is displayed:
[Root @ bkjia tomcat] # apache-tomcat8/bin/startup. sh
UsingCATALINA_BASE:/usr/tomcat/apache-tomcat8.
UsingCATALINA_HOME:/usr/tomcat/apache-tomcat8.
UsingCATALINA_TMPDIR:/usr/tomcat/apache-tomcat8/temp
UsingJRE_HOME:/usr/JDK/jdk1.7
UsingCLASSPATH:/usr/tomcat/apache-tomcat8/bin/bootstrap. jar:/usr/tomcat/apache-tomcat8/bin/tomcat-juli.jar
Tomcat started. It indicates that tomcat is started correctly.
5. Open your browser and enter http: // localhost: 8080. Check that tomcat is displayed.
6. OK. tomcat installation is complete.
Iii. Summary:
1. The above jdk is installed with the .tar.gz compressed package. This jdk does not actually need to be installed, but it only decompress the configuration environment variable. In fact, it is not installed. As long as the environment variable is paired, no problem will occur!
2. tomcat is even simpler. You only need to unzip it and start it!
Load Balancing between Apache and multiple Tomcat clusters in Linux
Nginx Tomcat Cluster load balancing solution notes
Instance details Tomcat component installation + Nginx reverse proxy Tomcat + Apache use mod_jk and mod_proxy Reverse Proxy and load balancing
Deploy a log server using Rsyslog + LogAnalyzer + MySQL in CentOS 6.5
Build an Apache + Tomcat environment (JK deployment process)
Tomcat details: click here
Tomcat: click here
This article permanently updates the link address: