centos 7.9 build and install confluence-7
1. Install the Java environment
1.1 Unzip the tar package
[root@wiki ~]# tar xf jdk-8u171-linux-x64.tar.gz -C /usr/local/
[root@wiki ~]# mv /usr/local/jdk1.8.0_171 /usr/local/jdk
1.2 Configure java environment variables
# 配置java环境变量
[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
[root@wiki ~]# tail -3 /etc/profile
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
# 使环境变量立刻生效
[root@wiki ~]# source /etc/profile
1.3 Check whether java is installed successfully
#检查java是否安装成功
[root@wiki ~]# java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
2. Install Confluence
Official Link: Confluence Server Download Archive | Atlassian
2.1 Create an installation directory
# 下载Confluence包
[root@wiki ~]# wget https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-7.19.7.tar.gz
# 创建安装目录
[root@wiki ~]# mkdir -p /data/wiki/confluence
# 解压缩
[root@wiki ~]# tar xf atlassian-confluence-7.19.7.tar.gz -C /data/wiki/confluence/
[root@wiki ~]# cd /data/wiki/confluence/
[root@wiki confluence]# ll
总用量 0
drwxr-xr-x 12 1000 1000 314 3月 21 14:02 atlassian-confluence-7.19.7
2.2 Configure data directory
[root@wiki confluence]# vim atlassian-confluence-7.19.7/confluence/WEB-INF/classes/confluence-init.properties
[root@wiki confluence]# tail -1 atlassian-confluence-7.19.7/confluence/WEB-INF/classes/confluence-init.properties
confluence.home=/data/wiki/confluence
2.3 start confluence
# 启动confluence
[root@wiki confluence]# cd atlassian-confluence-7.19.7/bin/
[root@wiki 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.7/logs/catalina.out
---------------------------------------------------------------------------
Using Java: /usr/local/jdk/bin/java
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
---------------------------------------------------------------------------
Using CATALINA_BASE: /data/wiki/confluence/atlassian-confluence-7.19.7
Using CATALINA_HOME: /data/wiki/confluence/atlassian-confluence-7.19.7
Using CATALINA_TMPDIR: /data/wiki/confluence/atlassian-confluence-7.19.7/temp
Using JRE_HOME: /usr/local/jdk
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
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
Using CATALINA_PID: /data/wiki/confluence/atlassian-confluence-7.19.7/work/catalina.pid
Tomcat started.
# 检查端口是否成功启动
[root@wiki bin]# netstat -nltp | grep 8090
tcp6 0 0 :::8090 :::* LISTEN 8783/java
[root@wiki bin]# lsof -i:8090
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 8783 root 56u IPv6 30231 0t0 TCP *:8090 (LISTEN)
3. Install MySQL
Download address: MySQL :: Download MySQL Community Server
3.1 Download the MySQL package
# 卸载系统自带mariadb-libs
[root@wiki ~]# yum -y remove mysql-libs
# 安装依赖包
[root@wiki ~]# yum -y install net-tools libaio
# 下载MySQL包
[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 Unzip and install mysql
# 解压
[root@wiki ~]# tar xf mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
# 批量安装rpm包
[root@wiki ~]# yum -y install *
3.3 Initialize the database
[root@wiki ~]# mysqld --initialize --user=mysql
[root@wiki ~]# mysqld --initialize-insecure --user=mysql
4. Start mysql
# 启动mysql
[root@wiki ~]# systemctl start mysqld
# 查看mysql状态
[root@wiki ~]# systemctl status mysqld | grep active
Active: active (running) since 五 2023-04-07 15:24:36 CST; 19s ago
# 查看mysql端口是否成功启动
[root@wiki ~]# netstat -nltp | grep 3306
tcp6 0 0 :::3306 :::* LISTEN 9127/mysqld
tcp6 0 0 :::33060 :::* LISTEN 9127/mysqld
# 查看mysql版本
[root@wiki ~]# mysql --version
mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)
5. Install the driver
Driver download: Download mysql JAR files with all dependencies
My mysql here is version 8.0.28, so the driver is also selected 8.0.28
5.1 Download driver
After downloading, unzip and move the jar package into /data/wiki/confluence/atlassian-confluence-7.19.7/confluence/WEB-INF/lib
the directory
[root@wiki ~]# mv mysql-connector-java-8.0.28.jar /data/wiki/confluence/atlassian-confluence-7.19.7/confluence/WEB-INF/lib/
5.2 Modify mysql configuration
[root@wiki ~]# vim /etc/my.cnf
[root@wiki ~]# egrep -v "^#|^$" /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
init-connect ='SET NAMES utf8'
bind-address = 127.0.0.1
port = 3306
innodb_file_per_table=1
#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
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set = utf8mb4
5.3 restart mysql
[root@wiki ~]# systemctl restart mysqld
5.4 Change password
# 查看临时密码
[root@wiki ~]# cat /var/log/mysqld.log|grep localhost
2023-04-07T07:58:04.962926Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: )M(M+ClSU7LT
# 修改密码
[root@wiki ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.28
Copyright (c) 2000, 2022, 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> alter user 'root'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.01 sec)
mysql>
5.5 Create confluence database, create corresponding account and authorize
mysql> CREATE DATABASE confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Query OK, 1 row affected (0.00 sec)
mysql> create user 'confluenceuser'@'localhost' IDENTIFIED BY 'xxx';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on confluence.* TO 'confluenceuser'@'localhost' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
6. Configure web
6.1 Open the web page and enter the system installation page.
6.2 Select language: Chinese
6.3 Record server ID
6.4 Download crack program and upload
# 下载破解程序
[root@wiki ~]# wget https://github.com/haxqer/confluence/releases/download/v1.3.3/atlassian-agent.jar
# 把agent加入到Java中
[root@wiki ~]# echo 'export JAVA_OPTS="-javaagent:/root/atlassian-agent.jar ${JAVA_OPTS}"' >> /root/.bashrc
# 需要重启confluence
[root@wiki ~]# cd /data/wiki/confluence/atlassian-confluence-7.19.7/bin/
[root@wiki bin]# ./stop-confluence.sh
[root@wiki bin]# ./start-confluence.sh
#检查是否有agent参数
[root@wiki ~]# ps aux|grep java |grep agent
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:/root/atlassian-agent.jar .....
# 服务器ID
# 执行破解,获得授权码
[root@wiki ~]# java -jar atlassian-agent.jar -p conf -m [email protected] -n zhile -o https://zhile.io -s BY4Q-R4C1-E3PP-7U4C
====================================================
======= Atlassian Crack Agent v1.3.1 =======
======= https://zhile.io =======
======= QQ Group: 30347511 =======
====================================================
Your license code(Don't copy this line!!!):
AAABgA0ODAoPeJxtUd1yojAYvc9TMLOXHZSAgutMZtYGdN0VtbV0dy9D/JSMEJgkauHpi0hvtr3MOZPz932bK2HNKmU5gYX9qedMx9iiuxfLdVwPUQXMiFKGzAC5IbYzsp0ARReWnzuGHFiuAYWguRJVhyQyF4UwsLdywUFqsNLayoyp9HQ4bDKRw0CUaKOOTAp9F/nE8lIeBowbcQFi1BkQLaVp31HMRE6apvmRpumAlwXqPX4ynZGYXul8Pvx1DIu368zNm3113YvH+IQXY5z8TmbZk1nsa+91GOZpRE/8T82r+m/0sKALeSTkbrszTBlQfbMOWt1NXuoK1qwAQjdxHD3T5WyF2kDSgGSSQ/RWCVX3W02+t0Pdtur/LkOyWoa7aG2vsD9xJmPfHWMc+GgH6gKqpR//jZ7s5xHFduRtt3aQjCg6Qf0KSt82wr7jBM7E8/CH5Nd+27PiGdPw/836oT7k3Huz9blIQW0OiW5xYmPUJiRfpOz379p3V3oHIIe4XjAtAhUAg3WSxP8sqjOVUXaNtUw7ttWN4zQCFA4LJWko8V5bM5M9uMFudFYZT3DoX02im
6.5 Generate activation code input and then next step
6.6 Choose your own database
6.7 Enter relevant database information
6.8 Set administrator account information (ywb97!!08)
In this way, you can play happily, please explore other functions by yourself