Sie sind auf Seite 1von 6

Installing JIRA

In the following exercise, we will be installing and configuring a fresh JIRA instance that will be ready 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 build up 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 Java
JIRA requires Java Development Kit (JDK) version 6 update 10 or higher to run. It is important to note that some systems come with Java Runtime Environment (JRE), which is different and insufficient 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 -jsp136632.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 the book. 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:
java version

This will display the version of Java installed.

Installing MySQL
The next step is to prepare an enterprise database for our JIRA installation. To install MySQL, simply follow the steps below: 1. 2. 3. 4. Download MySQL from: http://dev.mysql.com/downloads. Double-click on the downloaded installation file to start the installation wizard. Click on Next on the welcome screen. Select the Typical setup option on the next screen. If you are an experienced database administrator, you can choose to customize your installation. Otherwise, just accept the default values for all subsequent screens. Once the installation is completed, make sure you check the Configure MySQL Server now option and click on Finish. This will bring up the MySQL configuration wizard. From the MySQL configuration wizard, select Standard Configuration. 8. Check both the Install As Windows Service and Include Bin Directory in Windows PATH options 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. Configure the MySQL root user password. The username will be root. Click on Execute on the next screen and MySQL will start applying the configuration options.

5.
6.

7.

8. 9.

Configuring MySQL 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. This will bring up the intera ctive 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 called jiradb. You can name the database to anything you like. 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 is a requirement for JIRA. You need to ensure that the database is using the InnoDB storage engine 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 jirauser and assigned the password jirauser to the user. You can, change the username and password to something else. 8. We have also granted all privileges to the user for the database jiradb we have just created so 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 in step 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 preceding command) 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 following command:
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 previous command as jirauser. 13. Issue the command:
show databases;

14. This will list all the databases that are currently accessible by the logged in user. You should see jiradb amongst the list of databases. 15. Examine the jiradb database by issuing the following commands:
use jiradb; show tables;

16. The first command connects us to the jiradb database, so all of our subsequent commands
will be executed against the correct database.

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

Configuring JIRA application properties


1. Download Atlassian JIRA from http://www.atlassian.com/software/ jira/JIRADownloadCenter.jspa The Atlassian website will detect the operating system you are using and automatically suggest the installation package for you to download. If you intend to install JIRA on a different operating system than the one you are currently on, make sure you select the correct 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 selfextracting option as this will provide us with an insight o f the steps usually hidden by installation programs To access the ZIP option, click on the Show all link to the righthand side. 3. Unzip the downloaded file to your intended JIRA_INSTALL directory. 4. Open JIRA_INSTALL\atlassian-jira\WEB-INF\classes\jira-application.properties file 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 <datasource> 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 : If not using HSQLDB remove: schema-name="PUBLIC"
Also in entityengine.xml , ensure the <transaction -factory>...</transaction factory> tag contains: <transaction -factory class="org.ofbiz.core.entity.transaction.JNDIFactory"> <user-transaction -jndi jndi -server-name="default" jndiname="java:comp/env/UserTr ansaction"/> <transaction -manager-jndi jndi-server-name="default" jndiname="java:comp/env/UserTransaction"/> </transaction -factory>

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-tomcatdistribution-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:
<Context path="/jira" docBase="path/to/atlassian -jira-3.13.war"> <Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource" username="jiraus er" password="mypassword" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/jiradb?useUnicode=true&amp;characterEncoding =UTF8" maxActive="20" validationQuery="select 1"/> <Resource name="UserTransaction" auth="Contai ner" type="javax.transaction.UserTransaction" factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/> <Manager pathname=""/> </Context> 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.

Troubleshooting Problem ; java.lang.OutOfMemoryError: Java heap spac e Soln; Create a file setenv.bat in tomcat/bin folder if not exi st and copy the below line. set CATALINA_OPTS=%CATALINA_OPTS% Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true Dmail.mime.decodeparameters=true -Xms128m -Xmx512m -XX:MaxPermSize=256m

Das könnte Ihnen auch gefallen