Confluence: DataCenter 7.19.4 LTS
MySQL: mysql-server-8.0
Java: openjdk version 11.0.17
MySQL Java Connector: mysql-connector-java-8.0.30
atlassian-agent: 1.3.3
1. 下载并解压Confluence安装包
wget https://github.com/haxqer/confluence/releases/download/v1.3.3/atlassian-agent.jar #下载破解程序
wget https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-7.19.4.tar.gz #下载confluence安装包
tar -xvf atlassian-confluence-7.19.4.tar.gz #解压
chmod 777 * -R atlassian-confluence-7.19.4 #赋予文件夹权限
2. 安装Java环境和MySQL
apt install default-jre #安装java环境
java -version #检查java版本是否为openjdk version 11.0.17
apt install mysql-server #安装mysql-server
cd /root
wget https://cdn.mysql.com/archives/mysql-connector-java-8.0/mysql-connector-java-8.0.30.tar.gz #下载mysql java connector
tar -xvf mysql-connector-java-8.0.30.tar.gz #解压
cp /root/mysql-connector-java-8.0.30/mysql-connector-java-8.0.30.jar /root/confluence/atlassian-confluence-7.19.4/confluence/WEB-INF/lib #拷贝到confluence目录
chmod 777 * -R mysql-connector-java-8.0.30.jar #赋予权限
3. 修改MySQL配置
在/etc/mysql/my.cnf最后添加
[mysqld]
# Require clients to connect either using SSL
# or through a local socket file
#require_secure_transport = ON
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
log_bin_trust_function_creators = 1
4. 初始化MySQL数据库
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';
#如果不需要远程访问数据库,下面这两行可不用
CREATE USER 'root'@'%' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
systemctl restart mysql #重启MySQL使配置生效
可以参考这篇Ubuntu22.04使用apt安装MySQL8指南 - 学习心得的记录 (ipangbo.cn)
5. 创建一个Confluence数据库,输入mysql -u root -p
CREATE DATABASE confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
GRANT ALL PRIVILEGES ON confluence.* TO 'root'@'localhost' IDENTIFIED BY '<password>';
flush privileges;
exit;
6. 配置home并启动Confluence
修改\confluence\WEB-INF\classes\confluence-init.properties最后一行为:
confluence.home=/root/confluence,注意路径为你的confluence根目录
echo 'export JAVA_OPTS="-javaagent:/root/atlassian-agent.jar ${JAVA_OPTS}"' >> /root/.bashrc #把agent加入到Java中
./atlassian-confluence-7.19.4/bin/start-confluence.sh #启动Confluence
ps aux|grep java #检查是否有agent参数
java -jar atlassian-agent.jar -p conf -m zzz@bbb.com -n zhile -o https://zhile.io -s B6OB-82DT-SX1M-84CH #执行破解,获得授权码
7. 浏览器打开 http://xx.xx.xx.xx:8090
8. 停止Confluence运行
./atlassian-confluence-7.19.4/bin/stop-confluence.sh #停止Confluence