Run JIRA on Budget – JIRA + Varnish + VPS = $7/mo

jira

One of the main reasons why I like JIRA is its integration with BitBucket, the free Git repository service. Both JIRA and BitBucket are from Atlassian, the company behind many other great products. Recently I started using JIRA for all my project works. It works very well. JIRA has hosted version available for $10/month ( $20/mo with Agile addon ). Two reasons why I don’t like the hosted edition are

1. No support for custom URL. We have to use their subdomain ( such as https://something.atlassian.net )
2. Monthly recurring payment of $20.

Paying $20 for a project management tool with a total user base of one or two users, is waste of money. So I’ve decided to buy JIRA and host it on my own server. Atlassian offers JIRA server edition for $10 one time and JIRA Agile addon for another $10 onetime. So I purchased JIRA + Agile for $20. There is no monthly payment if you host JIRA on your own server. The next task was to get a VPS to install JIRA.

I have an account at Digital Ocean so I went ahead and created a droplet. My experiments with Digital Ocean‘s 512MB, 1GB, 2GB, 4GB RAM VPS confirmed that JIRA requires more than 2GB RAM to run smoothly. I was able to run JIRA on their 2Gig RAM server, but I was not quite satisfied with the performance. Another solution is to create a large virtual memory on the hard disk, but then I found a provider who offers more RAM that I ever need for JIRA.

I found VPSDIME providing 6GB RAM VPS for $7/month.

The VPS Specs are

4 vCPU
6GB Memory
30GB SSD HDD
2TB Traffic Limit
1Gbps Uplink
1 IP Address

Honestly, I am seeing this kind of configuration for a VPS for under $10/mo for the first time, so I have decided to give them a try. I’ve received my new VPS details and installed JIRA and MySQL
The VPS has CentOS 6.6

Install MySQL and setup a root password.

yum -y install mysql-server
/usr/bin/mysql_secure_installation

Next, you have to create a MySQL database and username.

mysql -u root -p

Once you are logged into MySQL console, run these queries

mysql> CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin;
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on jiradb.* TO 'USERNAME'@'localhost' IDENTIFIED BY 'PASSWORD';
mysql> flush privileges;
mysql> exit

Make sure you replace USERNAME and PASSWORD with a username and password of your choice.

Install JIRA. Note: At the time of writing this article, the latest version of JIRA is 6.4.1. For more versions , visit JIRA download page

wget https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-6.4.1-x64.bin
sh atlassian-jira-6.4.1-x64.bin

I’ve installed JIRA with all the default options. After installation, you would be able to access JIRA at http://serverIP:8080

As we are going to use MySQL, we need to install the MySQL Java connector

wget http://download.softagency.net/MySQL/Downloads/Connector-J/mysql-connector-java-5.1.35.zip
unzip mysql-connector-java-5.1.35.zip
cd mysql-connector-java-5.1.35
mv mysql-connector-java-5.1.35-bin.jar /opt/atlassian/jira/lib/

Note: If you are on a CentOS minimal, ‘unzip’ command may not be available. Install it using # yum -y install unzip then try again.

Finally start/restart JIRA

service jira stop
service jira start

Install Varnish
—————
Varnish in this case, serves two purposes. It helps us to open JIRA on port 80 and also caches the files on RAM.

rpm --nosignature -i https://repo.varnish-cache.org/redhat/varnish-3.0.el5.rpm
yum install varnish

Now, open the file /etc/varnish/default.vcl and change port to 8080

backend default {
  .host = "127.0.0.1";
  .port = "8080";
}

Now, make varnish to listen to port 80. Open file /etc/sysconfig/varnish

Set

VARNISH_LISTEN_PORT=80
VARNISH_STORAGE_SIZE=2G

Changing the storage size is completely optional. You may want to tweak it based on how many users you serve. For me, 2GB works fine. Finally start varnish

service varnish start
chkconfig varnish on

Now, open your browser and goto http://yourserverIP.com or http://someSubdomain.yourDomain.com and start installing and configuring your JIRA.

I do not want to use Varnish but still need to setup JIRA on port 80, is it possible?
Yes, it is possible to run JIRA on 80. I have tried multiple methods and the best one I’ve encountered is xinetd method.

As root

Install the xinetd package if it’s not already installed

yum install xinetd

Then create a file in “/etc/xinetd.d” to hold your redirect info
eg :”/etc/xinetd.d/jira”

The file should look like:

service http
{
     disable = no
     socket_type = stream
     user = root
     wait = no
     redirect = 127.0.0.1 8080
     log_type = FILE /tmp/jira_redirect
}

Then start xinetd

service xinetd start

Conclusion
JIRA is a powerful project management tool and bug tracker. By using JIRA on a high RAM server and with Varnish cache, you will certainly feel the difference and enjoy seeing JIRA running fast. Thanks to VPSDIME for providing excellent VPS service for low cost. Using their VPS, I am able to use JIRA for $7/month + ( $10 onetime JIRA license )

2 thoughts on “Run JIRA on Budget – JIRA + Varnish + VPS = $7/mo

Leave a Reply

Your email address will not be published.