[关闭]
@yangwenbo 2023-08-10T14:27:40.000000Z 字数 8567 阅读 372

centos7系统

centos 7.9搭建安装confluence-7

1、安装Java环境

1.1 解压tar包

  1. [root@wiki ~]# tar xf jdk-8u171-linux-x64.tar.gz -C /usr/local/
  2. [root@wiki ~]# mv /usr/local/jdk1.8.0_171 /usr/local/jdk

1.2 配置java环境变量

  1. # 配置java环境变量
  2. [root@wiki ~]# sed -i.ori '$a export JAVA_HOME=/usr/local/jdk\nexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH\nexport CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar' /etc/profile
  3. [root@wiki ~]# tail -3 /etc/profile
  4. export JAVA_HOME=/usr/local/jdk
  5. export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
  6. export CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
  7. # 使环境变量立刻生效
  8. [root@wiki ~]# source /etc/profile

1.3 检查java是否安装成功

  1. #检查java是否安装成功
  2. [root@wiki ~]# java -version
  3. java version "1.8.0_171"
  4. Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
  5. Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

2、安装Confluence

官方链接:Confluence Server 下载存档 | Atlassian

2.1 创建安装目录

  1. # 下载Confluence包
  2. [root@wiki ~]# wget https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-7.19.7.tar.gz
  3. # 创建安装目录
  4. [root@wiki ~]# mkdir -p /data/wiki/confluence
  5. # 解压缩
  6. [root@wiki ~]# tar xf atlassian-confluence-7.19.7.tar.gz -C /data/wiki/confluence/
  7. [root@wiki ~]# cd /data/wiki/confluence/
  8. [root@wiki confluence]# ll
  9. 总用量 0
  10. drwxr-xr-x 12 1000 1000 314 3 21 14:02 atlassian-confluence-7.19.7

2.2 配置数据目录

  1. [root@wiki confluence]# vim atlassian-confluence-7.19.7/confluence/WEB-INF/classes/confluence-init.properties
  2. [root@wiki confluence]# tail -1 atlassian-confluence-7.19.7/confluence/WEB-INF/classes/confluence-init.properties
  3. confluence.home=/data/wiki/confluence

2.3 启动confluence

  1. # 启动confluence
  2. [root@wiki confluence]# cd atlassian-confluence-7.19.7/bin/
  3. [root@wiki bin]# ./start-confluence.sh
  4. To run Confluence in the foreground, start the server with start-confluence.sh -fg
  5. executing as current user
  6. If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide
  7. Server startup logs are located in /data/wiki/confluence/atlassian-confluence-7.19.7/logs/catalina.out
  8. ---------------------------------------------------------------------------
  9. Using Java: /usr/local/jdk/bin/java
  10. 2023-04-07 15:03:38,779 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.7/conf/server.xml. No further action is required
  11. ---------------------------------------------------------------------------
  12. Using CATALINA_BASE: /data/wiki/confluence/atlassian-confluence-7.19.7
  13. Using CATALINA_HOME: /data/wiki/confluence/atlassian-confluence-7.19.7
  14. Using CATALINA_TMPDIR: /data/wiki/confluence/atlassian-confluence-7.19.7/temp
  15. Using JRE_HOME: /usr/local/jdk
  16. Using CLASSPATH: /data/wiki/confluence/atlassian-confluence-7.19.7/bin/bootstrap.jar:/data/wiki/confluence/atlassian-confluence-7.19.7/bin/tomcat-juli.jar
  17. 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.7/logs/gc-2023-04-07_15-03-38.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M -Xlog:gc+age=debug:file=/data/wiki/confluence/atlassian-confluence-7.19.7/logs/gc-2023-04-07_15-03-38.log::filecount=5,filesize=2M -XX:G1ReservePercent=20 -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDateStamps -XX:+IgnoreUnrecognizedVMOptions -XX:ReservedCodeCacheSize=256m -Xms1024m -Xmx1024m
  18. Using CATALINA_PID: /data/wiki/confluence/atlassian-confluence-7.19.7/work/catalina.pid
  19. Tomcat started.
  1. # 检查端口是否成功启动
  2. [root@wiki bin]# netstat -nltp | grep 8090
  3. tcp6 0 0 :::8090 :::* LISTEN 8783/java
  4. [root@wiki bin]# lsof -i:8090
  5. COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
  6. java 8783 root 56u IPv6 30231 0t0 TCP *:8090 (LISTEN)

