Centos7安装Confuence 7.X
  • 分类:也不知道是什么
  • 发表:2021-01-14
  • 围观(26)
  • 评论(0)

一、概述

坐标深圳,租住的房子里有个all in one的机器,上面跑着exsi虚拟出来的Openwrt+网心云*2+黑群晖。目前机器还有一定的内存、频率空闲,在闲着也闲着的前提下,打算装一个confuence来做个人笔记、wiki使用。反正从电信白嫖了一个公网IP,加了ddns之后,不管人在哪都很方便使用。

二、准备工作

1.安装包:

选定要安装的版本,目前官网最细的版本是7.4.6,选择linux 64 版本进行下载。

2.jdk

先查找本机所安装的openjdk

# rpm -qa|grep openjdk

java-1.7.0-openjdk-1.7.0.261-2.6.22.2.el7_8.x86_64
java-1.8.0-openjdk-headless-1.8.0.275.b01-0.el7_9.x86_64
java-1.7.0-openjdk-headless-1.7.0.261-2.6.22.2.el7_8.x86_64
java-1.8.0-openjdk-1.8.0.275.b01-0.el7_9.x86_64

#删除上面的jdk

# rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.65-3.b17.el7.x86_64
# rpm -e --nodeps java-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64
# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.91-2.6.2.3.el7.x86_64
# rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.91-2.6.2.3.el7.x86_64

官网下载jdk,选择"jdk-8u271-linux-x64.rpm",下载时需要有oracle账号;

下载好了之后,使用命令rpm -ivh jdk-8u271-linux-x64.rpm进行安装;

[root@localhost ~]# rpm -ivh jdk-8u271-linux-x64.rpm
警告:jdk-8u271-linux-x64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID ec551f03: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:jdk1.8-2000:1.8.0_271-fcs        ################################# [100%]
Unpacking JAR files...
	tools.jar...
	plugin.jar...
	javaws.jar...
	deploy.jar...
	rt.jar...
	jsse.jar...
	charsets.jar...
	localedata.jar...

使用java -version进行版本查看

[root@localhost ~]# java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)

3.mysql

安装之前先卸载系统自带的MariaDB

# rpm -qa | grep mariadb
mariadb-libs-5.5.68-1.el7.x86_64
#rpm -e mariadb-libs-5.5.68-1.el7.x86_64 --nodeps

配置mysql源

# rpm -ivh https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

安装

# yum install -y mysql-community-server

启动服务并设置开机启动

# systemctl enable mysqld && systemctl start mysqld

查看mysql的默认密码

# grep 'root@localhost' /var/log/mysqld.log

mysql默认密码规则很复杂,修改密码规则

# mysql -uroot -p 'password
# mysql> set global validate_password_policy=0;

修改默认密码

# ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

根据官方文档配置mysql

# nano /etc/my.cnf #将下面参数放到配置文件最底部

[mysqld]
...
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

重启服务

systemctl restart mysqld

##非必选:创建数据库及和用户

# mysql> CREATE DATABASE confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
# mysql> GRANT ALL PRIVILEGES ON confluence.* TO 'confluence'@'localhost' IDENTIFIED BY 'confluence@password';

三、安装

1. 修改安装包执行权限

# chmod +x atlassian-confluence-7.4.x-x64.bin

2.执行安装,安装时会提示选择,全部默认即可

./atlassian-confluence-7.4.X-x64.bin
Unpacking JRE ...
Starting Installer ...

This will install Confluence 7.4.1 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, Enter],
Upgrade an existing Confluence installation [3]
1
The following default options cannot be used. You will be asked to provide alternatives for these options.
* Home Directory (Existing home directory)


Default location for Confluence data
[/var/atlassian/application-data/confluence]


See where Confluence will be installed and the settings that will be used.
Installation Directory: /opt/atlassian/confluence
Home Directory: /var/atlassian/application-data/confluence
HTTP Port: 8090
RMI Port: 8000
Install as service: Yes
Install [i, Enter], Exit [e]
i

Extracting files ...


Please wait a few moments while we configure Confluence.

Installation of Confluence 7.4.1 is complete
Start Confluence now?
Yes [y, Enter], No [n]
y

Please wait a few moments while Confluence starts up.
Launching Confluence ...

Installation of Confluence 7.4.1 is complete
Your installation of Confluence 7.4.1 is now ready and can be accessed via
your browser.
Confluence 7.4.1 can be accessed at http://localhost:8090
Finishing installation ...

四、破解

1.破解包下载

下载

2.将解压的破解包复制到目录下

# cp atlassian-agent-v1.2.3/atlassian-agent.jar /opt/atlassian/

3. 设置JAVA_OPTS,启用java代理

# /etc/profile         #在文件末尾追加一行
export JAVA_OPTS="-javaagent:/opt/atlassian/atlassian-agent.jar ${JAVA_OPTS}"

4. 使环境变量生效

# source /etc/profile

5. 重启confluence服务

# /etc/init.d/confluence restart

6. 验证破解文件是否正常

# ps -ef |grep java|grep agent

7.浏览器访问 IP:8090 进行网页端设置

image-20200629222355738
image-20200629222523756
image-20200629222650041

8.根据服务器ID生成授权码

# java -jar /opt/atlassian/atlassian-agent.jar -p conf -m ’邮箱地址‘ -n xnile -o xnile -s '服务器ID'

9.根据生成的授权码进行安装

image-20200629223138543

10.设置数据库

image-20200629223240203
image-20200629223310610

根据提示下载mysql驱动,并将驱动移动至程序目录,页面不要关闭

# cp mysql-connector-java-5.1.49/mysql-connector-java-5.1.49.jar  /opt/atlassian/confluence/confluence/WEB-INF/lib

重启服务进行验证

# /etc/init.d/confluence restart

刷新设置数据库页面,根据之前设置的mysql进行配置

image-20200629225726907
image-20200629225946161
image-20200629230135625

启动服务

直接命令行

JAVA_OPTS="-javaagent:/path/to/atlassian-agent.jar" /path/to/start-confluence.sh

参考:https://blog.dianduidian.com/post/confluence%E5%AE%89%E8%A3%85/

https://gitee.com/pengzhile/atlassian-agent

共有 0 条评论

Top