Centos7 ConfluenceWiki6 部署

  1. 系统环境
#系统版本
cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
#selinux状态
getenforce
Disabled
#防火墙状态
systemctl status firewalld
Active: inactive (dead)
  1. 所需要的安装包和环境
JDK1.8以上
mysql5.7(或MariaDB)
atlassian-confluence-6.3.1-x64.bin 
atlassian-extras-decoder-v2-3.2.jar
atlassian-universal-plugin-manager-plugin-2.22.jar
mysql-connector-java-5.0.8-bin.jar
  1. 安装java环境
#注意:最好安装oracle的java(1.8以上),默认的openjdk是不行的
#下载jdk安装包
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz

具体安装步骤,请参考:配置tomcat

#查看java版本
java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
  1. 安装mysql环境(mysql5.7) mysql安装步骤,请参考:linux7 yum安装Mysql5.7
#数据库操作如下:
##查看当前库
mysql > show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.02 sec)
#配置mysql字符集
##配置文件/etc/my.cnf,在[mysqld]标签下添加:
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
#配置文件/etc/my.cnf.d/client.cnf,在[client]中添加:
default-character-set=utf8
#配置文件/etc/my.cnf.d/mysql-clients.cnf,在[mysql]中添加
default-character-set=utf8
#重启mysql,并登陆mysql查看字符集
##重启mysql
systemcl restart mysqld
##查看字符集
mysql > show variables like "%character%";show variables like "%collation%";
+--------------------------+----------------------------+
| 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/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
+----------------------+-----------------+
| Variable_name        | Value           |
+----------------------+-----------------+
| collation_connection | utf8_unicode_ci |
| collation_database   | utf8_unicode_ci |
| collation_server     | utf8_unicode_ci |
+----------------------+-----------------+
3 rows in set (0.01 sec)
#为Confluence创建对应的数据库、用户名和密码
mysql > create database confluence default character set utf8 collate utf8_bin;
mysql > grant all on confluence.* to 'confluence'@'%' identified by 'DaTaGrand4!';
mysql > flush privileges;
  1. 下载并安装confluence6.3
#下载以下安装包:
atlassian-confluence-6.3.1-x64.bin   
#下载地址:
https://pan.baidu.com/s/1skD5DQt    获取密码:5vmk 
atlassian-extras-decoder-v2-3.2.jar  
#下载地址:
https://pan.baidu.com/s/1eRKDDOA    获取密码:mbjp
atlassian-universal-plugin-manager-plugin-2.22.jar
#下载地址:
https://pan.baidu.com/s/1o7Lfv6M    提取密码:1i3y
#安装上面中的两个包
cd /opt
ls
atlassian-confluence-6.3.1-x64.bin  
atlassian-extras-decoder-v2-3.2.jar
chmod +x atlassian-confluence-6.3.1-x64.bin
./atlassian-confluence-6.3.1-x64.bin
#具体安装过程
##安装界面如下:

##说明: 通过上图可以看出confluence安装到了/opt/atlassian/confluence和/var/atlassian/application-data/confluence目录下,并且confluence默认监听的端口是8090.一路默认安装即可! ##注意: confluence的主要配置文件为/opt/atlassian/confluence/conf/server.xml,和jira类似。此server.xml相当于tomcat中的server.xml配置文件,如果要修改访问端口,可以这里修改。 如果要修改confluence的数据目录,可以在安装的时候,在安装过程中进行更换(默认是/var/atlassian/application-data/confluence)!

##说明:这里我将端口更改为58090
##重启confluence
/etc/init.d/confluence restart
##查看confluence端口是否起来
lsof -i:58090
COMMAND   PID       USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
java    60612 confluence   36u  IPv4 195789026      0t0  TCP *:58090 (LISTEN)

##浏览器访问confluence 输入:http://192.168.246.171:58090 选取产品安装: 获得插件可以不选,直接“下一步”: 获得授权码:

  1. 破解confluence授权码的操作
#复制上述截图中的Server ID(即BBMEC-9EIB-35GW-URME),然后关闭confluence,其实也可以不用复制Server ID
/etc/init.d/confluence stop
lsof -i:58090
#用下载的文件替换atlassian-extras-decoder-v2-3.2.jar文件(该文件下载到/opt下,替换前必须做之前的文件备份,方便回退)
cp /opt/atlassian/confluence/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.2.jar /mnt/
cp /opt/atlassian-extras-decoder-v2-3.2.jar /opt/atlassian/confluence/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.2.jar
#用下载的文件替换confluence自带的atlassian-universal-plugin-manager-plugin-2.22.1.jar(该文件下载到/opt下,替换前必须做之前的文件备份,方便回退)
mv /opt/atlassian/confluence/confluence/WEB-INF/atlassian-bundled-plugins/atlassian-universal-plugin-manager-plugin-2.22.1.jar /mnt/
cp atlassian-universal-plugin-manager-plugin-2.22.jar /opt/atlassian/confluence/confluence/WEB-INF/atlassian-bundled-plugins/
#启动confluence
/etc/init.d/confluence start
lsof -i:58090

#注册confluence的key 浏览器输入:http://192.168.246.171:58090 #下面的操作需要在FQ的前提下进行(我使用的是天眼通的浏览器插件方式进行FQ,http://www.tianyantong.org.cn),使用google邮箱注册 稍微等一会儿,就会自动弹出下面的信息,点击"Yes" 如上,右边可以看到这个confluence的license key(把这些key手动粘贴到上面confluence安装中"授权码"的"服务器ID"下面的空白框里即可) 如下,选择外界数据库 如果出现下面报错(缺少java的mysql驱动):

#解决办法:
下载java的mysql驱动:mysql-connector-java-5.0.8-bin.jar
下载地址:https://pan.baidu.com/s/1c2CQzcO
提取密码:ku8s
cd /opt
cp mysql-connector-java-5.0.8-bin.jar /opt/atlassian/confluence/lib/
/etc/init.d/confluence restart

然后继续访问http://192.168.246.171:58090,配置数据库 #下面在首次连接mysql的时候(使用上面mysql里面授权的信息连接,即用户名:confluence,密码:DaTaGrand4!,可能有点慢,耐心等待~

  1. 查看下是否破解成功
  2. 遇到的问题
#报错信息:
caused by: com.octo.captcha.CaptchaException: word is too tall: try to use less letters, smaller font or bigger background: text bounds。。。。
#解决方法:
yum install -y deja*
重启confluence
#原因
This is caused because of missing fonts, due to which the application cannot perform graphics rendering. Although we support OpenJDK it's likely that this issue was caused because, the package manager used to install Java didn't install "Java fonts".
这是由于缺少字体引起的,因为应用程序无法执行图形渲染。虽然我们支持OpenJDK,但是这个问题很可能是因为用于安装Java的包管理器没有安装“Java字体”。

#其他方法(如上面方法不行,请尝试下面方法)

  1. 取消登入验证码
  2. 参考文档 https://www.cnblogs.com/kevingrace/p/7607442.html https://confluence.atlassian.com/fishkb/captcha-image-not-visible-695107611.html