3、安装MySQL

下载地址:MySQL :: Download MySQL Community Server

3.1 下载MySQL包

  1. # 卸载系统自带mariadb-libs
  2. [root@wiki ~]# yum -y remove mysql-libs
  3. # 安装依赖包
  4. [root@wiki ~]# yum -y install net-tools libaio
  5. # 下载MySQL包
  6. [root@wiki ~]# wget https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar

3.2 解压、安装mysql

  1. # 解压
  2. [root@wiki ~]# tar xf mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
  3. # 批量安装rpm包
  4. [root@wiki ~]# yum -y install *

3.3 初始化数据库

  1. [root@wiki ~]# mysqld --initialize --user=mysql
  2. [root@wiki ~]# mysqld --initialize-insecure --user=mysql

4、启动mysql

  1. # 启动mysql
  2. [root@wiki ~]# systemctl start mysqld
  3. # 查看mysql状态
  4. [root@wiki ~]# systemctl status mysqld | grep active
  5. Active: active (running) since 2023-04-07 15:24:36 CST; 19s ago
  6. # 查看mysql端口是否成功启动
  7. [root@wiki ~]# netstat -nltp | grep 3306
  8. tcp6 0 0 :::3306 :::* LISTEN 9127/mysqld
  9. tcp6 0 0 :::33060 :::* LISTEN 9127/mysqld
  10. # 查看mysql版本
  11. [root@wiki ~]# mysql --version
  12. mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)

5、安装驱动

驱动下载:Download mysql JAR files with all dependencies

我这里mysql是8.0.28版本,所以驱动也是选的8.0.28

5.1 下载驱动

下载之后解压把jar包移入/data/wiki/confluence/atlassian-confluence-7.19.7/confluence/WEB-INF/lib目录下

  1. [root@wiki ~]# mv mysql-connector-java-8.0.28.jar /data/wiki/confluence/atlassian-confluence-7.19.7/confluence/WEB-INF/lib/

5.2 修改mysql配置

  1. [root@wiki ~]# vim /etc/my.cnf
  2. [root@wiki ~]# egrep -v "^#|^$" /etc/my.cnf
  3. [mysqld]
  4. datadir=/var/lib/mysql
  5. socket=/var/lib/mysql/mysql.sock
  6. log-error=/var/log/mysqld.log
  7. pid-file=/var/run/mysqld/mysqld.pid
  8. init-connect ='SET NAMES utf8'
  9. bind-address = 127.0.0.1
  10. port = 3306
  11. innodb_file_per_table=1
  12. #confluence
  13. character-set-server=utf8mb4
  14. collation-server=utf8mb4_bin
  15. default-storage-engine=INNODB
  16. max_allowed_packet=256M
  17. innodb_log_file_size=2GB
  18. transaction-isolation=READ-COMMITTED
  19. binlog_format=row
  20. [client]
  21. port = 3306
  22. socket = /var/lib/mysql/mysql.sock
  23. default-character-set = utf8mb4

5.3 重启mysql

  1. [root@wiki ~]# systemctl restart mysqld

