由于confluence的漏洞CVE-2023-22515的出现,现在需要升级版本
查看漏洞已修复版本:
需要升级到8.5.2
下载软件包:
https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-8.5.2-x64.bin
完成后上传confluence后台服务器
为了安全,可提前备份数据库和confluence的业务、数据目录
[root@localhost ~]# ll
-rw-r--r-- 1 root root 975517 Oct 17 14:14 atlassian-agent.jar
-rw-r--r-- 1 root root 904291499 Oct 17 13:54 atlassian-confluence-8.5.2-x64.bin
-rw-r--r-- 1 root root 5020078 Oct 17 14:13 mysql-connector-java-8.0.28.zip
mysql-connector-java-8.0.28.zip和atlassian-agent.jar是最开始安装8.5.1版本就在用的,先上传,后面需要用
运行atlassian-confluence-8.5.2-x64.bin
[root@localhost ~]# bash atlassian-confluence-8.5.2-x64.bin
Starting Installer ...
This will install Confluence 8.5.2 on your computer.
OK [o, Enter], Cancel [c]
o
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],
Upgrade an existing Confluence installation [3, Enter]
3
Existing installation directory:
[/opt/atlassian/confluence]
The upgrade process will automatically back up your Confluence Installation
Directory. You can also choose to back up your existing Confluence Home
Directory. Both directories are backed up as zip archive files in their
respective parent directory locations.
We strongly recommend choosing this option in the unlikely event that you
experience problems with the upgrade and may require these backups to
restore your existing Confluence installation.
If you have many attachments in your Confluence Home Directory, the zip
archive of this directory may consume a significant amount of disk space.
Back up Confluence home ?
Yes [y, Enter], No [n]
y
Checking for local modifications.
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
List of modifications made within Confluence directories.
The following provides a list of file modifications within the confluence
directory.
Modified files:
confluence/WEB-INF/web.xml
bin/setenv.sh
bin/catalina.sh
Removed files:
(none)
Added files:
confluence/WEB-INF/classes/log4j-diagnostic.properties
confluence/WEB-INF/lib/mysql-connector-java-8.0.28.jar
[Enter]
Checking if your instance of Confluence is running
Back up your external database
We strongly recommend you back up your Confluence database if you have not
already done so.
Please refer to the following URL for back up guidelines:
https://docs.atlassian.com/confluence/docs-85/Production+Backup+Strategy
Check app compatibility
Check that your non-bundled apps are compatible with Confluence 8.5.2.
For more information see our documentation at the following URL:
https://docs.atlassian.com/confluence/docs-85/Installing+and+Configuring+Plugins+using+the+Universal+Plugin+Manager
Please ensure you have read the above checklist before upgrading.
Your existing Confluence installation is about to be upgraded! Do you want to proceed?
Upgrade [u, Enter], Exit [e]
u
Your instance of Confluence is currently being upgraded.
Checking if Confluence has been shutdown...
Backing up the Confluence installation directory
Backing up the Confluence home directory
Deleting the previous Confluence installation directory...
Extracting files ...
Please wait a few moments while we configure Confluence.
Start Confluence now?
Yes [y, Enter], No [n]
n
Custom modifications
Your previous Confluence installation contains customisations that must be
manually transferred. Refer to our documentation more information:
https://docs.atlassian.com/confluence/docs-85/Upgrading+Confluence#UpgradingConfluence-custommodifications
Finishing installation ...
到此升级安装完成
[root@localhost ~]# cd /opt/atlassian
[root@localhost atlassian]# ll
total 1046984
-rw-r--r-- 1 root root 1072098841 Oct 17 14:00 2023_10_17-confluence-8.5.1-back.zip
-rw-r--r-- 1 root root 311 Oct 17 13:59 8.5.1-modifications.txt
drwxr-xr-x 14 root root 4096 Oct 17 14:02 confluence
drwxr-xr-x. 15 root root 4096 Sep 28 18:35 jira
由于安装时也选择了备份,以上.zip文件即为备份了
此时启动confluence服务,访问web是进不去的,会提示license不适合新版本8.5.2,只能找官方求助
解决方法:
将上述之前上传的两个包分别放在指定位置:
[root@localhost ~]# cp mysql-connector-java-8.0.28.zip /opt/atlassian/confluence/confluence/WEB-INF/lib/
[root@localhost ~]# cp atlassian-agent.jar /opt/
之后需重新设置下变量:
[root@localhost ~]# cd /opt/atlassian/confluence/bin
[root@localhost bin]# vim setenv.sh
再最后追加变量:
export JAVA_OPTS="-javaagent:/opt/atlassian-agent.jar ${JAVA_OPTS}"
保存后重启confluence
[root@localhost bin]# systemctl restart confluence
[root@localhost bin]# systemctl status confluence
● confluence1.service - LSB: Atlassian Confluence
Loaded: loaded (/etc/rc.d/init.d/confluence1; bad; vendor preset: disabled)
Active: active (running) since Tue 2023-10-17 14:20:23 CST; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 6061 ExecStop=/etc/rc.d/init.d/confluence1 stop (code=exited, status=0/SUCCESS)
Process: 6399 ExecStart=/etc/rc.d/init.d/confluence1 start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/confluence1.service
└─6477 /opt/atlassian/confluence/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/confluence/conf/logging...
网页访问:
升级成功~!