利用confluence搭建wiki
參考:https://www.cnblogs.com/wishwzp/p/7113403.html
https://blog.51cto.com/caiyuanji/2115500
官方文檔:
https://confluence.atlassian.com/doc/confluence-administrator-s-guide-138143.html
1、部署mysql:下載5.7的包:
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
安裝mysql源
yum -y localinstall mysql57-community-release-el7-11.noarch.rpm 
在線安裝Mysql
yum -y install mysql-community-server
下載的東西比較多 要稍微等會;
啟動Mysql服務
systemctl start mysqld
設置開機啟動
[root@localhost ~]# systemctl enable mysqld
[root@localhost ~]# systemctl daemon-reload
初次安裝并登陸mysql如果提示需要密碼,而我們又沒有密碼的話,我們可以通過臨時密碼登錄,臨時密碼的獲取方法如下
grep "temporary password" /var/log/mysqld.log
然后將獲取到的密碼輸入即可
如果忘記了密碼,可以通過在mysql配置文件/etc/my.cnf里的mysqld模塊下添加skip-grant-tables,這樣就可以免密登錄mysql了,然后重啟mysql服務
service mysqld restart
登陸進去以后,將root密碼更換,使用如下mysql命令
報錯的原因是因為5.7版本下的mysql數據庫下已經沒有password這個字段了,password字段改成了authentication_string
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update mysql.user set authentication_string=password('123') where user='root';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
就可以更換mysql的root密碼了。
更換完以后出于安全考慮,需要將之前的skip-grant-tables免密登錄設置刪除,然后重啟mysql服務。
推薦:接下來就可以通過mysql的root用戶和新密碼登錄了
另一種修改密碼的方式:grep "temporary password" /var/log/mysqld.log
mysql> alter user 'root'@'localhost' identified by 'yanxueli';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
默認是1,即MEDIUM,所以剛開始設置的密碼必須符合長度,且必須含有數字,小寫或大寫字母,特殊字符。
有時候,只是為了自己測試,不想密碼設置得那么復雜,譬如說,我只想設置root的密碼為123456。
必須修改兩個全局參數:
mysql> set global validate_password_length=1;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
nt.mysql> alter user 'root'@'localhost' identified by 'yanxueli';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
重啟mysql并登陸創建confluence所需的賬戶密碼和數據庫
[root@docker ~]# mysql -uroot -p
mysql> create database confluence character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on confluence.* to 'confluence'@'192.168.%' identified by '*****';
Query OK, 0 rows affected, 1 warning (0.01 sec)
必須使用READ-COMMITTED作為默認隔離級別,隔離級別說明可參考:
https://blog.csdn.net/baidu_37107022/article/details/77481670
mysql> SET GLOBAL tx_isolation='READ-COMMITTED';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
修改數據庫的配置:
1.指定允許傳輸的最大數據包的值
默認是在[mysqldump]下 16M
max_allowed_packet = 32M
2.指定默認字符集為UTF-8、修改默認存儲引擎為innodb
[mysqld]
#confluence character-set
character-set-server=utf8
collation-server=utf8_bin
#confluence storage engine 
default-storage-engine=INNODB
在頁面設置里>一般設置>保證所有字符編碼設置為UTF-8.
confluence6.9的數據庫設置:
max_allowed_packet = 34M
innodb_log_file_size=256M
1.0部署mysql5.5
mysql 5.6安裝參考:https://www.jianshu.com/p/9da4ba898719
檢查本地是否安裝過其他版本的mysql
rpm -qa|grep -i mysql
下載服務器包:wget https://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.59-1.el7.x86_64.rpm
下載客戶端包:wget https://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.59-1.el7.x86_64.rpm
安裝 rpm -ivh --nodeps MySQL-server-5.5.59-1.el7.x86_64.rpm
rpm -ivh --nodeps MySQL-client-5.5.59-1.el7.x86_64.rpm
查看安裝的mysql是否已安裝成功 :rpm -qa|grep -i mysql
啟動mysql:service mysql start
設置開機自啟動:systemctl enable mysql 
設置密碼: 
[root@docker ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.59 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, 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> set password=password('yanxueli');
Query OK, 0 rows affected (0.00 sec)
為什么沒有這個文件而MySQL卻也能正常啟動和使用,這個有兩說法:
1、my.cnf只是MySQL啟動時的一個參數文件,可以沒有它,這時MySQL會用內置的默認參數啟動;
2、MySQL在啟動時自動使用/usr/share/mysql/my-medium.cnf文件,這種說法僅限于rpm包安裝的MySQL。
解決方法很簡單,只需復制/usr/share/mysql/my-medium.cnf文件到/etc目錄,并改名為my.cnf即可:
cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
2、下載confluence:
包地址:
https://cn.atlassian.com/software/confluence/download-archives
本次使用6.13版本
添加運行權限
chmod a+x atlassian-confluence-5.4.4-x64.bin
運行文件得到下面的內容,需要注意的是Confluence的安裝路徑,
默認程序:/opt/atlassian/confluence
默認數據:/var/atlassian/application-data/confluence
在安裝的最后,會問Start Confluence now?我這里選擇的是n,當然如果心急,輸入y也是可以的,反正待會也是要重啟服務。
執行安裝程序,進行安裝:
./atlassian-confluence-6.8.5-x64.bin
Unpacking JRE ...
Starting Installer ...
o確定安裝,c取消
This will install Confluence 6.8.5 on your computer.
OK [o, Enter], Cancel [c]
o
Click Next to continue, or Cancel to exit Setup.
選擇1是使用默認安裝路徑,2為自定義安裝
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]
2
指定安裝的目錄,會自動創建,不輸入直接回車就是使用默認路徑
Select the folder where you would like Confluence 6.8.5 to be installed,
then click Next.
Where should Confluence 6.8.5 be installed?
[/opt/atlassian/confluence]
/usr/local/atlassian/confluence
使用默認的路徑存儲數據 confluence.home目錄
Default location for Confluence data
[/var/atlassian/application-data/confluence]
使用默認的端口,8090和8000
Configure which ports Confluence will use.
Confluence requires two TCP ports that are not being used by any other
applications on this machine. The HTTP port is where you will access
Confluence through your browser. The Control port is used to Startup and
Shutdown Confluence.
Use default ports (HTTP: 8090, Control: 8000) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]
1
安裝為后臺進程,可后臺運行
Confluence can be run in the background.
You may choose to run Confluence as a service, which means it will start
automatically whenever the computer restarts.
Install Confluence as Service?
Yes [y, Enter], No [n]
y
Extracting files ...
Please wait a few moments while we configure Confluence.
是否啟動Confluence
Installation of Confluence 6.8.5 is complete
Start Confluence now?
Yes [y, Enter], No [n]
y
Please wait a few moments while Confluence starts up.
Launching Confluence ...
安裝完成,訪問本機的8090端口進行web端安裝
Installation of Confluence 6.8.5 is complete
Your installation of Confluence 6.8.5 is now ready and can be accessed via
your browser.
Confluence 6.8.5 can be accessed at http://localhost:8090
Finishing installation ...
通過以上可以看出confluence安裝到了/opt/atlassian/confluence和/var/atlassian/application-data/confluence目錄下,并且confluence默認監聽的端口是8090.一路默認安裝即可!
注意:confluence的主要配置文件為/opt/atlassian/confluence/conf/server.xml,和jira類似。此server.xml相當于tomcat中的server.xml配置文件,如果要修改訪問端口,可以這里修改。
如果要修改confluence的數據目錄,可以在安裝的時候,在安裝過程中進行更換(默認是/var/atlassian/application-data/confluence)
設置firewalld 開放相關port
[root@docker ~]# firewall-cmd --zone=public --add-port={3306/tcp,8000/tcp,8090/tcp} --permanent
success
[root@docker ~]# firewall-cmd --reload
success
[root@docker ~]# firewall-cmd --list-port
3306/tcp 8000/tcp 8090/tcp
3、破解confluence
瀏覽器訪問本機IP:8090
系統服務server _Id 并需要用戶輸入 授權碼,如下所示:
4、 接下來需要破解confluence,首先停止confluence服務,如下所示:
[root@vm2 confluence]# /etc/init.d/confluence stop 
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
2018-05-03 17:31:28,470 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.
下載破解工具:
參考:https://blog.51cto.com/moerjinrong/2149177?utm_source=oschina-app
https://files.cnblogs.com/files/Javame/confluence%E7%A0%B4%E8%A7%A3%E5%B7%A5%E5%85%B7.zip
或
http://down.51cto.com/data/2449733
將/opt/atlassian/confluence/confluence/WEB-INF/lib下面的一個atlassian-extras-decoder-v2-3.3.0.jar(具體看自己版本)移到Windows任何一個目錄里待會要用
在Windows將其改名為atlassian-extras-2.4.jar(因為破解工具只認這個版本的名稱)
將新的atlassian-extras-2.4.jar移動到/opt/atlassian/confluence/confluence/WEB-INF/lib,并且刪除舊的atlassian-extras-decoder-v2-3.2.jar。
在windows下,生成License Key。
打開下載好的破解工具(Windows必須提前配置好jdk)
然后本地電腦操作: 
① 打開下載的破解工具,運行confluence_keygen.jar 
②將記錄的server ID填入,Name隨便填。
③點擊gen, 生成key并記錄。 
④點擊patch,選擇剛下傳到本地的atlassian-extras-2.4.jar文件進行破解。
5、生成新的atlassian-extras-2.4.jar,舊的jar包會被改為.bak。將atlassian-extras-2.4.jar移回/opt/atlassian/confluence/confluence/WEB-INF/lib/ 下
OK,破解完成后,將破解后的文件傳回服務器(不要關閉破解工具,過會需復制key里面的密鑰)
6、配置修改mysql并上傳mysql驅動
Confluence本身是沒有集成mysql驅動的,需要自己下載并上傳,原本在你安裝的時候,輸入key之后,會需要填入mysql連接信息,那里會有鏈接指向官方文檔,教你如何配置mysql。但是配置完成后需要重啟,會導致前面的破解出問題,所以,這里要一起完成后再重新啟動。官方教程文檔地址如下:
https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html
下載路徑:https://dev.mysql.com/downloads/connector/j/5.1.html
建議使用官網https://confluence.atlassian.com/conf510/database-jdbc-drivers-829078053.html推薦的,在破解完confluence以后登錄網頁會提供相應的數據驅動程序的鏈接,如果要將confluence升級到最高版本,并且未使用推薦的mysql驅動程序,在升級之前從現有的confluence安裝中復制驅動程序到新的文件夾中,路徑:/opt/atlassian/confluence/confluence/WEB-INF/lib/
例如下載:
wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.46.tar.gz
解壓后把mysql-connector-java-5.1.46-bin.jar傳到服務器上,放到confluence的類目錄下:
cp mysql-connector-java-5.1.39-bin.jar /opt/atlassian/confluence/confluence/WEB-INF/lib/
7、完成上述步驟后,重啟confluence
[root@jenkins lib]# ls mysql-connector-java-5.1.46-bin.jar 
[root@jenkins lib]# /etc/init.d/confluence restart
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://conflue
nce.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-01-14 23:38:24,042 INFO [main] [atlassian.confluence.bootstrap.SynchronyProxyWatchdog] A Conte
xt 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/to
mcat-juli.jarUsing CATALINA_PID: /opt/atlassian/confluence/work/catalina.pid
Tomcat started.
8、confluence配置,配置confluence web連接數據庫
5.4.3的
轉載于:https://blog.51cto.com/13576471/2359101
總結
以上是生活随笔為你收集整理的利用confluence搭建wiki的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 1.电磁波传播原理,慢衰落、快衰落、阴影
- 下一篇: [leetcode] 229. Majo