5.4 修改密码

  1. # 查看临时密码
  2. [root@wiki ~]# cat /var/log/mysqld.log|grep localhost
  3. 2023-04-07T07:58:04.962926Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: )M(M+ClSU7LT
  1. # 修改密码
  2. [root@wiki ~]# mysql -uroot -p
  3. Enter password:
  4. Welcome to the MySQL monitor. Commands end with ; or \g.
  5. Your MySQL connection id is 8
  6. Server version: 8.0.28
  7. Copyright (c) 2000, 2022, Oracle and/or its affiliates.
  8. Oracle is a registered trademark of Oracle Corporation and/or its
  9. affiliates. Other names may be trademarks of their respective
  10. owners.
  11. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  12. mysql> alter user 'root'@'localhost' identified by '123456';
  13. Query OK, 0 rows affected (0.01 sec)
  14. mysql>

5.5 创建confluence数据库、创建对应账户并授权

  1. mysql> CREATE DATABASE confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
  2. Query OK, 1 row affected (0.00 sec)
  3. mysql> create user 'confluenceuser'@'localhost' IDENTIFIED BY 'xxx';
  4. Query OK, 0 rows affected (0.01 sec)
  5. mysql> grant all privileges on confluence.* TO 'confluenceuser'@'localhost' with grant option;
  6. Query OK, 0 rows affected (0.00 sec)
  7. mysql> flush privileges;
  8. Query OK, 0 rows affected (0.00 sec)

6、配置web

6.1 打开web页面 ,进入系统安装页面。

6.2 选择语言:中文

image.png-85kB

6.3 记录服务器ID

image.png-32.7kB

6.4 下载破解程序并上传

  1. # 下载破解程序
  2. [root@wiki ~]# wget https://github.com/haxqer/confluence/releases/download/v1.3.3/atlassian-agent.jar
  3. # 把agent加入到Java中
  4. [root@wiki ~]# mv atlassian-agent.jar /data/wiki/confluence/atlassian-confluence-7.19.7/lib/
  5. [root@wiki ~]# echo 'export JAVA_OPTS="-javaagent:/data/wiki/confluence/atlassian-confluence-7.19.7/lib/atlassian-agent.jar ${JAVA_OPTS}"' >> /root/.bashrc
  6. # 需要重启confluence
  7. [root@wiki ~]# cd /data/wiki/confluence/atlassian-confluence-7.19.7/bin/
  8. [root@wiki bin]# ./stop-confluence.sh
  9. [root@wiki bin]# ./start-confluence.sh
  10. #检查是否有agent参数
  11. [root@wiki ~]# ps aux|grep java |grep agent
  12. root 9957 167 22.4 4385956 866876 pts/2 Sl 16:29 0:10 /usr/local/jdk/bin/java -Djava.util.logging.config.file=/data/wiki/confluence/atlassian-confluence-7.19.7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -javaagent:/data/wiki/confluence/atlassian-confluence-7.19.7/lib/atlassian-agent.jar .....
  1. # 服务器ID
  2. # 执行破解,获得授权码
  3. [root@wiki ~]# java -jar /data/wiki/confluence/atlassian-confluence-7.19.7/lib/atlassian-agent.jar -p conf -m zzz@bbb.com -n zhile -o https://zhile.io -s BY4Q-R4C1-E3PP-7U4C
  4. ====================================================
  5. ======= Atlassian Crack Agent v1.3.1 =======
  6. ======= https://zhile.io =======
  7. ======= QQ Group: 30347511 =======
  8. ====================================================
  9. Your license code(Don't copy this line!!!):
  10. AAABgA0ODAoPeJxtUd1yojAYvc9TMLOXHZSAgutMZtYGdN0VtbV0dy9D/JSMEJgkauHpi0hvtr3MOZPz932bK2HNKmU5gYX9qedMx9iiuxfLdVwPUQXMiFKGzAC5IbYzsp0ARReWnzuGHFiuAYWguRJVhyQyF4UwsLdywUFqsNLayoyp9HQ4bDKRw0CUaKOOTAp9F/nE8lIeBowbcQFi1BkQLaVp31HMRE6apvmRpumAlwXqPX4ynZGYXul8Pvx1DIu368zNm3113YvH+IQXY5z8TmbZk1nsa+91GOZpRE/8T82r+m/0sKALeSTkbrszTBlQfbMOWt1NXuoK1qwAQjdxHD3T5WyF2kDSgGSSQ/RWCVX3W02+t0Pdtur/LkOyWoa7aG2vsD9xJmPfHWMc+GgH6gKqpR//jZ7s5xHFduRtt3aQjCg6Qf0KSt82wr7jBM7E8/CH5Nd+27PiGdPw/836oT7k3Huz9blIQW0OiW5xYmPUJiRfpOz379p3V3oHIIe4XjAtAhUAg3WSxP8sqjOVUXaNtUw7ttWN4zQCFA4LJWko8V5bM5M9uMFudFYZT3DoX02im

6.5 生成激活码输入然后下一步

image.png-77.3kB

6.6 选择自己的数据库

image.png-72.7kB

6.7 输入相关数据库信息

image.png-72.5kB

image.png-89.9kB

6.8 设置管理员账户信息(ywb97!!08)

image.png-84.5kB

image.png-43.8kB

image.png-21.5kB

这样就可以愉悦的玩耍了,其他功能请自行探索
image.png-87.1kB

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注