Windows Production Environment:
OS: Windows 2003
Web server: Apache tomcat/6.0.26
Java Virtual (JVM): 1.6.0_10-rc2-b32
Program Language: java+jsp
Linux production environment:
OS: CentOS Release 6.7 (Final)
Web server: Apache tomcat/7.0.57
Java Virtual (JVM): 1.7.0_71-b14
Program Language: java+jsp
Task: Migrate the Performance upload monitor program from the Windows platform to the Linux platform.
The operation is as follows, the specific details omitted:
1. Upload the program on Windows to the Linux server;
2.Linux only as a Web server should, and did not migrate the database to the platform, so to modify the "Jdbcconnection.java" database connection, recompile the packaging release.
There are two issues to be aware of during the entire operation:
1.JDBC Program Compilation Problem:
[Email protected] com]# Javacjdbcconnection.java
Jdbcconnection.java:4: Error: Encoding UTF8 non-mapped characters
Private final stringdbdriver = "Com.microsoft.jdbc.sqlserver.SQLServerDriver";
//SQL jdbcconnection.java:4: Error: Encoding UTF8 non-mapped characters
Private final String dbdriver= "Com.microsoft.jdbc.sqlserver.SQLServerDriver";
//SQL jdbcconnection.java:4: Error: Encoding UTF8 non-mapped characters
Private final stringdbdriver = "Com.microsoft.jdbc.sqlserver.SQLServerDriver";
//SQL jdbcconnection.java:20: Error: Encoding UTF8 non-mapped characters
56 Errors
Workaround 1 failed:
[Email protected] com]# javac-encoding UTF-8 Jdbcconnection.java
Jdbcconnection.java:4: Error: Encoding UTF-8 non-mapped characters
Private final String dbdriver = "Com.microsoft.jdbc.sqlserver.SQLServerDriver"; SQL Jdbcconnection.java:4: Error: Encoding UTF-8 non-mapped characters
private final String dbdriver = "Com.microsoft.jdbc.sqlserver.SQLServerDriver"; SQL Jdbcconnection.java:4: Error: Encoding UTF-8 non-mapped characters
Private final String dbdriver = "Com.microsoft.jdbc.sqlserver.SQLServerDriver"; SQL
Workaround 2 By:
[Email protected] com]# javac-encoding GB2312 Jdbcconnection.java
2. Unzip "Monitoringresults.rar" file
[Email protected]/]# cd/usr/local/tomcat/webapps/
[Email protected] webapps]# RZ #上传压缩文件到服务器
[[email protected] webapps]# rar xmonitoringresults.rar monitoringresults/
#参数x是解压完整路径, the parameter e is to extract all the files to the same directory.
Summary: In the end, the use of UTF-8 characters or GB2312 character encoding method, according to test production environment, it should depend on the operating system used by the character encoding environment, the current Linux system we use the gb2312 character.
Another problem is that Linux makes a Web server connection to the Windows SQL Server database, which needs to pass through a 1433 port, which, in the entire running environment, does not require permission to pass through the firewall, but Linux opens the firewall. The other ports are allowed to run, do not know what the reason for this 1433 port, do not need to do task processing is running through the firewall.
Run:
http://117.40.239.9:8080/MonitoringResults/Monitoring.jsp
This article is from the "Linux~dba~mba~eie" blog, make sure to keep this source http://sky9896.blog.51cto.com/2330653/1732977
Migrating programs from the Windows platform to the Linux platform