部署CFCA_RA本地测试环境
创建数据库
在创建数据库的过程中遇到了问题,本来建库应该⽤utf8字符集创建,系统默认字符集是 latin1格式的,所以就算⽤phpmyadmin创建库的时候还是会有问题。解决⽅法参考了⽹络上的⼀篇帖⼦:
登录查看⽤ VARIABLES LIKE ‘character%’;下字符集,显⽰如下:
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client |  |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
character_set_database和character_set_server的默认字符集还是latin1。
mysql的⽂件中的字符集键值
1、在[client]字段⾥加⼊default-character-set=utf8,如下:
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=utf8
2、在[mysqld]字段⾥加⼊character-set-=utf8,如下:
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
character-set-server=utf8
3、在[mysql]字段⾥加⼊default-character-set=utf8,如下:
[mysql]
no-auto-rehash
default-character-set=utf8
修改完成后,service mysql restart重启mysql服务就⽣效。注意:[mysqld]字段与[mysql]字段是有区别的。这点在⽹上没⼈反馈过。
使⽤SHOWVARIABLES LIKE ‘character%’;查看,发现数据库编码全已改成utf8。
+--------------------------+----------------------------+
| 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/ |
+--------------------------+----------------------------+
4、如果上⾯的都修改了还乱码,那剩下问题就⼀定在connection连接层上。解决⽅法是在发送查询前执⾏⼀下下⾯这句(直接写在SQL⽂件的最前⾯):
SET NAMES ‘utf8′;
它相当于下⾯的三句指令:
SET character_set_client = utf8;
SET character_set_results = utf8;
SET character_set_connection = utf8;
数据导⼊
这样就解决了建库字符集的问题,对⽅给的是写好的sql⽂件,导⼊sql⽂件的语法是在mysql中执⾏ source /path/*.sql ⽂件进⾏执⾏操作。
部署tomcat
部署tomcat和常规的⽅式基本⼀样,不同的就是由于⽤到的证书,访问的协议不是通过http⽽是通过https的⽅式访问。
安装好tomcat后mysql需要安装documentation
cd /usr/local/apache-tomcat-8.0.22/conf
l
到如下代码
<!-- Define a SSL/TLS HTTP/1.1Connector on port 8443
This connector uses the NIO implementation that requires the JSSE
style configuration. When using the APR/native implementation, the
OpenSSL style configuration is required as described in the APR/native
documentation -->
<!--
<Connector port="8443"protocol="http11.Http11NioProtocol"
maxThreads="150"SSLEnabled="true" scheme="https" secure="true"
clientAuth="false"sslProtocol="TLS" />
在本段代码的后⾯添加如下代码
<Connector port="8443"protocol="HTTP/1.1" SSLEnabled="true"  maxThreads="150" scheme="https"secure="true"
clientAuth="true" sslProtocol="TLS"
keystoreFile="./oca1web.jks" keystorePass="111111"
truststoreFile="./trust.jks"truststorePass="Abcd1234" />
说明:这⾥的oca1web.jks,trust.jks⽂件应该是CFCA那边制作的⽂件,密码也是他们设置的,这⾥是配置双向的ssl。
然后war包放webapp下,raconfig放bin下,raconfig中的sys.ini⽂件中有mysql对应库的⽤户名和密码,把⽤户名密码修改好后,启动tomcat.
测试效果
总是显⽰⽹络错误(在登录前需要输⼊pin码,这个⼈pin码应该和tomcat中l配置的是⼀致的)。经过对⽅⼯程师检查发现是我IE浏览器的问题,对⽅给了⼀个⼯具,通过⼯具导⼊管理员证书后,就能正常访问系统,经过测试发证成功。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。