2019-05-18 CentOS7 安装Confluence知识库(破解版)

装一个知识库进行测试,详细步骤如下:

1、如果CentOS是最小安装,需要先安装图形界面。
可参考2019-05-14 CentOS 7 安装图形界面
2、安装jdk,下载的最近版本是jdk-8u202-linux-x64.tar.gz, 解压到/usr/local下面。 (BTW,本文相关软件可以在网盘下载: https://pan.baidu.com/s/1joJbyQ5-kfvYz-7uBvDPjQ 密码:r0vf)

sudo tar zxvf jdk-8u202-linux-x64.tar.gz -C /usr/local/
sudo ln -s /usr/local/jdk1.8.0_202/ /usr/local/jdk

设置环境变量:

sudo vim /etc/profile
#在后面增加Java目录
JAVA_HOME=/usr/local/jdk
export JRE_HOME=/usr/local/jdk/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

#看下效果
sudo source /etc/profile
[root@localhost axing]# java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)

3、导入confluence安装包

[root@localhost axing]# chmod +x atlassian-confluence-6.3.1-x64.bin
[root@localhost axing]# ll
total 779780
-rwxr-xr-x. 1 root  root  604450053 May 18 19:52 atlassian-confluence-6.3.1-x64.bin
-rw-r--r--. 1 axing axing 194042837 May 18 19:31 jdk-8u202-linux-x64.tar.gz
[root@localhost axing]# ./atlassian-confluence-6.3.1-x64.bin
Unpacking JRE ...
Starting Installer ...
#此部分略过。。。期间有几次选项,可以全部回车
Launching Confluence ...
Installation of Confluence 6.3.1 is complete
Your installation of Confluence 6.3.1 is now ready and can be accessed via
your browser.
Confluence 6.3.1 can be accessed at http://localhost:8090
Finishing installation ...

到主机上进入图形界面 (init 5), 打开firefox, 访问localhost:8090,可以看到下面图形,说明第一步已经完成。

s1.png

4、web界面配置
语言选择中文,语言切换很方便,装完以后随时都能切换。
选择正式安装装,后面我们破解。


s2.png

安装插件:


s3.png

下一步,看到机器码(服务器ID)后先暂停在这一步:
s4.png

5、根据机器码进行破解
5.1 拷贝安装目录下的atlassian-extras-decoder-v2-3.2.jar 文件,改名为atlassian-extras-2.4.jar , 拷贝这个文件到windows主机上。
如果没有装jre的话,还需要安装一下才能执行.jar的文件。

sudo cp /opt/atlassian/confluence/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.2.jar atlassian-extras-2.4.jar

5.2 运行破解程序


p1.png

这里要输入server id,就是刚才记下来的那个,patch!那个地方选择导入atlassian-extras-2.4.jar 文件,然后就可以生成key了。
其他地方保持不变,名字如果是空的随便写。
5.3 把atlassian-extras-2.4.jar 文件拷回服务器,改回原来的名字,覆盖拷贝

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

5.4 重启confluence

[root@localhost axing]# sh /opt/atlassian/confluence/bin/stop-confluence.sh
executing using dedicated user
If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide
/opt/atlassian/confluence/bin/setenv.sh: line 33: cd: /home/axing: Permission denied

Server startup logs are located in /opt/atlassian/confluence/logs/catalina.out
---------------------------------------------------------------------------
Using Java: /opt/atlassian/confluence/jre//bin/java
2019-05-19 00:00:39,423 INFO [main] [atlassian.confluence.bootstrap.SynchronyProxyWatchdog] A Context element for ${confluence.context.path}/synchrony-proxy is found in /opt/atlassian/confluence/conf/server.xml. No further action is required
---------------------------------------------------------------------------
Using CATALINA_BASE:   /opt/atlassian/confluence
Using CATALINA_HOME:   /opt/atlassian/confluence
Using CATALINA_TMPDIR: /opt/atlassian/confluence/temp
Using JRE_HOME:        /opt/atlassian/confluence/jre/
Using CLASSPATH:       /opt/atlassian/confluence/bin/bootstrap.jar:/opt/atlassian/confluence/bin/tomcat-juli.jar
Using CATALINA_PID:    /opt/atlassian/confluence/work/catalina.pid
Tomcat stopped.
[root@localhost axing]# sh /opt/atlassian/confluence/bin/start-confluence.sh

To run Confluence in the foreground, start the server with start-confluence.sh -fg
executing using dedicated user: confluence
If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide
/opt/atlassian/confluence/bin/setenv.sh: line 33: cd: /home/axing: Permission denied

Server startup logs are located in /opt/atlassian/confluence/logs/catalina.out
---------------------------------------------------------------------------
Using Java: /opt/atlassian/confluence/jre//bin/java
2019-05-19 00:00:47,852 INFO [main] [atlassian.confluence.bootstrap.SynchronyProxyWatchdog] A Context element for ${confluence.context.path}/synchrony-proxy is found in /opt/atlassian/confluence/conf/server.xml. No further action is required
---------------------------------------------------------------------------
Using CATALINA_BASE:   /opt/atlassian/confluence
Using CATALINA_HOME:   /opt/atlassian/confluence
Using CATALINA_TMPDIR: /opt/atlassian/confluence/temp
Using JRE_HOME:        /opt/atlassian/confluence/jre/
Using CLASSPATH:       /opt/atlassian/confluence/bin/bootstrap.jar:/opt/atlassian/confluence/bin/tomcat-juli.jar
Using CATALINA_PID:    /opt/atlassian/confluence/work/catalina.pid
Tomcat started.

5.5 在Confluence web界面接着输入授权码,点击下一步,到选择数据库,我们选择使用外部数据库 - mysql,当然,使用内部数据库也行。
这时候提示需要数据库驱动:


s5.png

需要把mysql-connector-java-5.0.8-bin.jar 文件安装到java目录,重启confluence

[root@localhost axing]# cp mysql-connector-java-5.0.8-bin.jar /opt/atlassian/confluence/lib/
[root@localhost axing]# /etc/init.d/confluence restart
executing using dedicated 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 /opt/atlassian/confluence/logs/catalina.out
---------------------------------------------------------------------------
Using Java: /opt/atlassian/confluence/jre//bin/java
2019-05-19 00:26:14,395 INFO [main] [atlassian.confluence.bootstrap.SynchronyProxyWatchdog] A Context element for ${confluence.context.path}/synchrony-proxy is found in /opt/atlassian/confluence/conf/server.xml. No further action is required
---------------------------------------------------------------------------
Using CATALINA_BASE:   /opt/atlassian/confluence
Using CATALINA_HOME:   /opt/atlassian/confluence
Using CATALINA_TMPDIR: /opt/atlassian/confluence/temp
Using JRE_HOME:        /opt/atlassian/confluence/jre/
Using CLASSPATH:       /opt/atlassian/confluence/bin/bootstrap.jar:/opt/atlassian/confluence/bin/tomcat-juli.jar
Using CATALINA_PID:    /opt/atlassian/confluence/work/catalina.pid
Tomcat stopped.

To run Confluence in the foreground, start the server with start-confluence.sh -fg
executing using dedicated user: confluence
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 /opt/atlassian/confluence/logs/catalina.out
---------------------------------------------------------------------------
Using Java: /opt/atlassian/confluence/jre//bin/java
2019-05-19 00:26:16,085 INFO [main] [atlassian.confluence.bootstrap.SynchronyProxyWatchdog] A Context element for ${confluence.context.path}/synchrony-proxy is found in /opt/atlassian/confluence/conf/server.xml. No further action is required
---------------------------------------------------------------------------
Using CATALINA_BASE:   /opt/atlassian/confluence
Using CATALINA_HOME:   /opt/atlassian/confluence
Using CATALINA_TMPDIR: /opt/atlassian/confluence/temp
Using JRE_HOME:        /opt/atlassian/confluence/jre/
Using CLASSPATH:       /opt/atlassian/confluence/bin/bootstrap.jar:/opt/atlassian/confluence/bin/tomcat-juli.jar
Using CATALINA_PID:    /opt/atlassian/confluence/work/catalina.pid
Tomcat started.

6、安装mysql数据库
MySQL 被 Oracle 收购后,CentOS 的镜像仓库中提供的默认的数据库变为了 MariaDB,我们要用mysql首先添加yum源

$wget 'https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm'
$sudo rpm -Uvh mysql57-community-release-el7-11.noarch.rpm
$sudo yum install mysql-community-server
#默认安装5.7版本
#设置开机启动,运行mysql
systemctl enable mysqld
systemctl start mysqld
systemctl status mysqld
[root@localhost axing]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2019-05-19 00:32:55 BST; 12s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 16590 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 16496 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 16592 (mysqld)
    Tasks: 27
   CGroup: /system.slice/mysqld.service
           └─16592 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

May 19 00:32:49 localhost.localdomain systemd[1]: Starting MySQL Server...
May 19 00:32:55 localhost.localdomain systemd[1]: Started MySQL Server.

现在数据库已经在运行了,用下面命令看到初始密码后改成自己的:

[root@localhost axing]# sudo grep 'temporary password' /var/log/mysqld.log
2019-05-18T23:32:51.285571Z 1 [Note] A temporary password is generated for root@localhost: *EionhU6a_T6
[root@localhost axing]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.7.26

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

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 'MyPassword';
Query OK, 0 rows affected (0.01 sec)

mysql>

运行数据库安全设置,删除匿名用户,禁止root远程登录,删除test数据库等:

mysql_secure_installation

设置字符集,修改/etc/my.cnf,在[mysqld]标签下添加

init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake

重启mysql, systemctl restart mysqld,进入mysql看下:

mysql> show variables like "%character%";show variables like "%collation%";
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.01 sec)

+----------------------+-----------------+
| Variable_name        | Value           |
+----------------------+-----------------+
| collation_connection | utf8_unicode_ci |
| collation_database   | utf8_unicode_ci |
| collation_server     | utf8_unicode_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)

mysql>

为confluence创建数据,用户名和密码:

mysql> create database confluence default character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on confluence.* to 'confluence'@'%' identified by 'ComplexPassword';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

7、接着在图形界面配置数据库连接,现在我们有了mysql驱动,用户名和密码,按照提示输入即可,第一次连接数据库稍有点慢。


s6.png

8、最后一步提示安装成功

s7.png

9、其他
进入confluence后,系统可能会提示几个错误,比如InnoDB Log File Size, Max Allowed Packet。修复这两个错误,在/etc/my.cnf文件里mysqld里增加

max_allowed_packet=512M
innodb_log_file_size=2G

然后重启mysql,记得重启之前到/var/lib/mysql目录下面,把当前生成的日志文件删掉 rm ib_logfile* ,否则mysql重启可能失败。
并且,千万不要删除ibdata文件。

confluence 停止,启动,重启的命令:

sh /opt/atlassian/confluence/bin/stop-confluence.sh
sh /opt/atlassian/confluence/bin/start-confluence.sh
 /etc/init.d/confluence restart

防火墙设置:
firewalld 开启,允许tcp 8090端口访问。
需要的话请参考:
2019-03-29 CentOS防火墙firewalld使用
2019-04-20 Ansible CentOS firewalld 剧本
10、现在可以远程访问了,enjoy!

屏幕快照 2019-05-19 01.38.26.png

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,547评论 6 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,399评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,428评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,599评论 1 274
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,612评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,577评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,941评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,603评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,852评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,605评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,693评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,375评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,955评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,936评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,172评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,970评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,414评论 2 342

推荐阅读更多精彩内容