Atlassian Jira, Apache2, Microsoft SQL Server Configuration

Basic instructions

“These instructions are for setting up Atlassian Jira on Centos (Or RHEL) with Apache2 and a Microsoft SQL 2017 database.”

Description

Set up Atlassian Jira on Microsoft SQL Server 2017 with Apache Web Server.

Instructions

Set up database server

Run all these commands in order on your Centos (OR RHEL) database server.

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo
sudo yum install -y mssql-server
sudo /opt/mssql/bin/mssql-conf setup
systemctl status mssql-server
sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent
sudo firewall-cmd --reload
sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo
sudo yum remove unixODBC-utf16 unixODBC-utf16-devel
sudo yum install -y mssql-tools unixODBC-devel
sudo ln -s /opt/mssql-tools/bin* /usr/local/bin/
sqlcmd -S localhost -U SA -P ‘password’
CREATE LOGIN userjira WITH PASSWORD = '220$Uuxwp7Mcqao7Khy'  
GO 
CREATE USER userjira FOR LOGIN userjira  
GO  
USE master
GO
CREATE DATABASE dbjira COLLATE SQL_Latin1_General_CP437_CI_AI
GO
EXEC sp_changedbowner 'userjira'
GO
ALTER DATABASE dbjira SET READ_COMMITTED_SNAPSHOT ON;
GO

Remember your database login information for later.

Set up the JIRA application server

Run all these commands in order on your Centos (or RHEL) application server.

sudo yum install wget
sudo wget https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-software-7.12.3-x64.bin
sudo chmod a+x ./atlassian-jira-software-7.12.3-x64.bin
sudo ./atlassian-jira-software-7.12.3-x64.bin
This will install JIRA Software 7.12.3 on your computer.
OK [o, Enter], Cancel [c]
o
Please choose one of the following:
Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation [3]
1
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 ...
Please wait a few moments while JIRA Software is configured.
Installation of JIRA Software 7.12.3 is complete
Start JIRA Software 7.12.3 now?
Yes [y, Enter], No [n]
y

Please wait a few moments while JIRA Software starts up.
Launching JIRA Software ...
sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent 

Verify that you get a valid response on the localhost…

wget http://localhost:8080

You might see something like this…

Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... connected.

Stop the JIRA service, so that you can make changes to the configuration.

cd /opt/atlassian/jira/bin
sudo ./stop-jira.sh

Modify the server.xml on the JIRA application server

cd /opt/atlassian/jira/conf
sudo yum install vim
sudo vim server.xml

change the following text

<Context path=”” to <Context path=”/jira”

Add this to the end of the 8080 connector…

proxyName=”mydomain.com” proxyPort=”443” scheme=”https”/>

Save file and exit using esc :wq

Configure Apache2 Web Server

mydomain.conf is a generic/made up file name. Your sites name is something else within the sites-enabled folder.

sudo yum install apache2
cd /etc/apache2/sites-enabled
sudo vim mydomain.conf

Add the following to the mydomain.conf. Replace mydomain.com with your domain. Replace server.myintranetdomain.com with the FQDN of your JIRA application server.

<IfModule mod_ssl.c>
<VirtualHost *:443>
Timeout 10000
ProxyTimeout 10000
ServerName mydomain.com
redirect / https://mydomain.com/jira
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header always append X-Frame-Options SAMEORIGIN
ProxyRequests off
ProxyPreserveHost on
ProxyVia off
ProxyPass /jira http://server.myintranetdomain.com:8080/jira
ProxyPassReverse /jira http://server.myintranetdomain.com:8080/jira
RewriteEngine on
#Assumes use of Let’s Encrypt Certificate. Will need to be changed for other certificate options.
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias mydomain.com
SSLCertificateFile /etc/letsencrypt/live/mydomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
<VirtualHost *:80>
ServerName mydomain.com
redirect / https://mydomain.com/jira
</VirtualHost>
</IfModule>

On the application server, start the JIRA service to test that the application is running properly from your domain name.

cd /opt/atlassian/jira/bin
sudo ./start-jira.sh

Navigate to mydomain.com/jira and follow the installation prompts.

References

CertBot

Microsoft

JIRA