[关闭]
@sasaki 2016-04-23T23:43:46.000000Z 字数 5796 阅读 5439

搭建Confluence——企业级团队协作工具

Pricatice


版本控制

  1. @Title 搭建Confluence——企业级团队协作工具
  2. @Version v1.0
  3. @Timestamp 2015-04-23 00:44
  4. @Author Nicholas
  5. @Mail redskirt@outlook.com

Confluence为团队提供一个协作环境。在这里,团队成员齐心协力,各擅其能,协同地编写文档和管理项目。从此打破不同团队、不同部门以及个人之间信息孤岛的僵局,Confluence真正实现了组织资源共享。
Confluence使用简单,但它强大的编辑和站点管理特征能够帮助团队成员之间共享信息、文档协作、集体讨论。

本文记录了我在CentOS 6.5平台下搭建Confluence的全部过程。
详细步骤参考Confluence官方“Installing Confluence on Linux”:
https://confluence.atlassian.com/doc/installing-confluence-on-linux-143556824.html

下载地址
https://www.atlassian.com/software/confluence/download?os=linux
选择Linux环境的安装包,当前最新版本5.9.9。

由于是在Windows环境中下载的,用FTP工具put到服务器中,执行安装时出现以下异常。警告中意思说的很清楚,安装包是二进制编码的,应该是上传文件的时候使用的ASCII编码传输。重新上传,在FTP中传输方式选择为Binary。

  1. [root@master tmp]# chmod 755 atlassian-confluence-5.9.9-x64.bin
  2. [root@master tmp]# ./atlassian-confluence-5.9.9-x64.bin
  3. gzip: sfx_archive.tar.gz: not in gzip format
  4. I am sorry, but the installer file seems to be corrupted.
  5. If you downloaded that file please try it again. If you
  6. transfer that file with ftp please make sure that you are
  7. using binary mode.

再次执行安装过程,根据操作提示连续回答几个问题,设置需要的配置。因为无特殊配置,此处选择了使用默认配置,使用默认的安装路径和数据存放路径,默认端口为8090。

  1. [root@master tmp]# chmod 755 atlassian-confluence-5.9.9-x64.bin
  2. [root@master tmp]# ./atlassian-confluence-5.9.9-x64.bin
  3. Unpacking JRE ...
  4. Starting Installer ...
  5. Apr 22, 2016 12:33:41 PM java.util.prefs.FileSystemPreferences$1 run
  6. INFO: Created user preferences directory.
  7. This will install Confluence 5.9.9 on your computer.
  8. OK [o, Enter], Cancel [c]
  9. o
  10. Choose the appropriate installation or upgrade option.
  11. Please choose one of the following:
  12. Express Install (uses default settings) [1],
  13. Custom Install (recommended for advanced users) [2, Enter],
  14. Upgrade an existing Confluence installation [3]
  15. 1
  16. See where Confluence will be installed and the settings that will be used.
  17. Installation Directory: /opt/atlassian/confluence
  18. Home Directory: /var/atlassian/application-data/confluence
  19. HTTP Port: 8090
  20. RMI Port: 8000
  21. Install as service: Yes
  22. Install [i, Enter], Exit [e]
  23. i
  24. Extracting files ...
  25. Please wait a few moments while Confluence starts up.
  26. Launching Confluence ...
  27. Installation of Confluence 5.9.9 is complete
  28. Your installation of Confluence 5.9.9 is now ready and can be accessed via
  29. your browser.
  30. Confluence 5.9.9 can be accessed at http://localhost:8090
  31. Finishing installation ...

在MySQL中为Confluence建立数据库环境,当然,服务器必须预先安装MySQL,如果本地没有数据库则使用远程的也可,Confluence的持久层是用Hibernate框架。数据库的访问地址在Web UI引导安装界面会有。
新建好数据库后注意把mysql连接的jar文件放到Confluence安装目录的web项目中的lib下,需要驱动文件才能建立数据库连接。

  1. # 建立confluence数据库
  2. mysql> CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;
  3. # 配置confluence用户对数据库的访问权限
  4. mysql> GRANT ALL PRIVILEGES ON confluence.* TO 'confluenceuser'@'localhost' IDENTIFIED BY 'confluencepass';
  5. Query OK, 0 rows affected (0.00 sec)
  6. # 拷贝驱动jar文件到lib目录
  7. [root@master lib]# pwd
  8. /opt/atlassian/confluence/confluence/WEB-INF/lib
  9. [root@master lib]# cp /usr/application/tmp/mysql-connector-java-5.1.35.jar .

