Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Tomcat project migration, unable to access, report "404" error, reason analysis

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

First, export the project file and MySQL database (project file directly tar& database directly mysqldump generate sql file)

Then, import step, copy the project file to webapps, and give bin related files execution permission;mysql needs to establish the corresponding database name first, and then use&&source **sql (provided that the server has installed tomcat and mysql; it is recommended to be the same as the source server version)

Finally, it is best to rm -rf **/work/Catalina&&bin/catalina.sh start, view progress

Test: Open browser, unable to access, report "404" error, cause analysis:

1. Check whether the database port called by the project, the username and password used for linking, are the same as the server configuration;

2. Check tail -f logs/catalina.out&&tail -f /var/log/mysql/log, comprehensively judge whether the project cannot access mysql database, and check whether/etc/my.cnf is configured correctly;

3. Check whether the tomcat configuration file, conf/server.xml, has established the absolute path of the project directory;

Check whether the system variables are correct.

In addition, when modifying the configuration file to restart tomcat, pay attention to cleaning up the catalina cache!!

The following is a script to restart tomcat (written very simple, but practical, hahaha, I hope everyone comments to correct!!)

vi tomcat-restart.sh

#! bin/sh##stop tomcat PID && start tomcat && restart activemqTEMP=`ps a | grep tomcat`echo $TEMP > tomcatpid PID=`awk 'NR==1 {print $1}' tomcatpid`AA=/usr/local/tomcat/work/CatalinaBB=/usr/local/tomcat/bin/catalina.shkill -9 $PID ; rm -rf $AA ; rm -rf tomcatpid$BB start ; service activemq restart

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report