In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
First create a virtual machine. The version of the virtual machine I use is CentOS7.
Upload compressed packages from Oracle JDk and Tomcat servers to the server
Tomcat download address: http://tomcat.apache.org/
JDK download address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Install Oracle JDK
1. First create a folder java under the usr directory
Sudo mkdir-p / usr/java
two。 Enter the following command to extract:
Sudo tar-zxvf / home/user/jdk-8u161-linux-x64.tar.gz-C / usr/java/
The decompression is as shown in the following figure:
3. Configure the environment variables for JDK
Export JAVA_HOME=/usr/java/jdk1.8.0_161export JRE_HOME=$ {JAVA_HOME} / jre export CLASSPATH=.:$ {JAVA_HOME} / lib:$ {JRE_HOME} / lib export PATH=.:$ {JAVA_HOME} / bin:$PATH
4. Make the configuration in / etc/profile effective immediately
Source / etc/profile
5. Test whether java is installed successfully
Java-version
Install the Tomcat server
1. Extract the Tomcat to the specified folder (I unzip it to the / home/user folder)
Tar-zxvf / home/user/apache-tomcat-9.0.6.tar.gz
two。 After decompressing, the following folder (apache-tomcat-9.0.6) appears when you enter the usr directory.
Modify the server.xml configuration file by adding the following statement: # where docBase is my Tomcat directory
4. Turn off CentOS's firewall
(1) check the firewall status first.
Systemctl status firewalld.service
(2) turn off the firewall and disable boot to start the firewall.
Systemctl stop firewalld.servicesystemctl disable firewalld.service
Tomcat server startup and shutdown
1. Start the Tomcat server
Go to the bin directory of the tomcat server, and then execute the ". / startup.sh" command to start the Tomcat server, as shown in the following figure:
(1) check the Log information of the tomcat server to see whether the tomcat server has been started normally. Enter the logs directory under the tomcat server, and open the catalina.out file to view, as shown below:
(2) enter IP:8080 in the browser and you can see the following figure:
(3) create a file HelloWorld in webapps to test whether tomcat is successful or not
Cd / home/user/apache-tomcat-9.0.6/webapps/vim HelloWorld
What is written in the HelloWorld file
Accessing IP:8080/HelloWorld on the browser displays something like the following figure:
This indicates that the Tomcat server has started normally and successfully.
If tomcat fails to start, then it is most likely that the port used at startup is occupied by another application, so you can troubleshoot it by, for example, which application port 8080 is occupied by.
two。 Shut down the Tomcat server
Go to the bin directory of the tomcat server, and then execute the ". / shutdown.sh" command to start the Tomcat server, as shown in the following figure:
Check the Log information of the tomcat server to see if the tomcat server has been shut down normally. Go to the logs directory under the tomcat server, and open the catalina.out file to view, as shown below:
Deploy JavaWeb applications to the Tomcat server
To deploy a JavaWeb application to a Tomcat server is to package the open JavaWeb application into a war package and publish it to the webapps directory of the tomcat server.
Package JavaWeb application
Open eclipse, right-click the project and click Export to select war file
Then click Finish.
This is the packaged war package.
Publish the war package to the tomcat server
1. Upload the packaged war package to the webapps directory of the tomcat server as shown below:
two。 Uploaded successfully
The Tomcat server automatically decompresses the war package
3. Then the following screen appears when you visit IP:8080/Portal:
At this point, the installation of the Tomcat server and the deployment of the Web application are complete.
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.