← All posts

Debian. Installing and Configuring Jira + GreenHopper

Jira logo

Today I’ll explain how to install the standalone version of Jira (the one listed on the Jira website as the “Download” version) on your server. I chose Debian because it is harder to get the latest Java, which Jira really needs, running on FreeBSD. I didn’t consider other distributions simply because Debian is easier for me to work with.

I’ll also be using MySQL as Jira’s DBMS. This is because it lets you hack Jira’s data later on—for example, rename users and so on—using procedures that I may cover in another article.

This article covers Jira 5.0.4.

Installation

I’ll be installing this on a fresh, minimal Debian installation, so I’ll also install the necessary software, such as nano and sudo. Let’s also create a “Downloads” directory in the home directory, where we’ll put our downloads:


apt-get install sudo nano
mkdir ~/Downloads

Now let’s add the DotDeb repository, since it has more up-to-date packages:


sudo nano /etc/apt/sources.list
>> deb http://packages.dotdeb.org squeeze all
>> deb-src http://packages.dotdeb.org squeeze all

Now let’s download the key for DotDeb and apply it:


cd ~/Downloads
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | sudo apt-key add -

Let’s install MySQL Server version 5.5 and Nginx:


sudo apt-get update
sudo apt-get install mysql-server-5.5 nginx

Choose the Jira version you need on this page and download the binary to the “~/Downloads” directory.
Since I’m running a 32-bit Linux platform, I download the binary I need like this:


cd ~/Downloads
wget http://wpc.29c4.edgecastcdn.net/8029C4/downloads/software/jira/downloads/atlassian-jira-5.0.4-x32.bin
sudo chmod +x atlassian-jira-5.0.4-x32.bin

Let’s create the directories for Jira:


mkdir -p /opt/atlassian/jira
mkdir -p /var/atlassian/application-data/jira

Now let’s run the binary and start installing Jira itself:


./atlassian-jira-5.0.4-x32.bin

>>> Unpacking JRE ...
>>> Starting Installer ...
>>> You do not have administrator rights to this machine and as such, some installation options will not be available. Are you sure you want to continue?
>>> Yes [y, Enter], No [n]
y

>>> This will install JIRA 5.0.4 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) [1], Custom Install (recommended for advanced users) [2], Upgrade an existing JIRA installation [3, Enter]
2

>>> Where should JIRA 5.0.4 be installed?
>>> [/home/adw0rd/atlassian/jira]
/opt/atlassian/jira

>>> Default location for JIRA data
>>> [/home/adw0rd/atlassian/application-data/jira]
/var/atlassian/application-data/jira

>>> Configure which ports JIRA 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]
1

>>> Extracting files ...
...

>>> Please wait a few moments while JIRA starts up.
>>> Launching JIRA ...
>>> Installation of JIRA 5.0.4 is complete
>>> Your installation of JIRA 5.0.4 is now ready and can be accessed via your browser.
>>> JIRA 5.0.4 can be accessed at http://localhost:8080
>>> Finishing installation ...

After installation, we need an init script. I wrote a small script that you’re welcome to use:


sudo wget -O /etc/init.d/jira /files/jira
sudo chmod +x /etc/init.d/jira

Configuration

Now let’s create a database and configure access permissions for Jira:


mysql -uroot -p

mysql> CREATE DATABASE `jira` CHARSET utf8 COLLATE utf8_general_ci;
mysql> SELECT PASSWORD('example');
+-------------------------------------------+
| password('example')                       |
+-------------------------------------------+
| *57237BB49761F29AB9724BA084E811D70C12393D |
+-------------------------------------------+
1 row in set (0.00 sec)
mysql> GRANT USAGE ON *.* TO 'jira'@'localhost' IDENTIFIED BY PASSWORD '*57237BB49761F29AB9724BA084E811D70C12393D';
mysql> GRANT ALL PRIVILEGES ON `jira`.* TO 'jira'@'localhost';
mysql> SHOW GRANTS FOR jira@localhost;
+-------------------------------------------------------------------------------------------------------------+
| Grants for jira@localhost                                                                                   |
+-------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'jira'@'localhost' IDENTIFIED BY PASSWORD '*57237BB49761F29AB9724BA084E811D70C12393D' |
| GRANT ALL PRIVILEGES ON `jira`.* TO 'jira'@'localhost'                                                      |
+-------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

Edit “nginx.conf”:


sudo nano /etc/nginx/nginx.conf

To look like this:


http {
    ...
    upstream jira {
        server 127.0.0.1:8080;
    }
    ...
    server {
        listen 80;
        server_name example.org;
        location / {
            proxy_pass http://jira;
        }
    }
    ...
}

Next, let’s edit Jira’s configuration:


sudo nano /opt/atlassian/jira/conf/server.xml

Find “Service/Connector” there and add “proxyName” and “proxyPort”:


...
    <Service name="Catalina">
        ...
        <Connector port="8080"
                   maxThreads="150"
                   minSpareThreads="25"
                   maxSpareThreads="75"
                   connectionTimeout="20000"
                   proxyName="example.org"
                   proxyPort="80"
                   enableLookups="false"
                   maxHttpHeaderSize="8192"
                   protocol="HTTP/1.1"
                   useBodyEncodingForURI="true"
                   redirectPort="8443"
                   acceptCount="100"
                   disableUploadTimeout="true"/>
        ...
    ...
...

Restart Jira to apply the new configuration:


sudo /etc/init.d/jira restart

Now try opening “http://example.org/". You’ll be prompted to configure Jira. Specify “MySQL” as the storage type and enter the correct access credentials, after which you’ll be prompted to set up the administrator account and so on.

Installing GreenHopper

To do this, simply go into UPM (“http://example.org/plugins/servlet/upm#install") and type “GreenHopper” into the search bar. You can install any other plugins available in the Jira repository in the same way.

A Few More Words

After purchasing, you need to enter the Jira license key on the “http://example.org/secure/admin/ViewLicense!default.jspa", page, and the GreenHopper key in UPM.

If you entered the wrong “Base URL” (in our example, it is “http://example.org”), you can change it on the “http://example.org/secure/admin/ViewApplicationProperties.jspa" settings page.

Comments are closed. Read the original discussion in Russian →