CentOS8.4安装Confluence7.13.md

参考资料1:https://blog.whsir.com/post-5854.html
参考资料2:https://confluence.atlassian.com/confkb/confluence-basic-nginx-configurations-for-proxy-load-balancing-logging-1019381716.html
参考资料3:https://confluence.atlassian.com/conf73/running-confluence-behind-nginx-with-ssl-991928804.html

系统环境以及安装准备工作

系统版本 数据库 应用软件 CPU 内存
CentOS 8.4 MySQL 8.0.21 Confluence 7.13.0 16核 16G

Confluence 7.13 官网下载
MySQL驱动连接
破解工具下载
jdk-8u301-windows-x64.exe 这个是运行破解工具

# 内核参数优化 vim /etc/sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
net.ipv4.conf.all.promote_secondaries = 1
net.ipv4.conf.default.promote_secondaries = 1
net.ipv6.neigh.default.gc_thresh3 = 4096
net.ipv4.neigh.default.gc_thresh3 = 4096
kernel.softlockup_panic = 1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
kernel.numa_balancing = 0
kernel.shmmax = 68719476736
kernel.printk = 5
kernel.sysrq = 1

一、MySQL数据库安装以及创建用户和数据库

# yum安装mysql
yum list mysql mysql-server --showduplicates
yum -y install mysql mysql-server
# 使用空密码登录
# vim mysql-default-authentication-plugin.cnf
[mysqld]
#default_authentication_plugin=mysql_native_password
# MySQL必要优化
# vim mysql-server.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysql/mysqld.log
pid-file=/run/mysqld/mysqld.pid

# 指定设置为 utf8mb4 的默认字符
character-set-server=utf8mb4
collation-server=utf8mb4_bin

# 默认存储引擎设置为 InnoDB
default-storage-engine = INNODB
transaction-isolation = READ-COMMITTED

max_allowed_packet = 256M
innodb_log_file_size = 2GB

# 检查二进制记录格式是否被配置为使用"row-based"的二进制记录,以及
# 数据库用户是否可以创建和更改存储的功能
binlog_format = row
log-bin-trust-function-creators = 1
# 创建用户和数据库
mysql> create user confluence@localhost identified by 'confluence';
mysql> create database confluence character set utf8mb4 collate utf8mb4_bin;
mysql> grant all privileges on confluence.* to confluence@'localhost';

二、Nginx安装

# yum源配置
# vim /etc/yum.repos.d/nginx.repo 
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

# 安装
yum -y install nginx

三、Confluence安装

chmod +x atlassian-confluence-7.13.0-x64.bin
./atlassian-confluence-7.13.0-x64.bin

Regenerating the font cache
Fonts and fontconfig have been installed
Unpacking JRE ...
Starting Installer ...

This will install Confluence 7.13.0 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]
1

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]


Extracting files ...


Please wait a few moments while we configure Confluence.

Installation of Confluence 7.13.0 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.13.0 is complete
Your installation of Confluence 7.13.0 is now ready and can be accessed via
your browser.
Confluence 7.13.0 can be accessed at http://localhost:8090
Finishing installation ...

四、MySQL驱动配置

wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.26-1.el8.noarch.rpm
rpm -ivh mysql-connector-java-8.0.26-1.el8.noarch.rpm
cp /usr/share/java/mysql-connector-java.jar /opt/atlassian/confluence/confluence/WEB-INF/lib/

五、破解工具使用

在CentOS服务器上下载/opt/atlassian/confluence/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.4.1.jar文件到本地重命名为atlassian-extras-2.4.jar

通过java运行confluence_keygen.jar(文中最开始的那个破解包,在windows上运行,需要在windows上安装好java)

选择.patch!找到刚才重命名的那个文件打开

打开后在当前目录下可以看到atlassian-extras-2.4.jaratlassian-extras-2.4.bak两个文件,这里atlassian-extras-2.4.jar已经是破解好的了,将atlassian-extras-2.4.jar名字改回atlassian-extras-decoder-v2-3.4.1.jar

然后把atlassian-extras-decoder-v2-3.4.1.jar上传到root目录下,并执行如下命令:

cp atlassian-extras-decoder-v2-3.4.1.jar /opt/atlassian/confluence/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.4.1.jar

重启confluence服务:/etc/init.d/confluence restart

六、Nginx配置

[root@localhost ~]# cat /etc/nginx/nginx.conf
user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;

    keepalive_timeout   65;

    types_hash_max_size 2048;

    gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

[root@localhost ~]# cat /etc/nginx/conf.d/default.conf 
server {
    listen       80;
    server_name  localhost;

    location / {
    proxy_pass http://localhost:8090;
    }

    location ~ .* {
    proxy_pass http://localhost:8090;
    proxy_set_header  Host $http_host;
    proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header  X-Forwarded-Host $host;
        proxy_set_header  X-Forwarded-Server $host;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    client_max_body_size 100m;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

七、Confluence配置

访问web页面:http://ip

选择语言 中文 产品安装 下一步

看到

服务器ID BVM7-8KC9-DGM4-OCW9
Confluence

运行破解工具confluence_keygen.jar输入Name和Server ID后点击.gen!

复制授权码到浏览器中,点击下一步

选择 我自己的数据库 点击下一步

设置您的数据库

数据库类型 MySQL
安装类型 简单
主机名 localhost
端口 3306
数据库名称 confluence
用户名 confluence
密码 confluence

点击 测试连接 点击 下一步
我们只是设置您的数据库。这可能需要一点时间。

你可能感兴趣的:(CentOS8.4安装Confluence7.13.md)