Book Image

Jira 8 Administration Cookbook - Third Edition

By : Patrick Li
Book Image

Jira 8 Administration Cookbook - Third Edition

By: Patrick Li

Overview of this book

Jira is a project management tool used widely by organizations to plan, track, and release software. Jira administrators are at the heart of these processes and need to know how to successfully administer and customize Jira offerings. This updated Jira 8 Administration Cookbook demonstrates how to efficiently work with Jira Core and Jira Service Desk. The book starts with a variety of recipes to help you manage users and workflows. You'll learn how to set up custom forms and capture important data with custom fields and screens. Next, you'll gain insights into the latest email capabilities, which will assist you with everything from managing outgoing email rules to processing incoming emails for automated issue creation. Later, you'll be guided through running scripts to automate tasks, getting easy access to logs, and even working with tools to troubleshoot problems. The book will also ensure you understand how to integrate Jira with Slack, set up SSO with Google, and delegate administrator permissions. Finally, a dedicated section on Jira Service Desk will enable you to set up and customize your own support portal, work with internal teams to solve problems, and achieve optimized services with Service Level Agreement (SLA). By the end of this book, you'll have the skills you need to extend and customize your Jira implementation effectively.
Table of Contents (11 chapters)

Installing Jira for production use

In this recipe, we will look at how to install and set up Jira in a production environment. This includes setting up a dedicated user to run Jira under and using an external database.

We will use the archive distribution since the steps are consistent across both the Windows and Linux platforms. This will also provide you with an insight into the exact steps required to get a Jira instance deployed and running; these would otherwise be hidden by an automated installer. This will provide you with the information needed for subsequent maintenance and further configurations.

Getting ready

The following things need to be checked before you begin with this recipe:

How to do it...

We first need to create an empty MySQL database for Jira:

  1. Open up a new Command Prompt on the MySQL server.
  1. Run the following command (you can also use another user instead of root as long as the user has permission to create new users and databases):
mysql -u root -p
  1. Enter the password for the user when prompted.
  2. Create a new database for Jira by running the following command:
create database jiradb character set utf8;
  1. Create a new user for Jira in the database and grant the user access to the jiradb database we just created using the following command:
grant all on jiradb.* to 'jirauser'@'localhost'
identified by  'jirapassword';
  1. In the previous five steps, we created a new database named jiradb and a new database user named jirauser. We will use these details later to connect Jira with MySQL. The next step is to install Jira.
  2. Create a dedicated user account to run Jira under. If you're using Linux, run the following command as root or with sudo:
useradd --create-home --comment "Dedicated
Jira account" -- shell /bin/bash jira
It is good practice to reduce security risks by locking down the user account so that it does not have login permissions.
  1. Create a new directory on the filesystem where Jira will be installed. This directory will be referred to as JIRA_INSTALL.
  2. Create another directory on the filesystem. This will be used for Jira to store its attachments, search indexes, application data, and other information. You can create this directory on a different drive with more hard disk capacity, such as a network drive (this could slow down performance). This directory will be referred to as JIRA_HOME.
It is good practice to keep the JIRA_INSTALL and JIRA_HOME directories separate; that is, the JIRA_HOME directory should not be a subdirectory inside JIRA_INSTALL. This will make future upgrading and maintenance easier.
  1. Unzip the Jira archive file in the JIRA_INSTALL directory.
  2. Change both the JIRA_INSTALL and JIRA_HOME directories' owner to the new Jira user.
  3. Open the JIRA_INSTALL/atlassian-jira/WEB-INF/classes/jira-application.properties file in a text editor.
  4. Locate the jira.home= line in this file.
  5. Copy and paste this in the full path to the JIRA_HOME directory and remove the # symbol if present. Make sure you use the forward slash (/). The following line shows how it looks on a Linux system:
jira.home=/opt/data/jira_home 
Windows uses the backward slash (\) in the file path. You should still use the forward slash (/) while specifying the jira.home directory.
  1. Copy the database driver JAR file (obtained from the Getting ready section) to the JIRA_INSTALL/lib directory.
  2. Start up Jira by running the start-jira.sh (for Linux) or start-jira.bat (for Windows) script from the JIRA_INSTALL/bin directory as the Jira user. You should see the output, Tomcat, started in your console; this means that Jira is up and running.
  1. Jira comes with a setup wizard that will help guide us through the final phase of the installation.
  2. Open up a browser and go to http://localhost:8080 (replace localhost with the actual server name). By default, Jira runs on port 8080. You can change this by changing the connector port value in the JIRA_INSTALL/conf/server.xml file.
  3. The first step in setup is to select how you want Jira to be set up. Select the I'll set it up myself option and click on the Next button:
  1. The second step is to set up database information. Select the My Own Database (recommended for production environments) option.
  2. Select a value for the Database Type option. For this recipe, select the MySQL 5.7+ option.
  1. Enter the details for our new jiradb database:
  1. Click on Test Connection to check whether Jira is able to connect to the database.
  2. Click on the Next button to proceed if the database connection test is successful and move to the next step of the wizard.
  3. Enter the Application Title value for this Jira instance.
  4. Select Public if you would like to let people sign up for accounts, or Private if you want only administrators to create accounts. Most organizations that use Jira to track internal projects will require Private mode.
  5. Set the Base URL option. The base URL is the one that users will use to access Jira. Usually, this should be a fully qualified domain name or the hostname—that is, not localhost or an IP address.
  1. Click on Next to go to the third step of the wizard, as shown in the following screenshot:
  1. Enter your Jira license key if you have one. If you do not have a license key, you can generate a temporary trial license by clicking the Generate a Jira trial license link and following the instructions.
  2. Click on Next to go to the fourth step in the wizard, as shown in the following screenshot:
  1. Enter the details for the initial administrator account. The user account will have access to all the configuration options in Jira, so make sure you do not lose its login credentials.
  2. Click on Next to go to the fifth and final step of the wizard, as shown in the following screenshot:
  1. Choose whether you want to set up an outgoing SMTP server Now or Later. If you do not have an SMTP server ready right now, you can always come back and configure it later.
  2. Click on Finish to complete the setup process.

You will see the following Welcome! screen:

This ends the general configuration part of the setup process. Your Jira system is up and running. Next, Jira will walk you through its onboarding process as a first-time user. You will be asked to select the default language to use, upload a user avatar, and create your very first project.

There's more...

By default, Jira is set to use a maximum of 768 MB of memory. For a production deployment, you might need to increase the amount of memory allocated to Jira. You can increase this by opening up the setenv.sh (on Linux) or setenv.bat (on Windows) files in the JIRA_INSTALL/bin directory and changing the value of the JVM_MAXIMUM_MEMORY parameter.

For example, if we want to set the maximum memory to 2 GB, we will change it to JVM_MAXIMUM_MEMORY="2048m". You will need to restart Jira after performing this change. For production uses, it is recommended that you allocate at least 4 GB (4096 MB) of memory to the Jira JVM. Make sure you have sufficient physical memory available on your server first.

If you are using LDAP for user management in your organization, refer to the Integrating with LDAP for authentication only recipe in Chapter 4, User Management.

Detailed steps for downloading the code bundle are mentioned in the Preface of this book. Please have a look. The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Jira-8-Administration-Cookbook-Third-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!