首页 > 代码库 > Confluence wiki——CentOS6.8搭建详解

Confluence wiki——CentOS6.8搭建详解

参考资料:http://www.cnblogs.com/jackyyou/p/5534231.html

     http://www.ilanni.com/?p=11989

公司需要搭建WIKI方便员工将一些资料记录下来,开始搭建了一遍,感觉有些乱,所以我就又找了个干净的系统搭了第二次,现在把详细流程写下来。
整个安装过程需要用到的包裹:
jre-8u131-linux-x64.tar.gz              #JAVA
atlassian-confluence-5.4.4-x64.bin          #confluence
mysql-connector-java-5.1.32-bin.jar         #mysql驱动程序
confluence5.1-crack.zip                   #confluence破解包
Confluence-5.4.4-language-pack-zh_CN.jar     #confluence汉化语言包
我把所有包裹打包在一起:ConfluenceInstall.zip
……………………………………………………………………………………………………………

yum -y update #更新所有已有组件
yum -y lrzsz.x86_64 #安装上传下载命令rz、sz
yum -y unzip #安装unzip解压命令

将ConfluenceInstall.zip上传到/tmp下
unzip ConfluenceInstall.zip #解压包裹得到所有安装包,这里confluence5.1-crack.zip破解包放到本机即可,不用上传到服务器上。

[root@yeebian tmp]# ll ConfluenceInstall
total 317164
-rw-r--r--. 1 root root 246958968 Aug 19 2015 atlassian-confluence-5.4.4-x64.bin
-rw-r--r--. 1 root root 289268 Aug 19 2015 Confluence-5.4.4-language-pack-zh_CN.jar
-rw-r--r--. 1 root root 75920010 Apr 19 17:47 jre-8u131-linux-x64.tar.gz
-rw-r--r--. 1 root root 969020 Aug 19 2015 mysql-connector-java-5.1.32-bin.jar

[root@yeebian ConfluenceInstall]# tar -zxvf jre-8u131-linux-x64.tar.gz 
jre1.8.0_131/
jre1.8.0_131/bin/
jre1.8.0_131/bin/rmiregistry
jre1.8.0_131/bin/unpack200
jre1.8.0_131/bin/jcontrol
…… ……
[root@yeebian ConfluenceInstall]# ll
total 317168
-rw-r--r--. 1 root root 246958968 Aug 19 2015 atlassian-confluence-5.4.4-x64.bin
-rw-r--r--. 1 root root 289268 Aug 19 2015 Confluence-5.4.4-language-pack-zh_CN.jar
drwxr-xr-x. 6 uucp 143 4096 Mar 15 16:32 jre1.8.0_131     #java解压文件
-rw-r--r--. 1 root root 75920010 Apr 19 17:47 jre-8u131-linux-x64.tar.gz
-rw-r--r--. 1 root root 969020 Aug 19 2015 mysql-connector-java-5.1.32-bin.jar

  

mkdir /usr/java
mv /tmp/ConfluenceInstall/jre1.8.0_131 /usr/java
配置环境变量
vim /etc/profile
在文件最后加上:
export JAVA_HOME=/usr/java/jre1.8.0_131
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
保存退出,重启服务器生效。

[root@yeebian ~]# java -version #查看java版本信息
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
……………………………………………………………………………………………………………

安装mysql
yum -y install mysql-server mysql mysql-devel #yum安装mysql及其他相关组件
service mysqld start #启动mysql

[root@yeebian ~]# chkconfig --list | grep mysqld      #查看mysql服务是不是开机自动启动
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@yeebian ~]# chkconfig mysqld on      #设置成开机启动
[root@yeebian ~]# chkconfig --list | grep mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@yeebian ~]# mysqladmin -u root password ‘MysQl123!@#‘  #通过该命令给mysql数据库root账号设置密码为 MysQl123!@#

[root@yeebian ~]# mysql -u root -p     #登录mysql数据库,输入以下配置
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, 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> create database confluence character set UTF8;
Query OK, 1 row affected (0.00 sec)

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

mysql> grant all on confluence.* to confluence@"localhost" identified by "confluence";
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> quit #退出
Bye

