一、资源信息
- 系统:centos7.6
- confluence版本:7.19.16
- jdk版本:jdk1.8
- 数据库:MySQL5.7.43
- 资源:8核 8G 100G
二、安装JDK
#上传jdk包到服务器上
[root@localhost soft]# tar -xf jdk-8u161-linux-x64.tar.gz -C /usr/local/
[root@localhost soft]# cd /usr/local/
[root@localhost local]# mv jdk1.8.0_161/ jdk1.8
#配置环境变量
#在 /etc/profile 最后添加 #jdk1.8后面的内容
[root@localhost ~]# tail -n 5 /etc/profile
#jdk1.8
JAVA_HOME=/usr/local/jdk1.8
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
# 加载
[root@localhost ~]# source /etc/profile
[root@localhost ~]# java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
[root@localhost ~]#
三、安装MySQL数据库
3.1、上传离线安装包并安装
[root@localhost 5.7.43]# ls
mysql-community-client-5.7.43-1.el7.x86_64.rpm
mysql-community-libs-5.7.43-1.el7.x86_64.rpm
mysql-community-common-5.7.43-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.43-1.el7.x86_64.rpm
mysql-community-devel-5.7.43-1.el7.x86_64.rpm
mysql-community-server-5.7.43-1.el7.x86_64.rpm
[root@localhost 5.7.43]# rpm -Uvh --force --nodeps *rpm
warning: mysql-community-client-5.7.43-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature,key ID 3a79bd29: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-common-5.7.43-1.e################################# [ 14%]
2:mysql-community-libs-5.7.43-1.el7################################# [ 29%]
3:mysql-community-client-5.7.43-1.e################################# [ 43%]
4:mysql-community-server-5.7.43-1.e################################# [ 57%]
5:mysql-community-devel-5.7.43-1.el################################# [ 71%]
6:mysql-community-libs-compat-5.7.4################################# [ 86%]
Cleaning up / removing...
7:mariadb-libs-1:5.5.56-2.el7 ################################# [100%]
3.2 启动数据库并修改密码
[root@localhost 5.7.43]# systemctl start mysqld
[root@localhost 5.7.43]# grep "password" /var/log/mysqld.log
2023-11-23T06:01:25.518528Z 1 [Note] A temporary password is generated
for root@localhost: O/LwMhXyj2dJ
[root@localhost 5.7.43]# mysqladmin -uroot -p'O/LwMhXyj2dJ' password 'Thzk211!'
mysqladmin: [Warning] Using a password on the command line interface can be insecure.Warning: Since password will be sent to server in plain text, use ssl connection
to ensure password safety.
四、安装Confluence
4.1 下载confluence
这里下载的是atlassian-confluence-7.19.16.tar.gz
-
官网下载地址:<https://www.atlassian.com/zh/software/confluence/download-archives
>
4.2 部署confluence
4.2.1 创建安装目录
[root@localhost ~]# mkdir -p /data/wiki/confluence
4.2.2 上传安装包并解压
将下载的atlassian-confluence-7.19.16.tar.gz安装包上传到/data/wiki/confluence目录下并解压
[root@localhost ~]# cd /data/wiki/confluence/
[root@localhost confluence]# ls
atlassian-confluence-7.19.16.tar.gz
[root@localhost confluence]# tar -xf atlassian-confluence-7.19.16.tar.gz
[root@localhost confluence]# ls
atlassian-confluence-7.19.16 atlassian-confluence-7.19.16.tar.gz
4.2.3 配置数据目录
编辑confluence-init.properties文件
vi atlassian-confluence-7.19.16/confluence/WEB-INF/classes/confluence-init.properties
在文件末尾添加如下内容
confluence.home=/data/wiki/confluence
[root@localhost confluence]# tail -n 5 atlassian-confluence-7.19.16/confluence/WEB-INF/classes/confluence-init.properties
# specify your directory below (don't forget to remove the '#' in front)
# confluence.home=c:/confluence/data
confluence.home=/data/wiki/confluence
4.2.4 启动confluence
[root@localhost ~]# cd /data/wiki/confluence/atlassian-confluence-7.19.16/bin/
[root@localhost bin]# ./start-confluence.sh
To run Confluence in the foreground, start the server with start-confluence.sh -fg
executing as current user
If you encounter issues starting up Confluence, please see the Installation guide at
<http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide>
Server startup logs are located in /data/wiki/confluence/atlassian-confluence-7.19.16/
logs/catalina.out
---------------------------------------------------------------------------
Using Java: /usr/local/jdk1.8/bin/java
2023-11-23 14:10:16,561 INFO [main] [atlassian.confluence.bootstrap.SynchronyProxyWatchdog] A Context element for ${confluence.context.path}/synchrony-proxy is found in /data/wiki/confluence/atlassian-confluence-7.19.16/conf/server.xml. No further action is required
---------------------------------------------------------------------------
Using CATALINA_BASE: /data/wiki/confluence/atlassian-confluence-7.19.16
Using CATALINA_HOME: /data/wiki/confluence/atlassian-confluence-7.19.16
Using CATALINA_TMPDIR: /data/wiki/confluence/atlassian-confluence-7.19.16/temp
Using JRE_HOME: /usr/local/jdk1.8
Using CLASSPATH: /data/wiki/confluence/atlassian-confluence-7.19.16/bin/bootstrap.jar:/data/wiki/confluence/atlassian-confluence-7.19.16/bin/tomcat-juli.jar
Using CATALINA_OPTS: -Datlassian.plugins.startup.options='' -Dorg.apache.tomcat.websocket.DEFAULT_BUFFER_SIZE=32768 -Dconfluence.context.path= -Djava.locale.providers=JRE,SPI,CLDR -Dsynchrony.enable.xhr.fallback=true -Datlassian.plugins.enable.wait=300 -Djava.awt.headless=true -Xloggc:/data/wiki/confluence/atlassian-confluence-7.19.16/logs/gc-2023-11-23_14-10-16.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M -Xlog:gc+age=debug:file=/data/wiki/confluence/atlassian-confluence-7.19.16/logs/gc-2023-11-23_14-10-16.log::filecount=5,filesize=2M -XX:G1ReservePercent=20 -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDateStamps -XX:+IgnoreUnrecognizedVMOptions -XX:ReservedCodeCacheSize=256m -Xms1024m -Xmx1024m
Using CATALINA_PID: /data/wiki/confluence/atlassian-confluence-7.19.16/work/catalina.pid
Tomcat started.
4.3 安装数据库驱动
我用的是MySQL5.7.43 驱动用的是5.1.49
-
官网下载地址:<https://downloads.mysql.com/archives/c-j/
>
将mysql-connector-java-5.1.49-bin.jar mysql-connector-java-5.1.49.jar驱动上传到
/data/wiki/confluence/atlassian-confluence-7.19.16/confluence/WEB-INF/lib目录下
[root@localhost soft]# ls mysql-connector-java-5.1.49.tar.gz
mysql-connector-java-5.1.49.tar.gz
[root@localhost soft]# tar -xf mysql-connector-java-5.1.49.tar.gz
[root@localhost soft]# cd mysql-connector-java-5.1.49
[root@localhost mysql-connector-java-5.1.49]# ll
total 2452
-rw-r--r--. 1 root root 90757 Apr 20 2020 build.xml
-rw-r--r--. 1 root root 251223 Apr 20 2020 CHANGES
-rw-r--r--. 1 root root 18122 Apr 20 2020 COPYING
-rw-r--r--. 1 root root 1006906 Apr 20 2020 mysql-connector-java-5.1.49-bin.jar
-rw-r--r--. 1 root root 1006904 Apr 20 2020 mysql-connector-java-5.1.49.jar
-rw-r--r--. 1 root root 61407 Apr 20 2020 README
-rw-r--r--. 1 root root 63658 Apr 20 2020 README.txt
drwxr-xr-x. 7 root root 68 Apr 20 2020 src
[root@localhost mysql-connector-java-5.1.49]# cd /data/wiki/confluence/atlassian-confluence-7.19.16/confluence/WEB-INF/lib/
[root@localhost lib]# cp /root/soft/mysql-connector-java-5.1.49/mysql-connector-java-5.1.49.jar .
[root@localhost lib]# cp /root/soft/mysql-connector-java-5.1.49/mysql-connector-java-5.1.49-bin.jar .
4.4 修改MySQL配置文件my.cnf
在[mysqld]下添加如下内容
#confluence
character-set-server=utf8mb4
collation-server=utf8mb4_bin
default-storage-engine=INNODB
max_allowed_packet=256M
innodb_log_file_size=2GB
transaction-isolation=READ-COMMITTED
binlog_format=row
修改完重启数据库
4.5 创建confluence数据库、创建对应账户并授权
[root@localhost ~]# mysql -uroot -p'Thzk211!'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \\g.
Your MySQL connection id is 2
Server version: 5.7.43 MySQL Community Server (GPL)
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.
mysql> create database confluence character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.00 sec)
mysql> create user 'confluenceuser'@'%' identified by 'Pass@word1';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'confluenceuser'@'%' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> \\q
Bye
[root@localhost ~]#
五、配置confluence的web页面
confluence访问地址:[<http://192.168.10.133:8090>](<http://192.168.225.34:8090/>)
“服务器ID” 需要记住,后面获取授权码需要
下载破解jar包
把atlassian-agent.jar包放在/data/wiki/confluence目录下
[root@localhost confluence]# pwd
/data/wiki/confluence
[root@localhost confluence]# ll atlassian-agent.jar
-rw-r--r--. 1 root root 975517 Nov 23 16:46 atlassian-agent.jar
[root@localhost confluence]#
设置JAVA_OPTS环境变量
[root@localhost confluence]# echo 'export JAVA_OPTS="-javaagent:/data/wiki/confluence/atlassian-agent.jar ${JAVA_OPTS}"' >> /etc/profile
[root@localhost confluence]# source /etc/profile
重启Confluence,检查是否有agent参数
[root@localhost confluence]# cd /data/wiki/confluence/atlassian-confluence-7.19.16/bin/
[root@localhost bin]# ./stop-confluence.sh
[root@localhost bin]# ./start-confluence.sh
[root@localhost bin]# ps aux|grep java | grep atlassian-agent.jar
获取授权码
[root@localhost confluence]# java -jar atlassian-agent.jar -p conf -m zzz@bbb.com -o 192.168.10.133:8090 -s BXJK-3JTK-XDU1-SEP1
数据库URL这里可以定义其他参数,如下所示:
jdbc:mysql://192.168.10.133/confluence?useSSL=false&serverTimezone=Asia/Shanghai
=======================后续confluence使用亲自行查询学习=========================