Pits encountered when deploying multiple Tomcat

According to the requirements, multiple Tomcats are deployed on one server. Each Tomcat is set with different ports. Some pits encountered are recorded as follows:

Tomcat version: 8.5.57
Mysql version: 8.0.20
Operating system: centos 7.8

Note: each Tomcat needs to modify and set different ports. This basic problem is over. Since I wrote this after arranging the errors, some of them don't remember the details of the error report, but remember the solution.

1. Startup error

The AJP Connector is configured with secretRequired="true"

Solution:

Modify the configuration file of each Tomcat in /conf/server Add settings to XML

Original setting:
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Changed settings:
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" secretRequired="" />

References: https://www.cnblogs.com/zhang-yawei/p/12975326.html

2. When the project was started, there was an error, and the details of the error were forgotten

Solution:

Reset the Java environment variables. The default environment Java environment variables have been overwritten:

1. Execute: which java, return: /usr/bin/java
2. Execute: ls -lr /usr/bin/java, return: /etc/alternatives/java
3. Execute: ls -lrt /etc/alternatives/java, return: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3 B13.el7_ 5.x86_ 64/jre/bin/java

4. Execution: vim /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el7_5.x86_64
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

5. Configuration takes effect: source /etc/profile

References: https://www.cnblogs.com/juihai/p/11710381.html

3. An error is reported after Tomcat is started

The following error is reported:

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]

Solution:

Modify the configuration file /conf/server XML, comment out the following lines:

<!-- <Context path="" docBase="..." reloadable="true"/> -->

References: https://www.cnblogs.com/yshyee/p/11019091.html

4. When the browser is opened, it is 404

Solution:

Use the newly extracted ROOT folder and put it in the /tomcat/webapps directory

Because the default page of Tomcat is under the ROOT directory, sometimes if it is accidentally deleted, it will report 404. This is also a Japanese dog problem. After checking a lot of data, it is found that this is the ghost.

5. Default page after browser opens

What if you want the browser to open a self-developed project page

Modify the configuration file /conf/server XML, add the following line:

<Context path="" debug="0" docBase="/opt/tomcat/webapps/security" />

Mainly the docBase value.

References: https://blog.csdn.net/spjhandsomeman/article/details/8293594

6. Tomcat cannot be accessed normally after startup

It may also be a firewall problem. Turn off the firewall:

systemctl disable firewalld

References:
https://www.cnblogs.com/aprilwang/p/10954928.html
https://blog.csdn.net/qq_40002311/article/details/88899549

7. The corresponding Mysql database of JIRA configuration

A lot of configuration is searched on the Internet, but where to do the configuration is very confused

Here:

//Under this tab:
<Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false">
          <Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"

         //The following is the configuration content
         username="[enter db username]"
         password="[enter db password]"
         driverClassName="com.mysql.jdbc.Driver"
         url="jdbc:mysql://localhost/jiradb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"
         />

References: https://www.cnblogs.com/kaola8023/p/7064978.html

8. mysql 8.5 error reporting

The following errors are reported:

for the right syntax to use near 'identified by 'password' with grant option

Solution:

#Create account
create user 'root'@'localhost' identified by  'password'

#Give permission. with grant option means that the user can authorize his own permission to others
grant all privileges on *.* to 'root'@'172.16.10.203' with grant option

#Change password & authorize the super user. The flush privileges command is essentially used to change the current user and privilege
#The user information / permission settings in the table are extracted from the MySQL database (the built-in database of MySQL database) and stored in memory
flush privileges;

References: https://blog.csdn.net/shenhonglei1234/article/details/84786443

Posted by mybluehair on Tue, 31 May 2022 04:48:19 +0530