[root@yeebian ~]# service mysqld stop     #关闭mysql服务

  

vim /etc/my.cnf
在[mysqld]下面加上character-set-server =utf8 #解决中文显示乱码问题
service mysqld start #启动mysql服务
……………………………………………………………………………………………………………

安装confluence
cd /tmp/ConfluenceInstall
chmod u+x atlassian-confluence-5.4.4-x64.bin #添加执行权限

[root@yeebian ConfluenceInstall]# ./atlassian-confluence-5.4.4-x64.bin    #执行安装并根据提示输入,选择默认安装。
Unpacking JRE ...
Starting Installer ...
Apr 20, 2017 6:47:35 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Apr 20, 2017 6:47:35 PM java.util.prefs.FileSystemPreferences$2 run
INFO: Created system preferences directory in java.home.

This will install Confluence 5.4.4 on your computer.
OK [o, Enter], Cancel [c]
o
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]
i
Extracting files ...
Please wait a few moments while Confluence starts up.
Launching Confluence ...
Installation of Confluence 5.4.4 is complete
Your installation of Confluence 5.4.4 is now ready and can be accessed via
your browser.
Confluence 5.4.4 can be accessed at http://localhost:8090
Finishing installation ...

#打开防火墙8090端口

iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 8090 -j ACCEPT
service iptables save #保存防火墙配置
service iptables restart #重启防火墙,打开防火墙8090端口

#confluence日志存放路径
修改/opt/atlassian/confluence/confluence/WEB-INF/classes中的confluence-init.properties配置文件,
将最下面一行改成confluence.home=/var/confluence/data
service confluence restart #重启confluence 服务

……………………………………………………………………………………………………………

破解confluence

页面访问http://192.168.10.162(localhost IP):8090/setup/setuplicense.action
记下Server ID

技术分享

将/opt/atlassian/confluence/confluence/WEB-INF/lib所有以atlassian-extras开头的jar文件删除,
本机解压破解包,然后把里面的Confluence-5.4.4-language-pack-zh_CN.jar、mysql-connector-java-5.1.32-bin.jar
三个jar文件复制到/opt/atlassian/confluence/confluence/WEB-INF/lib目录下.其中:
Confluence-5.4.4-language-pack-zh_CN.jar是confluence中文语言包,
mysql-connector-java-5.1.32-bin.jar是confluence连接mysql数据库相关的jar包。


atlassian所有产品的中文语言包,我们都可以通过以下地址下载到:
https://translations.atlassian.com/dashboard/download?lang=zh_CN#/Confluence/5.6.6
mysql-connector-java-5.1.39-bin.jar文件可以连接mysql5.7及其以下的mysql版本,可以参考如下连接:
http://www.w3resource.com/mysql/mysql-java-connection.php

在windows运行该破解jar包的,如下:java -jar confluence_keygen.jar

弹出窗口,输入name,Server ID,点击.patch!

技术分享

选中破解包中的atlassian-extras-2.4.jar文件,打开。

技术分享

点击.gen!,这时先前访问页面中的License Key就出来了,复制Key关闭窗口。

技术分享

破解之后的atlassian-extras-2.4jar文件会出现一个atlassian-extras-2.4.bak文件,如图:

技术分享

将破解后的atlassian-extras-2.4jar上传到/opt/atlassian/confluence/confluence/WEB-INF/lib目录下

service confluence start  #启动confluence

重新打开网页。将Key输入进去,这里我选择的是默认安装。

这时页面可能会出现报错,如下图:

技术分享

从页面中找到原因:

LockReleaseFailedException: Cannot forcefully unlock a NativeFSLock which is held by another indexer component: /var/atlassian/application-data/confluence/index/write.lock

删除/var/atlassian/application-data/confluence/index/write.lock文件

杀掉confluence进程,重启confluence,刷新页面。

技术分享

 

创建管理员信息:

技术分享

技术分享

技术分享

自此,一个破解版的confluence wiki就搭建完成了,可以邀请公司的小伙伴一起学习分享了。

 

Confluence wiki——CentOS6.8搭建详解