how to install confluence on centos 7
Asked by Ismaine Ayouaz:

**Tested solution on centos 7 minimal last edition**

* sudo yum upgrade (after installation)
* Adduser confluence
* Passwd confluence "your password"

Make the user confluence root with visudo

## Allow root to run any commands anywhere  
root ALL=(ALL) ALL  
confluence ALL=(ALL) ALL

from now on, everything is done under the user confluence unless noted otherwise

### Install wget {#toc-hId-1597892633}

* yum install wget

### Download java {#toc-hId--954264328}

* wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" <http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.rpm>

### Install Java {#toc-hId-788546007}

* chmod u+x jdk-8u172-linux-x64.rpm
* sudo yum localinstall jdk-8u172-linux-x64.rpm

**To check your installed java version :**

* java -version

**Add the JAVA_HOME the path to java**

* sudo vi /etc/profile
* export JAVA_HOME=/usr/java/jdk1.8.0_172-amd64
* export JAVA_PATH=$JAVA_HOME

### Firewall {#toc-hId--1763610954}

* sudo firewall-cmd --permanent --add-port=5432/tcp
* sudo firewall-cmd --permanent --add-port=8090/tcp
* sudo firewall-cmd --permanent --add-port=80/tcp
* sudo firewall-cmd --reload

optional: setsebool -P httpd_can_network_connect_db 1

### Download confluence {#toc-hId--20800619}

* Wget <https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-6.8.1.tar.gz>

### Install confluence {#toc-hId-1722009716}

* chmod u+wrx atlassian-confluence-6.8.1.tar.gz
* tar -xzf atlassian-confluence-6.8.1.tar.gz
* mv atlassian-confluence-6.8.1 atlassian-confluence
* mkdir confluence_data
* chown -R confluence.confluence atlassian-confluence
* chown -R confluence.confluence confluence_data
* chmod -R u+wrx atlassian-confluence
* chmod -R u+wrx confluence_data
* vi confluence/WEB-INF/classes/confluence-init.properties  
  Modify the file to reflect the following: confluence.home=/home/confluence/confluence_data/

### start confluence {#toc-hId--830147245}

* cd /home/confluence/atlassian-confluence/bin
* ./start-confluence.sh

### Install Postgres {#toc-hId-912663090}

**Configure your YUM repository**   
Locate and edit your distributions .repo file, located:/etc/yum.repos.d/CentOS-Base.repo, \[base\] and \[updates\] sections  
To the section(s) identified above, you need to append a line (otherwise dependencies might resolve to the postgresql supplied by the base repository):

* exclude=postgresql\*

**Install PGDG RPM file**

* wget <https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm>
* sudo yum localinstall pgdg-centos96-9.6-3.noarch.rpm

Files for postgres are in /var/lib/pgsql/9.6 and data in /var/lib/pgsql/9.6/data

**Install all the postgresql files available:**

* sudo yum install postgresql96\*

**Initialize your Postgres database and start PostgreSQL:**

* sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
* sudo systemctl start postgresql-9.6.service

**Configure PostgreSQL to start on boot:**

* sudo systemctl enable postgresql-9.6.service

### Change the postgres user's Linux password: {#toc-hId--1639493871}

* sudo passwd postgres

Issue the following commands to set a password for the postgres database user.

* su - postgres

### Create database user and database {#toc-hId-103316464}

* psql
* CREATE USER "your db username" PASSWORD 'yourpassword';
* CREATE SCHEMA confluence;
* GRANT ALL ON SCHEMA confluence TO "your db username";
* GRANT ALL ON ALL TABLES IN SCHEMA confluence TO "your db username";
* CREATE DATABASE "your db name" WITH ENCODING='UTF8' OWNER="your db username" CONNECTION LIMIT=-1;
* \\q

As postgres user, edit the /var/lib/pgsql/9.6/data/pg_hba.conf

**Replace:**

# IPv4 local connections:  
host all all 127.0.0.1/32 ident

to

**host all all 0.0.0.0/0 md5**

**As Confluence user, restart postgresql service**

* sudo systemctl restart postgresql-9.6.service

Open your web browser and enter your URL:8090

Follow the step by step procedure until confluence is completely setup


Answers:
author: Robbie LaBarbera
body: Thank you, thank you, THANK YOU.. first walkthrough I've found (out of SEVERAL) that worked without any issues.

Thank you.


author: Ismaine Ayouaz
body: that is very nice of you. thank you for the kind words..that was my first walkthrough.


author: israels299
body: i followed the instructions.

then i typed the url and i got "Unable to connect"


author: Lee Pyatt
body: At the bottom of the file works just fine.


author: World Travels
body: I didn't quite get this part:

**Add the JAVA_HOME the path to java**

* sudo vi /etc/profile
* export JAVA_HOME=/usr/java/jdk1.8.0_172-amd64
* export JAVA_PATH=$JAVA_HOME

Where in the /profile should I add those two things you listed below:

* sudo vi /etc/profile


Tags: centos

linux