至此,安装过程结束,根据官方wiki的说明,还需在安装目录下新建或修改以下配置文件

  1. # 在<CONFLUENCE_HOME>创建一个confluence.cfg.xml文件
  2. [root@master confluence]# pwd
  3. /opt/atlassian/confluence
  4. [root@master confluence]# ls
  5. bin install.reg LICENSE NOTICE RELEASE-NOTES uninstall
  6. conf jre licenses README.html RUNNING.txt webapps
  7. confluence lib logs README.txt temp work
  8. [root@master confluence]# touch confluence.cfg.xml
  9. # 在server.xml中<Context ></Context>配置语句块中新增以下内容,即配置MySql Datasource
  10. [root@master confluence]# vim conf/server.xml
  11. <Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource"
  12. username="yourusername"
  13. password="yourpassword"
  14. driverClassName="com.mysql.jdbc.Driver"
  15. url="jdbc:mysql://localhost:3306/confluence?useUnicode=true&amp;characterEncoding=utf8"
  16. maxTotal="25"
  17. maxIdle="10"
  18. defaultTransactionIsolation="READ_COMMITTED"
  19. validationQuery="Select 1" />
  20. # 在web.xml文件中<web-app></web-app>配置语句块中新增以下内容,引用Datasource
  21. [root@master confluence]# vim conf/web.xml
  22. <resource-ref>
  23. <description>Connection Pool</description>
  24. <res-ref-name>jdbc/confluence</res-ref-name>
  25. <res-type>javax.sql.DataSource</res-type>
  26. <res-auth>Container</res-auth>
  27. </resource-ref>
  28. # 在以上新建的confluence.cfg.xml文件中贴入以下内容,配置hibernate框架对Datasource的访问
  29. [root@master confluence]# vim confluence.cfg.xml
  30. <property name="hibernate.setup"><![CDATA[true]]></property>
  31. <property name="hibernate.dialect"><![CDATA[com.atlassian.hibernate.dialect.MySQLDialect]]></property>
  32. <property name="hibernate.connection.datasource"><![CDATA[java:comp/env/jdbc/confluence]]></property>

执行启动脚本,实际上是Tomcat容器的启动脚本。

  1. [root@localhost confluence]# pwd
  2. /opt/atlassian/confluence
  3. [root@localhost confluence]# bin/start-confluence.sh
  4. To run Confluence in the foreground, start the server with start-confluence.sh -fg
  5. executing using dedicated user: confluence1
  6. If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide
  7. Server startup logs are located in /opt/atlassian/confluence/logs/catalina.out
  8. Using CATALINA_BASE: /opt/atlassian/confluence
  9. Using CATALINA_HOME: /opt/atlassian/confluence
  10. Using CATALINA_TMPDIR: /opt/atlassian/confluence/temp
  11. Using JRE_HOME: /opt/atlassian/confluence/jre/
  12. Using CLASSPATH: /opt/atlassian/confluence/bin/bootstrap.jar:/opt/atlassian/confluence/bin/tomcat-juli.jar
  13. Using CATALINA_PID: /opt/atlassian/confluence/work/catalina.pid
  14. Tomcat started.
  15. # 查看8090端口已被监听,此时可打开浏览器访问confluence
  16. [root@localhost confluence]# netstat -atpl|grep 8090
  17. tcp 0 0 *:8090 *:* LISTEN 15188/java
  18. # 停止confluenct服务
  19. [root@master confluence]# bin/stop-confluence.sh
  20. executing using dedicated user
  21. If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide
  22. # Configuring a MySQL Datasource in Apache Tomcat
  23. Server startup logs are located in /opt/atlassian/confluence/logs/catalina.out
  24. Using CATALINA_BASE: /opt/atlassian/confluence
  25. Using CATALINA_HOME: /opt/atlassian/confluence
  26. Using CATALINA_TMPDIR: /opt/atlassian/confluence/temp
  27. Using JRE_HOME: /opt/atlassian/confluence/jre/
  28. Using CLASSPATH: /opt/atlassian/confluence/bin/bootstrap.jar:/opt/atlassian/confluence/bin/tomcat-juli.jar
  29. Using CATALINA_PID: /opt/atlassian/confluence/work/catalina.pid
  30. Tomcat stopped.

以下为Confluence UI引导安装界面的截图,具体步骤不再赘述。
Screen Shot 2016-04-22 at 12.39.20 PM.png-400.5kB

Screen Shot 2016-04-22 at 12.37.36 PM.png-326.1kB

Screen Shot 2016-04-22 at 1.14.23 PM.png-277.4kB

Screen Shot 2016-04-22 at 1.16.13 PM.png-236.7kB

Screen Shot 2016-04-22 at 1.20.01 PM.png-253.1kB

Screen Shot 2016-04-22 at 1.20.15 PM.png-252.1kB

Screen Shot 2016-04-22 at 1.20.33 PM.png-149.4kB

Screen Shot 2016-04-22 at 1.22.16 PM.png-96.1kB

Screen Shot 2016-04-22 at 1.22.25 PM.png-76.4kB

Screen Shot 2016-04-22 at 1.24.35 PM.png-139.8kB

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注