Web Project Publishing Bug Summary

Source: Internet
Author: User
Tags centos server

1, Character set garbled problem:

This is a frequently encountered problem, but always can not solve, make people very headache I recently encountered this problem. First make sure your incoming data is in UTF-8 format, if you write with Jsp+servlert, your servlert is set with the character set that joins the request and response, or you add a character set filter.

Character set settings for requests and responses:

JSP page settings:

Database Character Set settings:

When you set all of the above settings to success, you should basically have no problem. But.... There was always an accident, and I came across this situation.
I am deploying the project on Linux and the database is also installed on Linux. But the Chinese data stored in the database is garbled. After several hours of tossing, finally found out.
The discovery is that the character set is less configured in the project's database configuration file :

The problem with the character set stored in the database in Linux is described above, and there is also a problem with project deployment in Linux.


2, Database problems:
My project is deployed to Linux, and the database is connected to the database in Linux.
The previous project was a connected local database, and the local database was transferred to a. sql file uploaded to Linux, running. sql files, data, and table structures all the time to a database in Linux. Note here that the database connection in the project's database configuration file should be the URL and user of the Linux database.
An error occurred while running the project.
Take a look at the SQL statements in the deployed project:

Query the table in the database and suddenly find that the table does not exist.

However, database tables exist in Linux:

This is very confusing, and later found that all the table names are changed to uppercase. The SQL statements in the previous project are all uppercase, but the SQL statement table names for the databases in Linux are case-sensitive.


table names in SQL statements that are deployed in projects on Linux are case-sensitive.
In this case, either change the SQL statement in the project or change the table name in the database.

Method 2, because the table name of the MySQL database in the Linux environment is case-sensitive by default, and Windows default is case-insensitive, so modify the MySQL configuration file/etc/my.cnf:
Add a line of configuration below [mysqld]

lower_case_table_names=1

A detailed discussion of this issue can be found in the blog post of [@ scattered vanity]. (https://www.cnblogs.com/kevingrace/p/6150748.html)

3. Directory Permissions

The locally written SSM project is published to the remote CentOS server and encounters access issues, primarily the site directory does not give Tomcat permission, through the command:

chown -R tomcat:tomcat /网站根目录/chmod -R 777  /网站根目录/
4, website verification Code display garbled

Encountered with [@ Wind drunk 0017] the same problem: After the service was released, the graphics verification code garbled. (http://blog.csdn.net/zs296332478/article/details/78144460)
The main reason is the font problem, the Windows environment is no problem, the CentOS environment does not install the Times New Romans font, it is amazing! Upload the fonts for Windows to the/usr/share/fonts/directory, and then run:

fc-cache

Reload the font configuration and clear the font cache.
Results are available through

fc-list

View.

5. Tomcat Cache problem

The site was deployed two times on CentOS, and suddenly it was not accessible, and the issue was extremely unusual. After unable to test, the final @ Niang give the answer, need to clear Tomcat cache data, in the Tomcat root directory/work/catalina/localhost/website/, the site directory is deleted, restart Tomcat.

Https://www.cnblogs.com/tjlgdx/p/5913882.html

Web Project Publishing Bug Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.