- 當前環境
0 14:10:00 root@confluence,172.16.2.2:~ # cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
0 14:10:06 root@confluence,172.16.2.2:~ # java -version
java version "1.8.0_201"
- 下載confluence安裝包。
0 14:10:13 root@confluence,172.16.2.2:~ # cd /usr/local/src/
0 14:10:20 root@confluence,172.16.2.2:/usr/local/src # wget https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-7.4.7-x64.bin
0 14:44:12 root@confluence,172.16.2.2:/usr/local/src # chmod u+x atlassian-confluence-7.4.7-x64.bin
- 將confluence安裝在數據盤。
0 14:45:07 root@confluence,172.16.2.2:/usr/local/src # ./atlassian-confluence-7.4.7-x64.bin
......
Unpacking JRE ...
Starting Installer ...
This will install Confluence 7.4.7 on your computer.
OK [o, Enter], Cancel [c] # 直接回車
Click Next to continue, or Cancel to exit Setup.
Choose the appropriate installation or upgrade option.
Please choose one of the following:
Express Install (uses default settings) [1],
Custom Install (recommended for advanced users) [2, Enter],
Upgrade an existing Confluence installation [3]
2 # 自定義安裝
Select the folder where you would like Confluence 7.4.7 to be installed,
then click Next.
Where should Confluence 7.4.7 be installed?
[/opt/atlassian/confluence]
/server/app/atlassian/confluence # 指定安裝目錄
Default location for Confluence data
[/var/atlassian/application-data/confluence]
/server/app/atlassian/application-data/confluence # 指定數據目錄
Configure which ports Confluence will use.
Confluence requires two TCP ports that are not being used by any other
applications on this machine. The HTTP port is where you will access
Confluence through your browser. The Control port is used to Startup and
Shutdown Confluence.
Use default ports (HTTP: 8090, Control: 8000) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2] # 直接回車,使用默認端口
Confluence can be run in the background.
You may choose to run Confluence as a service, which means it will start
automatically whenever the computer restarts.
Install Confluence as Service?
Yes [y, Enter], No [n] # 直接回車
Extracting files ...
Please wait a few moments while we configure Confluence.
Installation of Confluence 7.4.7 is complete
Start Confluence now?
Yes [y, Enter], No [n] # 直接回車
Please wait a few moments while Confluence starts up.
Launching Confluence ...
Installation of Confluence 7.4.7 is complete
Your installation of Confluence 7.4.7 is now ready and can be accessed via
your browser.
Confluence 7.4.7 can be accessed at http://localhost:8090
Finishing installation ...
- 接下來就是web端的相關配置,瀏覽器打開http://x.x.x.x:8090



- 復制上面的服務器ID,並保存好。下載/server/app/atlassian/confluence/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.4.1.jar至本地,並修改文件名為atlassian-extras-2.4.jar。
0 14:55:50 root@confluence,172.16.2.2:~ # cd /server/app/atlassian/confluence/confluence/WEB-INF/lib
0 15:15:42 root@confluence,172.16.2.2:/server/app/atlassian/confluence/confluence/WEB-INF/lib # mv atlassian-extras-decoder-v2-3.4.1.jar{,.bak} # 下載完再mv
- 在Windows中運行破解工具confluence_keygen.jar(提取碼:3a37。運行此包需要windows主機安裝java環境),填入上面的的服務器ID,然后點.patch加載atlassian-extras-2.4.jar包進行修補。


- 將修補完成的atlassian-extras-2.4.jar上傳至服務器/server/app/atlassian/confluence/confluence/WEB-INF/lib目錄下,在還原之前的文件名,此時不要關閉注冊機。
0 15:23:39 root@confluence,172.16.2.2:/server/app/atlassian/confluence/confluence/WEB-INF/lib # mv atlassian-extras-2.4.jar atlassian-extras-decoder-v2-3.4.1.jar
- 此例中使用mysql依賴,所以需要下載mysql驅動,並上傳至/server/app/atlassian/confluence/confluence/WEB-INF/lib下,這里使用的驅動版本是mysql-connector-java-8.0.22.jar,重啟confluence。
0 15:25:15 root@confluence,172.16.2.2:/server/app/atlassian/confluence/confluence/WEB-INF/lib # ll mysql-connector-java-8.0.22.jar
-rw-r--r-- 1 root root 2389216 3月 4 13:20 mysql-connector-java-8.0.22.jar
0 15:25:31 root@confluence,172.16.2.2:/server/app/atlassian/confluence/confluence/WEB-INF/lib # /etc/init.d/confluence restart
- 瀏覽器打開http://x.x.x.x:8090,回到填寫授權碼的界面,然后點擊注冊機的.gen生成key信息,將key信息復制到confluence安裝界面的授權碼欄,繼續安裝。



- 部署mysql,我這里安裝的是5.7.32,不過其實步驟都一樣,此例my.cnf配置如下:
[client]
port=3306
socket=/usr/local/mysql/mysql.sock
[mysql]
prompt="\\u@\\h \\R:\\m:\\s [\\d]> "
[mysqld]
user=mysql
port=3306
basedir=/usr/local/mysql
datadir=/server/data/mysql
socket=/usr/local/mysql/mysql.sock
pid-file=/usr/local/mysql/mysqld.pid
log-error=/server/logs/mysql/error.log
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_timestamps = SYSTEM
default_time_zone = "+8:00"
- 登入mysql,創建confluence數據庫、創建對應賬戶並授權。
0 16:26:47 root@confluence,172.16.2.2:/usr/local/mysql/support-files # cd
0 16:26:48 root@confluence,172.16.2.2:~ # mysql -uroot -p
root@localhost 16:27:10 [(none)]> create database confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Query OK, 1 row affected (0.00 sec)
root@localhost 16:29:07 [(none)]> grant all on confluence.* to 'confluence'@'localhost' identified by 'ashdasdasd';
Query OK, 0 rows affected, 1 warning (0.00 sec)
root@localhost 16:30:11 [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
root@localhost 16:30:20 [(none)]> \q
- 繼續配置





- 查看激活信息,位置在右上角:設置->一般設置->授權細節。

- 可選配置:安裝Markdown插件。位置在右上角:設置->一般設置->查找新應用。

寫作不易,轉載請注明出處,謝謝~~