We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – Install and Configure Jira on Debian 11 / Debian 10

Learn how to – Install and Configure Jira on Debian 11 / Debian 10.

In this article, we are going to look at how to install Jira on both Debian 11 and Debian 10 with Nginx reverse proxy and Let’s Encrypt ssl certificate. Firstly, what is Jira? Jira is a software tool used in managing software developments. It provides an intuitive dashboard which helps to easily track issues and fix bugs. Here are simple steps that will enable us to install Jira on Debian 11/10 using Nginx as reverse proxy with Let’s encrypt ssl configured.

1.) Update Packages

Let’s first upgrade our system packages before beginning installation

sudo apt-get update
sudo apt-get upgrade

Once the system has been ugraded perform a reboot

sudo reboot

2.) Install OpenJDK on Debian

Run the below command to install OpenJDK on Debian 11 / Debian 10 Linux system.

sudo apt install -y openjdk-11-jdk

Confirm Java version

$ java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2deb10u1, mixed mode, sharing)

3.) Install and Configure MySQL

Jira requires a database to store its data and we are going to be using MySQL 5.7. Check out our installation guide on the following link:

Once you have MySQL installed, start and enable it to start automatically on server reboot

sudo systemctl start mysql
sudo systemctl enable mysql

Connect to mysql and create a user and a database for Jira.

$ sudo mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 60
Server version: 10.3.29-MariaDB-0+deb10u1 Debian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]>

Proceed to create Jira database and user

MariaDB [(none)]> CREATE DATABASE jiradb CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> CREATE USER 'jirauser'@'%' IDENTIFIED BY 'mystrongpasswd';
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,ALTER,INDEX ON jiradb.* TO 'jirauser'@'%' IDENTIFIED BY 'mystrongpassword';
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> q
Bye

Open MySQL default configuration and make some changes as below:

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

Add the following content within [mysqld]

character-set-server  = utf8mb4
collation-server      = utf8mb4_general_ci
default-storage-engine = INNODB
innodb_default_row_format = DYNAMIC
innodb_large_prefix = ON
innodb_file_format = Barracuda
innodb_log_file_size = 2G

Also set bind address to your server IP Address

bind-address = 192.168.100.222

Restart MariaDB service

sudo systemctl restart mysql

4.) Installing Jira on Debian 11 / Debian 10

Visit Jira official download page to get the latest jira binary or download using wget as shown below and update permissions to make it executable

wget https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-core-8.21.1-x64.bin
chmod a+x atlassian-jira-core-8.21.1-x64.bin

Proceed to install Jira software on Debian 11 / Debian 10 Linux machine.

$ sudo ./atlassian-jira-core-8.21.1-x64.bin
Unpacking JRE ...
Starting Installer ...

This will install Jira Core 8.21.1 on your computer.
OK [o, Enter], Cancel [c] Enter

Click Next to continue, or Cancel to exit Setup.

Choose the appropriate installation or upgrade option.
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] Enter

Select the folder where you would like Jira Core to be installed.
Where should Jira Core be installed?
[/opt/atlassian/jira] Enter

Default location for Jira Core data
[/var/atlassian/application-data/jira] Enter

Configure which ports Jira Core 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 [2] Enter

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] Enter

Details on where Jira Core 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] Enter

Extracting files ...

Please wait a few moments while Jira Core is configured.

Installation of Jira Core 8.21.1 is complete
Start Jira Core 8.21.1 now?
Yes [y, Enter], No [n] Enter


Please wait a few moments while Jira Core starts up.
Launching Jira Core ...

Installation of Jira Core 8.21.1 is complete
Your installation of Jira Core 8.21.1 is now ready and can be accessed via
your browser.
Jira Core 8.21.1 can be accessed at http://localhost:8080
Finishing installation ...                                                                   

5.) Open Jira Ports in UFW firewall

If you have an active firewall, you need to open the following ports used by Jira

sudo ufw allow 8080
sudo ufw allow 8181
sudo ufw allow 8005

If you have not installed UFW, you can run the below command to install

sudo apt -y install ufw
sudo ufw enable

We also need to download MySQL Java connector. Download the connector, unzip it and move the jar files to lib folder of atlassian installation directory. You also need to restart Jira after.

wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.49.zip
sudo unzip mysql-connector-java-5.1.49.zip
cd mysql-connector-java-5.1.49
sudo mv mysql-connector-java-5.1.49.jar /home/lorna/atlassian/jira/lib
sudo mv mysql-connector-java-5.1.49-bin.jar /home/lorna/atlassian/jira/lib
sudo atlassian/jira/bin/stop-jira.sh
sudo atlassian/jira/bin/start-jira.sh

6.) Accessing Jira from the Browser

