Home  >  Article  >  Operation and Maintenance  >  How to configure the Tomcat environment in Linux system

How to configure the Tomcat environment in Linux system

PHPz
PHPzforward
2023-05-14 10:31:122322browse

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   查看下系统信息

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文件

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

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   文件修改生效命令
7. Verify whether tomcat is installed successfully (default is 8080 port)

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

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 开启命令
systemctl stop firewalld.service        关闭防火墙
systemctl start firewalld               开启防火墙,没有任何提示即开启成功
systemctl restart firewalld             重启防火墙
systemctl disable firewalld.service     禁止firewall开机启动

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete