Configure Wenice Project implementation files

Source: Internet
Author: User
0. Modify the server's host file (/etc/hosts)
192.168.152.146 index.wenice.146.cn
192.168.152.146 user.wenice.146.cn
192.168.152.146 admin.wenice.146.cn
192.168.152.146 security.wenice.146.cn
192.168.152.146 help.wenice.146.cn

192.168.152.146 www.applyms.146.cn
1. Upload the War package
2. Configure Tomcat's Service.xml file
See Service.xml
<connector port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
Maxpostsize= "0"
Acceptcount= "10000"
Uriencoding= "Utf-8"
redirectport= "8443"/>
3. Start Tomcat
4. View error message, configure environment
5. Upload Sunding Index so directory to/mnt/index
6. Replace Tomcat's El Pack
7. Replace configuration information
8. Create DATABASE, import initial data
Mysql-uroot-p
show databases;
Create DATABASE ownersolution CHARACTER SET ' UTF8 ' COLLATE ' utf8_general_ci ';
Use ownersolution;
Source/home/ownersolution.sql;
Create DATABASE quartz CHARACTER SET ' utf8 ' COLLATE ' utf8_general_ci ';
Use quartz;
Source/home/quartz.sql;
Create DATABASE Wenice CHARACTER SET ' UTF8 ' COLLATE ' utf8_general_ci ';
Use Wenice;
Source/home/wenice.sql;
9. Configure Nginx
See nginx.conf

Server time bias
Date Modified:
Date-s 05/10/2009
Modified time:
Date-s 10:18:00
Of course, you can also sync time:
Ntpdate pool.ntp.org

========= Problem Description: Tomcat boot is low on memory ========================================================================
Modify/tomcat/bin/catalina.sh, first line add: The following gives a reference to the parameter settings of the Java JVM in the 1G memory environment:
1.wenice Server:
Java_opts= "-server-xms4096m-xmx4096m-xx:permsize=256m-xx:maxpermsize=256m"
2. Network Answer:
Java_opts= "-server-xms800m-xmx800m-xx:permsize=64m-xx:maxnewsize=256m-xx:maxpermsize=128m-djava.awt.headless= True "


========= problem 0.mysql default case-sensitive ============================================================================
Add Lower_case_table_names=1 after [mysqld],
Restart the MySQL service, when it has been set successfully:
Lower_case_table_names = 0 of which 0: case-sensitive, 1: case-insensitive
========= question 1. When MySQL builds the library, it prompts specified key was too long max key length is 1000 bytes =====================
The index field length is too long,
Method 1. Modify field length
Method 2. Modify the MySQL default storage engine
2.1. Check the current engine
Mysql> show engines;
2.2. Check whether the dynamic loading is supported, it is important to have_dynamic_loading this line, if yes, mysql>show variables like "have_%";
2.3. Install the Plugin
mysql> INSTALL PLUGIN INNODB soname ' ha_innodb.so ';
Mysql> show engines;
========= question 2. Java.sql.SQLException:null, message from server: "Host ' xxx ' isn't allowed to connect=========
Indicates that the object is not a remote object and cannot access the data remotely through the object
Solve:
Programme I: Change table:
Use MySQL, select User,host,password from user;
Update user Set host = '% ' where user= ' root ';
Programme II: Delegation of Authority Law:
For example, you want to myuser use MyPassword to connect to a MySQL server from any host.
Grant all privileges in *.* to ' myuser ' @ '% ' identified by ' MyPassword ' with GRANT OPTION;
If you want to allow user root to connect to the MySQL server from IP for 192.168.152.146 host, and use 123456 as the password
Grant all privileges in *.* to ' root ' @ ' 192.168.152.146 ' identified by ' 123456 ' with GRANT OPTION;

========= question 3. When viewing Chinese information as garbled ==============================================================================
MySQL's default encoding is Latin1, does not support Chinese, to support the noon need to change the database's default encoding to GBK or UTF8.
1, need to log in as root user can view the database encoding (as root user login command: >mysql-u root–p, after two times the root password), view the encoding of the database command is:
>show variables like ' character% ';
+--------------------------+----------------------------+
| variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | Latin1 |
| character_set_connection | Latin1 |
| Character_set_database | Latin1 |
| Character_set_filesystem | binary |
| Character_set_results | Latin1 |
| Character_set_server | Latin1 |
| Character_set_system | UTF8 |
| Character_sets_dir | /usr/share/mysql/charsets/|
+--------------------------+----------------------------+
From the above information, we know that the encoding of the database is latin1, which needs to be modified as GBK or UTF8;
Among them, the character_set_client is the client encoding method, the encoding used for establishing the connection character_set_connection, and the Character_set_database database coding;
Character_set_results the result set encoding;
Character_set_server the database server code;
As long as the above four to ensure that the same encoding, there will be no garbled problem.
Another command to view the database encoding:
>show variables like ' collation% ';

2, the Linux system, modify the MySQL database default encoding steps are:
U stop MySQL Running
/etc/init.d/mysql Start (stop) starts and stops the server
Ümysql main configuration file is my.cnf, General directory is/etc/mysql
Var/lib/mysql/is placed in the database table folder, where MySQL corresponds to the date folder under Windows MySQL

*************************************************************************************************************** *******
When we need to modify the MySQL database default encoding, we need to edit the my.cnf file for coding changes, under Linux to modify the MySQL configuration file my.cnf, file location default/etc/my.cnf file

Locate the client configuration [clients] add below
Default-character-set=utf8 default character set is UTF8
After finding [mysqld] Add
Default-character-set=utf8 default character set is UTF8
init_connect= ' Set NAMES UTF8 ' (set to connect to MySQL database with UTF8 encoding to make MySQL database run UTF8)
*************************************************************************************************************** *******

After you have modified it, restart MySQL, and requery the database code to discover how the encoding changes:
>show variables like ' character% ';
+--------------------------+----------------------------+
| variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | UTF8 |
| character_set_connection | UTF8 |
| Character_set_database | UTF8 |
| Character_set_filesystem | binary |
| Character_set_results | UTF8 |
| Character_set_server | UTF8 |
| Character_set_system | UTF8 |
| Character_sets_dir | /usr/share/mysql/charsets/|
+--------------------------+----------------------------+
This method is also valid for standard MySQL versions, and for/etc/my.cnf files, you need to my-large.cnf from Mysql/support-files's folder CP to/ETC/MY.CNF

3, Windows system can delete MySQL database, and reinstall, in the installation process can be directly with the MySQL Server Instance Config Wizard to set

4, when the MySQL database server already has data is not suitable for the removal of the reload, you can specify the database encoding method. MySQL Specifies that the encoding is flexible and versatile, specifying table-level encodings, line-level encodings, and even field-level encodings.
The following example shows two ways to specify encoding when creating a database:
1 CREATE DATABASE ms_db CHARACTER SET UTF8 COLLATE utf8_general_ci;
2 CREATE database if not EXISTS netctoss default character set UTF8;
5, if you are using the external access mode, you can determine the request in the connection of the encoding format such as: jdbc:mysql://localhost:3306/mysql?useunicode=true&characterencoding= Utf-8 (Note: Do not appear any spaces, otherwise error)
6. Execute script: Specify encoding format set names GBK (note, not UTF-8) can modify
Before execution:
After execution:
It is known from the execution of the command that the set names GBK can only modify the encoding of Character_set_client, Character_set_connection, and Character_set_results. And this modification is the window level, only valid for this window, open another window to modify the invalid. It is also found that the underlying encoding of the database has not changed, and the data is persisted after inserting it in UTF8 encoding.


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.