centos6.9安裝confluence 6.5.0
一、環境準備(如果安裝jira的時候已經做了,就不需要做;但是要創建confluence的數據庫和用戶)
1、關閉或設置防火墻、關閉selinux。
2、安裝jdk8環境(安裝oracle的java,默認的openjdk不行)。
鏈接: https://pan.baidu.com/s/1pK8oLyb 密碼: ypfd
(1)這裏下載的是rpm包。
[root@agile soft]# rpm -ivh jdk-8u131-linux-x64.rpm
1:jdk1.8.0_131 ########################################### [100%]
Unpacking JAR files...
tools.jar...
plugin.jar...
javaws.jar...
deploy.jar...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
(2)設置環境變量。
[root@agile soft]# vim /etc/profile
JAVA_HOME=/usr/java/jdk1.8.0_131
JAVA_BIN=/usr/java/jdk1.8.0_131/bin
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/sbin/
CLASSPATH=.:/lib/dt.jar:/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
(3)使環境變量生效。
[root@agile soft]# source /etc/profile
(4)查看java版本。
[root@agile soft]# java -version
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
3、安裝mysql 5.6
(1)安裝mysql的yum源,這個源包括5.5、5.6、5.7版本:
備註:如果要專門下載某個版本,可以到http://dev.mysql.com/downloads/repo/yum下載。
[root@agile ~]# rpm -ivh http://repo.mysql.com/mysql-community-release-el6.rpm Retrieving http://repo.mysql.com/mysql-community-release-el6.rpm warning: /var/tmp/rpm-tmp.C87LHo: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ########################################### [100%] 1:mysql-community-release########################################### [100%]
(2)打開mysql的yum源文件,如果要安裝mysql哪個版本,選擇後把裏面的enable設置為1。
備註:或者用yum-config-manager命令方式開啟或關閉。
yum-config-manager --disable mysql55-community
yum-config-manager --enable mysql56-community
yum-config-manager --disable mysql57-community
[root@agile ~]#vim /etc/yum.repos.d/mysql-community.repo # Enable to use MySQL 5.5 [mysql55-community] name=MySQL 5.5 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql # Enable to use MySQL 5.6 [mysql56-community] name=MySQL 5.6 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql57-community] name=MySQL 5.7 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
(3)yum安裝mysql組件。
[root@agile ~]#yum install mysql-community-client mysql-community-devel mysql-community-server php-mysql 正在安裝: mysql-community-client x86_64 5.6.38-2.el6 mysql56-community 18 M mysql-community-devel x86_64 5.6.38-2.el6 mysql56-community 3.3 M mysql-community-libs x86_64 5.6.38-2.el6 mysql56-community 1.9 M replacing mysql-libs.x86_64 5.1.73-8.el6_8 mysql-community-libs-compat x86_64 5.6.38-2.el6 mysql56-community 1.6 M replacing mysql-libs.x86_64 5.1.73-8.el6_8 mysql-community-server x86_64 5.6.38-2.el6 mysql56-community 55 M php-mysql x86_64 5.3.3-49.el6 base 86 k 為依賴而安裝: mysql-community-common x86_64 5.6.38-2.el6 mysql56-community 308 k numactl x86_64 2.0.9-2.el6 base 74 k php-common x86_64 5.3.3-49.el6 base 530 k php-pdo x86_64 5.3.3-49.el6 base 80 k
(4)啟動mysql命令,並設置開機自啟動。
[root@agile ~]#service mysqld start [root@agile ~]#chkconfig mysqld on
(5)mysql設置root密碼。
[root@agile ~]#mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist ... Failed! Not critical, keep moving... - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! Cleaning up...
(6)mysql設置。
在[mysqld]下面加入這幾行:
[root@agile ~]# vi /etc/my.cnf 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
在這2個文件裏面分別加入如下內容:
[root@agile ~]# vi /etc/my.cnf.d/client.cnf [client] default-character-set=utf8 [root@agile my.cnf.d]# vi /etc/my.cnf.d/mysql-clients.cnf [mysql] default-character-set=utf8
重啟mysql,並查看字符集。
[root@agile my.cnf.d]# service mysqld restart 停止 mysqld: [確定] 正在啟動 mysqld: [確定] [root@agile my.cnf.d]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.38 MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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> 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.08 sec) +----------------------+-----------------+ | Variable_name | Value | +----------------------+-----------------+ | collation_connection | utf8_unicode_ci | | collation_database | utf8_unicode_ci | | collation_server | utf8_unicode_ci | +----------------------+-----------------+ 3 rows in set (0.02 sec) mysql>
4、mysql中創建confluence數據庫和用戶,並驗證。
mysql> create database confluence default character set utf8 collate utf8_bin; Query OK, 1 row affected (0.11 sec) mysql> grant all on confluence.* to 'confluence'@'%' identified by 'confluencepasswd'; Query OK, 0 rows affected (0.09 sec) mysql> flush privileges; Query OK, 0 rows affected (0.01 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | confluence | | jira | | mysql | | performance_schema | +--------------------+ 4 rows in set (0.07 sec) [root@agile ~]# mysql -u confluence -h localhost -pconfluencepasswd Warning: Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.6.38 MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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>
二、安裝Confluence 6.5.0
1、下載並解壓confluence到/tmp目錄
wget -c -P /tmp https://downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-6.5.0.tar.gz cd /tmp tar zxvf atlassian-confluence-6.5.0.tar.gz cp -rv atlassian-confluence-6.5.0/ /opt/
2、創建軟鏈接,註意jira目錄後不要帶“/”,/opt/confluence就作為confluence的安裝目錄
ln -sv /opt/atlassian-confluence-6.5.0 /opt/confluence - 創建confluence用戶並設置密碼為”123456“ /usr/sbin/useradd --create-home --comment "Account for running confluence" --shell /bin/bash confluence echo "123456" | passwd --stdin confluence
3、設置jira目錄只允許jira用戶訪問
chown -R confluence.confluence /opt/confluence/ chmod -R 700 /opt/confluence/
4、創建jira家目錄,用於log、搜索索引等文件的存儲,並限制只允許confluence用戶訪問
mkdir /home/jconfluence/confluence-home chown -R confluence.confluence /home/confluence/confluence-home chmod -R 700 /home/confluence/confluence-home
5、設置/opt/jira/atlassian-jira/WEB-INF/classes/jira-application.properties文件,在末尾去除註釋並修改為上面設置的jira家目錄路徑,
jira.home=/home/confluence/confluence-home
6、檢查端口是否被占用,jira默認運行的端口有8000和8090, Change the Server port (8000) and the Connector port (8090),如果被占用,可打開/opt/jira/conf/server.xml文件修改端口,如果防火墻打開,則放行修改後的端口,下面的例子是修改成Server port to 5000 and the Connector port to 5050.
Server port="5000" shutdown="SHUTDOWN" debug="0"> <Service name="Tomcat-Standalone"> <Connector port="5050" connectionTimeout="20000" redirectPort="8443" maxThreads="48" minSpareThreads="10" enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8" protocol="org.apache.coyote.http11.Http11NioProtocol" />
7、下載mysql數據庫連接jar包並拷貝到jira的lib目錄下
wget -c -P /tmp wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.45.tar.gz cd /tmp tar zxvf mysql-connector-java-5.1.45.tar.gz cd mysql-connector-java-5.1.45 \cp mysql-connector-java-5.1.40-bin.jar /opt/confluence/confluence/WEB-INF/lib/
8、切換到confluence用戶並啟動jira工程,檢查8090端口。並將啟動命令加入到/etc/rc.load文件中。
su confluence cd /opt/confluence/bin/ ./start-confluence.sh
9、輸入http://192.168.0.182:8090/訪問
註冊一個帳號,需要FQ。
按照提示設置,會提示連接jira。註冊官網帳號生成試用版序列號。
centos6.9安裝confluence 6.5.0