In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to install jdk and tomcat under redhat linux5.6". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install jdk and tomcat under redhat linux5.6.
First, install JDK
1. Download the jdk installation file jdk-1_5_0_19-linux-amd64.bin first
Then upload the bin file to the linux server and put it under / usr/java (the java directory can be built by yourself)
two。 And then enter
# cd / usr/java
Modify permissions to make them have execute permissions
# chmod axix (or 775) jdk-1_5_0_19-linux-amd64.bin
#. / jdk-1_5_0_19-linux-amd64.bin
* the installer runs *
Wait a minute, the installation is complete (if prompted, press Y to continue)
# cd / usr / java/jdk-1_5_0_19
# ls
Enter the above command to view the successfully installed java file, and our jdk installation is complete.
(if a JDK has been installed, it can be packaged and copied to another machine for decompression.)
two。 Configure environment variables
After java is installed under windows, you need to configure environment variables, and linux is not additional.
# vi / etc/profile
Add the following lines to the file, and then save the exit (command: wq), so that our java environment variable is set.
JAVA_HOME=/usr/java/jdk1.5.0_19
CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
Export PATH CLASSPATH JAVA_HOME
/ / the following is the environment variable of the set tomcat. Write here first, and then you need to set the environment variable to install tomcat.
Export CATALINA_BASE=/usr/tomcat/apache-tomcat-6.0.29
Export CATALINA_HOME=/usr/tomcat/apache-tomcat-6.0.29
Note that the specific path in the above setting environment variables needs to be modified according to your actual installation path.
Note: # source / etc/profile makes the environment variable effective
# java-version to check whether the version is consistent with the installation
three。 Deploy Tomcat
1. Download the Tomcat installation file, I am using the apache-tomcat-6.0.29.tar.gz installation-free version. Use ssh's file transfer tool to upload it to the linux server. I will put it under this file (the / usr/tomcat directory can be built by yourself).
two。 Run the following command to decompress
# cd / usr/tomcat
# tar zxvf apache-tomcat-6.0.29.tar.gz
* decompressing *
After the decompression is successful, refer to step 2 and set the environment variable of tomcat.
Enter the following command to start tomcat
# cd / usr/tomcat/tomcat-6.0.29/bin
#. / startup.sh
* Tomcat starts *
(if you want to migrate TOMCAT to another directory, you can translate it directly by CP-RA)
3. Then enter your server's IP address url in the browser under windows, such as http://IP address: 8080
The home page of tomcat shows that tomcat has been installed successfully.
four。 Problems encountered during installation and their solutions
If you enter the above url access failure, that is, tomcat startup failure, use the following method to try to handle
(1)。 Permission issues, user permissions and whether the file has executable permissions.
a. Ordinary user permissions are generally insufficient, please Google command to add permissions to the user, I am using the root user to install, so I did not encounter this problem.
b. The permissions of the file are not enough, and most of the time there are no executable permissions. After I failed in the installation process, I gave executable permissions to all files in the following files (/ usr/tomcat/tomcat-6.0.29/bin) folder. The following command is available.
# cd / usr/tomcat/tomcat-6.0.29/bin
# chmod 777 "File name" (e.g. # chmod 777 startup.sh)
(2) Firewall and port problems check whether the 8080 end of tomcat is enabled.
First of all, to determine if it is a firewall problem, you can run the following command to turn off the firewall service, and then access to see if it is normal. If it is normal, it means that it is a firewall problem. I encountered this problem during the installation process. When I found the firewall problem later, I solved it with the following methods.
Turn off the firewall service command for the server
# service iptables stop
Turn on the firewall service command of the server
# service iptables start
Edit and open the corresponding port of the firewall command
# vim / ect/sysconfig/iptables
Check whether the port is occupied, check the port command
# netstat-tpan | gerp 8080
View all process commands
# ps-ef
Kill a process command
# kill process id (Note: hehe, it feels much simpler than under windows, kill you, hehe)
View all initial service commands of the system
# cd / etc/rc.d/init.d
# ls
Mount the service, delete the service, and the list of services can be found by using the following command
# chkconfig-h
Add:
The command to turn off tomcat:
First go to the tomcat directory: cd / usr/local/apache-tomcat-6.0.29/bin/
Then execute:. / shutdown.sh-s
Command to start tomcat:
Cd / usr/local/apache-tomcat-6.0.29/bin/
. / startup.sh
If you want to debug, you can start like this:
. / catalina.sh run (display message to start, turn off will shut down TOMCAT)
If tomcat cannot be stopped, you can kill the process with the kill command:
Linux kill all tomcat processes of a user
Ps aufx | grep tomcat | grep root | awk'{print $2}'| xargs kill-9
Change the default connection port 8080 to 80 through connect port in the server.xml file under conf
At this point, I believe you have a deeper understanding of "how to install jdk and tomcat under redhat linux5.6". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.