Wiki系统confluence Linux下安装说明

备注:必需注意系统主机名 hostname 返回的主机名必需在/etc/hosts做好对应 无需安装JDK confluence 自带JDK JRE

1.下载软件
wget https://downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-5.9.7-x64.bin chmod +x atlassian-confluence-5.9.7-x64.bin
默认软件安装路径为/opt/atlassian/confluence 数据存放为/var/atlassian/application-data/confluence

2.下载并安装mysql JDBC驱动
停掉confluence tomcat /etc/init.d/onfluence stop

wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.tar.gz tar -xf mysql-connector-java-5.1.40.tar.gz
cp mysql-connector-java-5.1.40/mysql-connector-java-5.1.40-bin.jar /opt/atlassian/confluence/confluence/WEB-INF/lib/

3.修改Tomcat 配置文件
/opt/atlassian/confluence/conf/server.xml

找到如下字段

<Context path="" docBase="../confluence" debug="0" reloadable="true"> <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->

<Context path="" docBase="../confluence" debug="0" reloadable="true">这一行添加如下内容

<Resource name="jdbc/confluence" auth="Container" type="javax.sql.DataSource" username="数据库用户名" password="数据库密码" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/confluence?useUnicode=true&amp;characterEncoding=utf8" maxActive="15" maxIdle="7" defaultTransactionIsolation="READ_COMMITTED" validationQuery="Select 1" />

其中confluence 是数据库名

4.mysql添加用户和相对应用的数据库
create database confluence; GRANT ALL PRIVILEGES ON confluence.* TO '数据库用户名'@'localhost' IDENTIFIED BY '数据库密码';
FLUSH PRIVILEGES;

5.启动confluence
/etc/init.d/onfluence start

6.设置nginx 反应代理到 confluence 端口 8090
如下例 server {
listen 443 ssl; server_name wiki.abcd.com;

ssl_certificate ssl/fullchain.cer;
ssl_certificate_key ssl/wiki.abcd.com.key;


add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; 
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2 ;
            ssl_stapling on;
            resolver 8.8.8.8;
            ssl_prefer_server_ciphers on;
            ssl_stapling_verify on;
            ssl_dhparam ssl/dh2048.pem;
            ssl_session_cache shared:SSL:10m;
            ssl_session_timeout 10m;
            ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-RC4-SHA:!ECDHE-RSA-RC4-SHA:ECDH-ECDSA-RC4-SHA:ECDH-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:!RC4-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!CBC:!EDH:!kEDH:!PSK:!SRP:!kECDH;

location /{
    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;
    proxy_pass http://localhost:8090;
}

}

7.WEB设置界面地址是 http://ip:8090 根据向导走完 数据库选Mysql 输入对应用的选项即可

8.如何切底删除confluence
执行

/opt/atlassian/confluence/uninstall rm -rf /opt/atlassian/
rm -rf /var/atlassian

全文完