在第一次安装数据库后,每一次编译openfire后,数据库配置都会丢失,这样就会需要重新安装。所以只要把第一次向导配置好的openfire.xml保存下来覆盖掉原始的openfire就好了。
先来看一下通过第一次向导配好的的openfire.xml 内容。
(1)<setup>true</setup> ture表示已经安装,不用运行安装向导。
(2)false表示要重新安装。
将此文件覆盖到原代码中的:openfire\src\conf\openfire.xml,这样每次重新打包后,该配置都还在。
先来看一下通过第一次向导配好的的openfire.xml 内容。
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file stores bootstrap properties needed by Openfire.
Property names must be in the format: "prop.name.is.blah=value"
That will be stored as:
<prop>
<name>
<is>
<blah>value</blah>
</is>
</name>
</prop>
Most properties are stored in the Openfire database. A
property viewer and editor is included in the admin console.
-->
<!-- root element, all properties must be under this element -->
<jive>
<adminConsole>
<!-- Disable either port by setting the value to -1 -->
<port>9090</port>
<securePort>9091</securePort>
</adminConsole>
<locale>zh_CN</locale>
<!-- Network settings. By default, Openfire will bind to all network interfaces.
Alternatively, you can specify a specific network interfaces that the server
will listen on. For example, 127.0.0.1. This setting is generally only useful
on multi-homed servers. -->
<!--
<network>
<interface></interface>
</network>
-->
<connectionProvider>
<className>org.jivesoftware.database.DefaultConnectionProvider</className>
</connectionProvider>
<database>
<defaultProvider>
<driver>com.mysql.jdbc.Driver</driver>
<serverURL>jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true</serverURL>
<username>root</username>
<password>mysql</password>
<testSQL>select 1</testSQL>
<testBeforeUse>false</testBeforeUse>
<testAfterUse>false</testAfterUse>
<minConnections>5</minConnections>
<maxConnections>25</maxConnections>
<connectionTimeout>1.0</connectionTimeout>
</defaultProvider>
</database>
<setup>true</setup>
</jive>
(1)<setup>true</setup> ture表示已经安装,不用运行安装向导。
(2)false表示要重新安装。
将此文件覆盖到原代码中的:openfire\src\conf\openfire.xml,这样每次重新打包后,该配置都还在。