How to configure the Tomcat environment in Linux system

PHPz
Release: 2023-05-14 10:31:12
forward
2319 people have browsed it

The following steps are to deploy the jtomcat environment in the Linux system

  • Prerequisite preparation: successfully install the jdk environment (jdk installation steps)

  • Check the linux system version and download the corresponding tomcat installation package

 uname -a   查看下系统信息
Copy after login

How to configure the Tomcat environment in Linux system

1. Download the tomcat installation package

How to configure the Tomcat environment in Linux system

2. Upload the tomcat installation package and unzip it

How to configure the Tomcat environment in Linux system

3. Configure environment variables

vim /etc/profile  进去profile文件
Copy after login

4. Enter the I key

Switch to input mode.

5. Copy the configuration information

and paste it into the profile file as shown (enter in front of unset i)

export CATALINA_HOME=/usr/local/java/tomcat/apache-tomcat-9.0.38  设置为自己的tomcat目录位置
export CLASSPATH=.:$JAVA_HOME/lib:$CATALINA_HOME/lib
export PATH=$PATH:$CATALINA_HOME/bin
Copy after login

How to configure the Tomcat environment in Linux system

##6. Press the Esc key

to exit insert mode, enter: wq Save and exit

  • :wq Save and exit

  • :q! Do not save and exit regardless of editing or not.

  • source /etc/profile   文件修改生效命令
    Copy after login
7. Verify whether tomcat is installed successfully (default is 8080 port)

systemctl stop firewalld.service     关闭防火墙
Copy after login
cd /usr/local/java/tomcat/apache-tomcat-9.0.38/bin      进入Tomcat下的bin目录
Copy after login
./startup.sh  Tomcat     开启命令
Copy after login

8. As shown in the figure tomcat starts successfully

You can access 192.168.23.282:8080 through the browser (do not add https://)

How to configure the Tomcat environment in Linux system

How to configure the Tomcat environment in Linux system

Additional: tomcat debugging, related commands to start the firewall

./shutdown.sh           Tomcat关闭命令
./startup.sh  Tomcat    Tomcat 开启命令
Copy after login
systemctl stop firewalld.service        关闭防火墙
systemctl start firewalld               开启防火墙,没有任何提示即开启成功
systemctl restart firewalld             重启防火墙
systemctl disable firewalld.service     禁止firewall开机启动
Copy after login

The above is the detailed content of How to configure the Tomcat environment in Linux system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!