Up until now I always have used Mysql server for Jira instances. PostgreSQL is Atlassian preferred database for Jira and other products. So I will go through installing steps for this configuration. I already have a fresh minimal Centos 7 installation.
Atlassian has a guide for this but it is generic covering all possible combinations and for this specific installation one need to jump between various pages. This post will have all you need to know on how to install Atlassian Jira on Centos 7 in one place.
All the details and screenshots are correct for below:
OS: Centos 7 ( Linux 3.10.0-327.el7.x86_64)
Jira Software: atlassian-jira-software-7.2.3-x64
Before start, you need to decide where to download your resources. I usually have my resources in one place. Create a folder for it if you haven’t got one.
sudo yum update sudo yum install vim wget sudo mkdir /opt/atlassian cd /opt/atlassian/
sudo wget https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.2.3-x64.bin sudo chmod +x atlassian-jira-software-7.2.3-x64.bin
sudo ./atlassian-jira-software-7.2.3-x64.bin Unpacking JRE ... Starting Installer ... Nov 01, 2016 10:49:13 AM java.util.prefs.FileSystemPreferences$1 run INFO: Created user preferences directory. Nov 01, 2016 10:49:13 AM java.util.prefs.FileSystemPreferences$2 run INFO: Created system preferences directory in java.home. This will install JIRA Software 7.2.3 on your computer. OK [o, Enter], Cancel [c] o Choose the appropriate installation or upgrade option. Please choose one of the following: Express Install (use default settings) , Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation  2 Where should JIRA Software be installed? [/opt/atlassian/jira] Default location for JIRA Software data [/var/atlassian/application-data/jira] Configure which ports JIRA Software will use. JIRA requires two TCP ports that are not being used by any other applications on this machine. The HTTP port is where you will access JIRA through your browser. The Control port is used to startup and shutdown JIRA. Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports  JIRA can be run in the background. You may choose to run JIRA as a service, which means it will start automatically whenever the computer restarts. Install JIRA as Service? Yes [y, Enter], No [n] y Details on where JIRA Software will be installed and the settings that will be used. Installation Directory: /opt/atlassian/jira Home Directory: /var/atlassian/application-data/jira HTTP Port: 8080 RMI Port: 8005 Install as service: Yes Install [i, Enter], Exit [e] i Extracting files ... atlassian-jira/secure/admin/views/filters/shared-filters.jsp Please wait a few moments while JIRA Software is configured. Installation of JIRA Software 7.2.3 is complete Start JIRA Software 7.2.3 now? Yes [y, Enter], No [n] y Please wait a few moments while JIRA Software starts up. Launching JIRA Software ... Installation of JIRA Software 7.2.3 is complete Your installation of JIRA Software 7.2.3 is now ready and can be accessed via your browser. JIRA Software 7.2.3 can be accessed at http://localhost:8080 Finishing installation ... [saeed@zohal atlassian]$
Open firewall ports
Centos 7 now comes with
firewalld pre-installed and activated by default. You need to open the needed ports to be able to access to the server through web browser.
First check the active zones:
firewall-cmd --get-active-zones public interfaces: eth0
sudo firewall-cmd --zone=public --add-port=8060/tcp --permanent
Jira is going to be the only web service on this machine. So to save typing in the port number each time, I use
firewalld to redirect port
8080. So I just type in my server name and internally port
8080 is called. So instead of the above port you need to go through below lines:
sudo firewall-cmd --zone=public --add-masquerade --permanent sudo firewall-cmd --zone=public --add-forward-port=port=80:proto=tcp:toport=8080 --permanent sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
Remember to reload the firewall for changes to take effect.
sudo firewall-cmd --reload
Now if you have the correct DNS server set-up, to get to the Jira home page you just need to point to the server host name (http://localjiraserver) rather than http://localjiraserver:8080.
Install database engine and connector
Atlassian’s recommended database engine for Jira is PostgreSQL. It is also easiest option to install because it doesn’t need extra steps to download Java connector separately.
sudo yum install postgresql-server
After installing the packages, a database needs to be initialised and configured.
The PostgreSQL data directory has all the data files for the database. The variable PGDATA is used to reference this directory.
The first command (only needed once) is to initialise the database in PGDATA.
sudo postgresql-setup initdb Initializing database ... OK
To control the database service in RHEL 7.1+ and CentOS 7.1+, Systemd is introduced.
Use this to control the service
sudo systemctl enable postgresql sudo systemctl start postgresql
create and set-up database
sudo -u postgres -i -bash-4.2$ psql psql (9.2.15) Type "help" for help. postgres=# CREATE USER jiradbuser PASSWORD 'jiradbpassword'; GRANT ALL ON SCHEMA public TO jiradbuser; GRANT ALL ON ALL TABLES IN SCHEMA public TO jiradbuser; CREATE DATABASE jiradb WITH ENCODING='UTF8' OWNER=jiradbuser CONNECTION LIMIT=-1; \q
Initially i created a schema named
jira and tried to use it to set-up the database. But every the set-up failed in various stages. After spending some time trying to fix it decided a dedicated schema probably not needed as this server will be a dedicated server anyway.
configure authentication methods
default authentication method for local connections in PostgreSQL is set to ‘ident’ that means it will get the operating system user name of the client by contacting the ident server on the client and check if it matches the requested database user name. You can read more on this on official PostgreSQL site.
As we are not planing to have a ident server this needs to be updated. I use md5 method. Other methods can be used too depending on the situation. All these settings resting in
pg_hba.conf file in data folder of the postgresql installation.
so need to do below:
sudo vim /var/lib/pgsql/data/pg_hba.conf
just one line needs to be updated. It is towards the end of the file (line 82 in my case) the one starts with
host all all 127.0.0.1/32 ident
needs to be updated to:
host all all 127.0.0.1/32 md5
then restart the service.
Now all is set to start setting up your Jira server.
Set up Jira
Now open web browser and point to the address that you installed the server.
Select the language and PostgreSQL as external database.
If you pass this stage then it is safe to say you almost done the set-up. there are four more steps specifying the application server title, administrator details, license details and email notification set-up which are self explanatory and can be deferred or easily changed later.