jirainstallation

Embed Size (px)

Citation preview

  • 8/6/2019 jirainstallation

    1/6

    Installing JIRAIn the following exercise, we will be installing and configuring a fresh JIRA instance that will beready for production. We will be basing our installation on a Windows platform.

    In this exercise, we will:1. Install a fresh instance of JIRA.

    2. Configure JIRA to an enterprise relational database.

    3. Configure JIRA as a service so it will start automatically with the system.

    We will continue to use this JIRA instance in our subsequent chapters and exercis es as we buildup our help desk implementation.

    For our implementation, we will be using:

    JIRA WAR-EAR distribution 4.3.4

    MySQL 5

    Java Development Kit 6 Microsoft Windows XP

    Installing JavaJIRA requires Java Development Kit (JDK) version 6 update 10 or higher to run. It is important tonote that some systems come with Java Runtime Environment (JRE), which is different andinsufficient to run JIRA. If you already have a JDK installed, you can skip this section.

    To install JDK onto your system, simply carry out the following steps:

    1. Download the latest JDK from http://www.oracle.com/technetwork/java/javase/downloads/jdk6-jsp-136632.html.

    2. Double-click on the downloaded installation file to start the installation wizard.3. Select where you would like to install Java, or you can simply accept the default values.

    The location where you install JDK will be referred to as JAVA_HOME for the rest of thebook.

    4. Create a new environmental variable named JAVA_HOME with the value of where you

    installed Java.

    5. Test the installation by typing the following command in a new command prompt:

    javaversion

    This will display the version of Java installed.

  • 8/6/2019 jirainstallation

    2/6

    Installing MySQLThe next step is to prepare an enterprise database for our JIRA installation.

    To install MySQL, simply follow the steps below:

    1. Download MySQL from: http://dev.mysql.com/downloads.

    2. Double-click on the downloaded installation file to start the installation wizard.3. Click on Next on the welcome screen.4. Select the Typicalsetup option on the next screen. If you are an experienced database

    administrator, you can choose to customize your installation. Otherwise, just accept thedefault values for all subsequent screens.

    5. Once the installation is completed, make sure you check the Configure MySQLServer

    nowoption and click on Finish. This will bring up the MySQLconfigurationwizard.

    6. From the MySQL configuration wizard, select StandardConfiguration.

    7. 8. Check both the Install As WindowsService and Include Bin Directoryin Windows

    PATHoptions on the next screen. This will make MySQL startup when the system starts

    up and also allow you to run the MySQL command line tools directly.

    8. Configure the MySQL root user password. The username will be root.9. Click on Execute on the next screen and MySQL will start applying the configuration

    options.

  • 8/6/2019 jirainstallation

    3/6

    ConfiguringMySQL

    Now that we have MySQL installed, it is time to create a database for JIRA.1. Start a new command prompt.2. Issue the command below to connect to MySQL:

    mysql u root -p

    3. When prompted for password, enter the password you chose during configuration. Thiswill bring up the interactive shell for MySQL.

    4. Issue the command below to create a database:create database jiradb character set utf8;

    5. Here we are creating a database calledjiradb. You can name the database to anything youlike. As we will see later in this chapter, this name will be referenced when we connect

    JIRA to MySQL. We have also set the database to use UTF8 character encoding, as this isa requirement for JIRA. You need to ensure that the database is using the InnoDB storageengine to avoid data corruption.

    6. Issue the following command:grant all on jiradb.* to 'jirauser'@'localhost' identified by 'jirauser';

    7. Here we are doing several things. First, we have created a user called jirauserand assignedthe password jirauserto the user. You can, change the username and password tosomething else.

    8. We have also granted all privileges to the user for the database jiradbwe have just createdso the user can perform database operations such as create/ drop tables, and

    insert/delete data. If you have named your database to something other than jiradb instep 3, make sure you change the command so it uses your database name.

    9. This allows us to control the fact that only authorized users (specified in the precedingcommand) are able to access the JIRA database to ensure data security and integrity.

    10. To verify our setup, exit the current interactive session by issuing the followingcommand:

    quit;

    11. Start a new interactive session with our newly created user:mysql u jirauser p

    12. You will be prompted for jirauser's password, which we have set up in our previouscommand as jirauser.

    13. Issue the command:show databases;

    14. This will list all the databases that are currently accessible by the logged in user. Youshould see jiradbamongst the list of databases.

    15. Examine the jiradb database by issuing the following commands:usejiradb;showtables;

    16.The first command connects us to the jiradbdatabase, so all of our subsequent commands

    will be executed against the correct database.

  • 8/6/2019 jirainstallation

    4/6

    Installing JIRAWith the JDK and database prepared, we can now move on to install JIRA.

    Configuring JIRA application properties1. Download Atlassian JIRA from http://www.atlassian.com/software/jira/JIRADownloadCenter.jspa

    The Atlassian website will detect the operating system you are using and automaticallysuggest the installation package for you to download. If you intend to install JIRA on adifferent operating system than the one you are currently on, make sure you select thecorrect operating system package.

    2. As mentioned earlier, with Windows, there is a Windows installer package and self -extracting ZIP package. For the purpose of our exercise, we will be using the self-extracting option as this will provide us with an insight o f the steps usually hidden byinstallation programs To access the ZIP option, click on the Showalllink to the right-hand side.

    3. Unzip the downloaded file to your intended JIRA_INSTALL directory.

    4. Open JIRA_INSTALL\atlassian-jira\WEB-INF\classes\jira-application.propertiesfile in a text editor.

    6. Locate the following line:#jira.home =

    7. Fill in the full path to your JIRA_HOME directory and save the file.

    jira.home = C:/JIRA_HOME

    8. Make sure that you remove the # at the front and use forward slashes (/) instead of

    backward slashes (\).

    Database Connection

    JIRA needs to be told what type of database you'll be using. The database is specified

    in $JIRA_INSTALL/edit-webapp/WEB-INF/classes/entityengine.xml . Locate

    the tag near the bottom, and change the field-type-name attribute value:

    Possible values include cloudscape, db2, firebird, hsql, mckoidb, mysql, mssql, oracle,

    postgres, postgres72, sapdb, and Sybase

    Note : Ifnot usingHSQLDB remove: schema -name="PUBLIC"

    Also in entityengine.xml , ensure the ... tag contains:

  • 8/6/2019 jirainstallation

    5/6

    Build JIRA

    Now build JIRA by typing build (Windows) or ./build.sh (Unix) on the command line in

    the $JIRA_INSTALL directory. This will produce the deployable WAR file in

    the$JIRA_INSTALL/dist-tomcat directory.

    Update Tomcat Libraries

    Tomcat does not come with some libraries required to run JIRA. To fix this, download

    http://www.atlassian.com/software/jira/downloads/binary/jira-jars-tomcat-

    distribution-4.3-tomcat-5x.zip

    and copy the contained jars to Tomcat's common/lib/ directory. Be sure to remove

    existing versions of these JAR before copying the new ones.

    Configure Tomcat

    A JIRA 'context' now needs to be set up in Tomcat. To do this:

    1. Copy dist-tomcat/tomcat-5.5/jira.xml from the built JIRA distribution to your

    Tomcat's conf/Catalina/localhost/directory.

    2. Customise the copied jira.xml as follows:

    3. If using a different database than hsql,

    1. copy the JDBC driver jar to common/lib/2. ensure you have updated the field-type-name.

    Start Tomcat

    JIRA should now be ready to run in Tomcat. To start using JIRA, first start(or restart) the Tomcat server with Tomcat's bin/startup.(sh|bat) scripts,and point your browser to http://localhost:8080/jira You should now see the Setup Wizard, which will take you through the brief

    setup procedure.

  • 8/6/2019 jirainstallation

    6/6

    Troubleshooting

    Problem ; java.lang.OutOfMemoryError: Java heap spac eSoln; Create a file setenv.bat in tomcat/bin folder if not exi st and copythe below line.

    set CATALINA_OPTS=%CATALINA_OPTS% -

    Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Xms128m -Xmx512m -XX:MaxPermSize=256m