At this point, we have successfully installed Jira and we can access it from the browser using the server IP address and port 8080, http:<your-ip-address>:8080. The Jira set up page below should open

7.) Configure Nginx Proxy for Jira server

You can configure Nginx web server to serve Jira web page. At this point you should have a fully qualified domain name for your jira installation that you will install ssl to. For this guide, iam just using jira.example.com.

Before installing Nginx, we will first configure Tomcat for Nginx reverse proxy. Stop Jira then edit server.xml file.

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

Now edit server.xml file

sudo vim atlassian/jira/conf/server.xml

Look for the line starting with “<Context path = “” docBase….> and add a “/” so that it looks like below:

<Context path = "/" docBase....>

On the ‘Connector’ section, add proxy port, proxy name, scheme and secure so that it appears as shown

<Connector port="8080" relaxedPatchesChars="[]|" relaxedQueryChars="Special characters" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true" bindOnInit="false" proxyName="jira.example.com" proxyPort="80" scheme="http"/>

Save the changes and start jira

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

Install and configure Nginx for Jira

To install Nginx on Debian 11/10, run the following command:

sudo apt -y install nginx

Remove the default Nginx configuration

sudo rm -f /etc/nginx/sites-available/default
sudo rm -f /etc/nginx/sites-enabled/default

Then configure Nginx for Jira

sudo vim /etc/nginx/sites-available/jira.conf

Add the following content, updating the hostname for your server

server {
	listen [::]:80;
	listen 80;

	server_name jira.example.com;

	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:8080;
		client_max_body_size 10M;
}
}

Save the file and create a simlink for the file in sites-enabled directory

sudo ln -s /etc/nginx/sites-available/jira.conf /etc/nginx/sites-enabled/jira.conf

Test Nginx configuration

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Restart Nginx

sudo systemctl restart nginx

At this point, your Nginx server should be able to load Jira as configured above. You can test this using the provided domain name. For my case, I am using http://jira.example.com

8.) Configure Let’s Encrypt SSL for Nginx

Now let’s procedd to secure the installation. We are going to install Certbot but there are a number of dependencies needed to be installed

sudo apt install -y cat python3-acme python3-certbot python3-mock python3-openssl python3-pkg-resources python3-pyparsing python3-zope.interface
sudo apt-get install python3-certbot-nginx

Proceed to acquire Let’s encrypt ssl

sudo certbot --nginx -d jira.example.com

When prompted to enter the email, provide it and agree to the terms and conditions, after which the certs will be generated for your domain. Next is to redirect Jira http traffic to https as below:

server {
	listen [::]:80;
	listen 80;

	server_name jira.example.com;

	return 301 https://jira.example.com$request_uri;
}


server {
	listen [::]:443 ssl;
	listen 443 ssl;


	server_name jira.example.com;

	ssl_certificate	/etc/letsencrypt/live/jira.example.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/jira.example.com/privkey.pem;

	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:8080;
		client_max_body_size 10M;
}
}

Test Nginx again and restart it if no error

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
$ sudo systemctl restart nginx

We also need to update connector configurations. Open atlassian/jira/conf/server.xml and replace the content in <connector> with the below content.

<Connector port="8080" relaxedPatchesChars="[]|" relaxedQueryChars="Special characters" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true" proxyName="jira.example.com" proxyPort="443" scheme="https" secure="true"/>

Save the file and restart jira

sudo atlassian/jira/bin/stop-jira.sh
sudo atlassian/jira/bin/start-jira.sh

Test ssl installation with https://<your-host-name> and you should still load the Jira webpage just as you did above

9.) Jira Basic Configuration

You can see that the first page presents you with configuration options; the option to do a custom configuration which is suitable for a production environment and the other option to let the system configure preferred for evaluation purposes. Click on ‘I will set it up for myself‘ and click ‘Next

Next, configure your database. Select ‘my own database’ and fill in the required detail and click ‘TestConnectivity‘ to ensure that your DB is reachable.

You should see a successful connection to database.

Once you have confirmed connectivity, click Next to set up your properties as shown. Choose your preferred mode to either be public or private.

Click Next to enter your license key. If you have a license, paste it on the provided area or generate a jira license trial. Click Next to set an admin account.

Once you provide the license, you will be prompted to set up an admin account.

Next, you can choose to set up email notification or do it later

Click finish to complete installation. You will be prompted to select your language.

Select the language and click Continue. Next, choose an avator.

When you click Next, you should see a welcome page and you can start creating your projects.

That’s it. You have successfully installed Jira on Debian 11 and Debian 10 using MySQL and Nginx web server. We have also seen how you can configure SSL to secure your Jira installation. I hope the guide has been useful. Check more interesting articles below:

Cart

Your Cart is Empty

Back To Shop