Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Centos install tomcat

Shulou Source: shulou.com Published: 2022-06-01 03:02:52 10月04日 Update

Install tomcat

The installation of 1.tomcat depends on jdk, so before installing tomcat, you need to install Java, find his package online, then type the command mkdir-p / data/server to create a multi-level directory, and then I install the jdk1.8 version

two。 Then extract the downloaded package of tar-zxvf +-C / data/server/ and extract the installed package to serve.

3. Then type vi / etc/profile to set the environment, and then add export JATA_HOME=/data/server/jdk1.8 on the last line

Export CLASSPATH=.:JAVA_HOME/lib/dt.jar:$JAVA_HOME/jib/tools.jar

Export PATH=$JAVA_HOME/bin, and then the configuration file takes effect source / etc/profile

4. Start installing the tomcat official website address https://tomcat.apache.org/download-80.cgi. After downloading, execute the command tar-zxvf apache-tomcat-8.5.40.tar.gz.

Mkdir-p / data/server

Mv apache-tomcat-8.5.40 tomcat8

Mv tomcat8 / data/server

5. Then turn on tomcat

. / startup.sh

Echo $?

6. Check whether the tomcat service is enabled, but ps aux | grep tomcat and netstat-pantu | grep 8080

7. Turn off the firewall

Systemctl stop firewalld.service

8. View the tomcat web page, which can be viewed in the virtual via curl 127.0.0.1 8080

If it still doesn't work when the firewall is turned off, enter curl 127.0.0.1VO8080

Tags: Commands firewalls input fire prevention no one line address file version environment directory web page or before accessible installed service configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker vpn Apple NVidia MySQL