<< Connect to MySql from Eclipse || Homepage || Create a Bare Minimum Configuration Test Application >>

  1. Set up Maven and Tomcat from Apache
    1. Open the zipped files
    2. Prepare system variables
      1. What's all that for?
    3. Configurations
      1. TomCat Administrator Account
      2. TomCat Server port
      3. Start it up
    4. Next steps

Set up Maven and Tomcat from Apache

The purpose of these next steps is to establish a WWW server for our content. That’s TomCat, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use Maven. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat.

Please download the following items Maven 2.2.1 (Binary zip) & Apache Tomcat 6.0.32 (Binary zip).

(If those links fail for some reason, you may have to go to the respective download pages at Apache Maven Project or Apache Tomcat).

Open the zipped files

Unzip the files to wherever you please. This guide assumes you put them in E:\programs\org\apache like this :

Prepare system variables

Open the Windows System Properties option sheet like this :

— select the “Advanced” tab, and the “Environment Variables” button

— We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files E:\programs\org\apache\apache-maven-2.2.1 in this case. Be sure to omit any quotation marks around the path even if it contains spaces.

— add the CATALINA_HOME variable in the system variables with the path to your unzipped files E:\programs\org\apache\apache-tomcat-6.0.32 in this case.

— if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files E:\programs\com\oracle\java\jdk in this case. More complete instructions are on the Get the project into Eclipse Wiki page.

— add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value -Xms256m -Xmx512m. This environment variable can be used to supply extra options to Maven. -Dfile.encoding=UTF-8 forces all created web pages to use the optimum character set for web work. -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render solves a severe memory management problem in 64-bit Windows.

These settings should work for you: -Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render

— To make it easy to get to the MOWa project directory create a variable named MOWA_HOME and for give the value supply the path of the top-level directory of the package you extracted from subversion. (E:\projects\ontology, in the case of this guide.)

— Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be %MOWA_HOME%\meta\.m2\repository.

So, in the project you checked out of subversion, in the directory meta, create subdirectories like this (Windows Explorer won’t let you do it, so you have to open a command line):

(Don’t close the Environment Variables option sheet yet, we’re still going to need it.)

C:\>e:
E:\projects>mkdir %MOWA_HOME%\meta\.m2
E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository
E:\projects>cd %M2_REPO%
E:\projects\ontology\meta\.m2\repository>

The result should look like this :

Now all reference to the Maven repository can be through the variable %M2_REPO%.

However, since that stuff will not be version controlled, we must tell Tortoise to ignore it:

Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml. In Windows, variables are referred to like this variable. Within any of Maven’s configurations files, variables are referred to by a structure like this ${variable}. Environment variables are referred to by a structure like this ${env.variable}.

So, to get at the M2_REPO variable, we use this : ${env.M2_REPO}

— add the binary executables directories of all three of the following Java %JAVA_HOME%\bin, Maven %M2_HOME%\bin and TomCat %CATALINA_HOME%\bin to the system variable Path. The inserted text should look like this:

%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;

— open a Windows command line window and check your work with each of these commands :

dir %JAVA_HOME%\bin\java.exe /B /S
dir %CATALINA_HOME%\bin\startup.bat /B /S
dir %M2_HOME%\bin\mvn /B /S

java -version
catalina version
mvn --version

(NOTE: inconsistent minus signs? They really are that way. Yes.)

The result should look like this:

What’s all that for?

What you’ve done is register, in a central place, the locations of these important components so they know how to find each other.

Configurations

We’re not done yet. Now we need to do some configurations.

TomCat Administrator Account

You can’t do much with TomCat until you have set up an administrator account:

You need two lines like these in the configuration file:

<role rolename="manager"/>
<user username="mowa_user" password="someDumbPWord" roles="manager"/>

You’ll find the configuration file here:

%CATALINA_HOME%\conf\tomcat-users.xml

The result should look like this:

TomCat Server port

WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we’ll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won’t be using that. Instead, to avoid collisions with other services, we’ll use 8765.

You’ll need to change Catalina’s standard connector port from 8080 to 8765.

<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>

The file to edit is %CATALINA_HOME%\conf\server.xml

The end-result should look like this:

Start it up

In TomCat’s bin directory you run the startup.bat command in the bin directory :

E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup

It opens a second window (here, the green one) and shows you its initialization steps.

(You can close the first window, it is no longer necessary. Try typing shutdown in it, though. That’s how to stop TomCat, when you need to.)

_An aside : _

I think it is a really bad idea to use those specific command names: startup and shutdown. To avoid collisions with other stuff in a machine I change the names from startup.bat and shutdown.bat to tcstart.bat and tcstop.bat

To check that everything is healthy, go to this URL :

http://rest.mowa.justtrade.net:8765/

You should see this:

Click on the link TomCat Manager in the side-bar on the left, and then supply the manager user name and password you used above in the file %CATALINA_HOME%\conf\tomcat-users.xml :

<user username="mowa_user" password="someDumbPWord" roles="manager"/>

You should see something like this :

When you have entered those credentials correctly this ought to appear:

Next steps

In the next Guide we’ll Create a Bare Minimum Configuration Test Application.

<< Connect to MySql from Eclipse || Homepage || Create a Bare Minimum Configuration Test Application >>

Set up Maven and Tomcat is a public wiki page

This wiki page is a public wiki page. It can be read by anyone including users that have not logged in and web crawlers such as Google.

Entry has no comments

You do not have sufficient permissions to comment

7 years ago
hasan.bramwell picture
hasan.bramwell updated Wiki Set up Maven and Tomcat

Text: << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >> {toc} h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. In Windows, variables are referred to like this %variable%. Within any of Maven's configurations files, variables are referred to by a structure like this @${variable}@. Environment variables are referred to by a structure like this @${env.variable}@. So, to get at the M2_REPO variable, we use this : @${env.M2_REPO}@ !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the @startup.bat@ command in the @bin@ directory : @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) An aside : bq). I really think it is a bad idea to use those specific command names startup and shutdown. To avoid collisions with other stuff in a machine I change the names from startup.bat and shutdown.bat to tcstart.bat and tcstop.bat !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application]. << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >><< [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >> {toc} h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. In Windows, variables are referred to like this %variable%. Within any of Maven's configurations files, variables are referred to by a structure like this @${variable}@. Environment variables are referred to by a structure like this @${env.variable}@. So, to get at the M2_REPO variable, we use this : @${env.M2_REPO}@ !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the @startup.bat@ command in the @bin@ directory : @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) _An aside : _ bq). I think it is a really bad idea to use those specific command names: @startup@ and @shutdown@. To avoid collisions with other stuff in a machine I change the names from @startup.bat@ and @shutdown.bat@ to @tcstart.bat@ and @tcstop.bat@ !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application]. << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Set up Maven and Tomcat

Text: << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >> {toc} h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. In Windows, variables are referred to like this %variable%. Within any of Maven's configurations files, variables are referred to by a structure like this @${variable}@. Environment variables are referred to by a structure like this @${env.variable}@. So, to get at the M2_REPO variable, we use this : @${env.M2_REPO}@ !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application]. << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >><< [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >> {toc} h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. In Windows, variables are referred to like this %variable%. Within any of Maven's configurations files, variables are referred to by a structure like this @${variable}@. Environment variables are referred to by a structure like this @${env.variable}@. So, to get at the M2_REPO variable, we use this : @${env.M2_REPO}@ !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the @startup.bat@ command in the @bin@ directory : @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) An aside : bq). I really think it is a bad idea to use those specific command names startup and shutdown. To avoid collisions with other stuff in a machine I change the names from startup.bat and shutdown.bat to tcstart.bat and tcstop.bat !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application]. << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Set up Maven and Tomcat

Text: << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >> h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. In Windows, variables are referred to like this %variable%. Within any of Maven's configurations files, variables are referred to by a structure like this @${variable}@. Environment variables are referred to by a structure like this @${env.variable}@. So, to get at the M2_REPO variable, we use this : @${env.M2_REPO}@ !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application]. << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >><< [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >> {toc} h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. In Windows, variables are referred to like this %variable%. Within any of Maven's configurations files, variables are referred to by a structure like this @${variable}@. Environment variables are referred to by a structure like this @${env.variable}@. So, to get at the M2_REPO variable, we use this : @${env.M2_REPO}@ !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application]. << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Set up Maven and Tomcat

Text: << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >> h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application]. << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >><< [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >> h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. In Windows, variables are referred to like this %variable%. Within any of Maven's configurations files, variables are referred to by a structure like this @${variable}@. Environment variables are referred to by a structure like this @${env.variable}@. So, to get at the M2_REPO variable, we use this : @${env.M2_REPO}@ !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application]. << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Set up Maven and Tomcat

Text: h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application].<< [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >> h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application]. << [Connect to MySql from Eclipse] || [Homepage] || [Create a Bare Minimum Configuration Test Application] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Set up Maven and Tomcat

Text: h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (you can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408!h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (You can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408! h2. Next steps In the next Guide we'll [Create a Bare Minimum Configuration Test Application].

hasan.bramwell picture
hasan.bramwell updated Wiki Set up Maven and Tomcat

Text: h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408!h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. (you can close the first window, it is no longer necessary. Try typing @shutdown@ in it, though. That's how to stop TomCat, when you need to.) !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408!

hasan.bramwell picture
hasan.bramwell updated Wiki Set up Maven and Tomcat

Text: h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408!h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! Last of all, Maven needs to know NOT to use the default location, so you must edit the settings file at @E:\programs\org\apache\apache-maven-2.2.1\conf\settings.xml@. !http://www.xp-dev.com/file/6415! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408!

hasan.bramwell picture
hasan.bramwell updated Wiki Set up Maven and Tomcat

Text: h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6413! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408!h1. Set up Maven and Tomcat from Apache The purpose of these next steps is to establish a WWW server for our content. That's *TomCat*, an application server. Packaging up a Web ARchive (WAR) file manually, for an application server is too inefficient. Instead we use *Maven*. It collects together all the necessary bits and pieces, both locally and from around the Internet, assembles the WAR file and deploys it to TomCat. Please download the following items "Maven 2.2.1 (Binary zip)":http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip & "Apache Tomcat 6.0.32 (Binary zip)":http://mirror.nyi.net/apache/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip. (If those links fail for some reason, you may have to go to the respective download pages at "Apache Maven Project":http://maven.apache.org/index.html or "Apache Tomcat":http://tomcat.apache.org/index.html). h2. Open the zipped files Unzip the files to wherever you please. This guide assumes you put them in @E:\programs\org\apache@ like this : !http://www.xp-dev.com/file/6332! h2. Prepare system variables Open the Windows System Properties option sheet like this : !http://www.xp-dev.com/file/6317! p. -- select the "Advanced" tab, and the "Environment Variables" button !http://www.xp-dev.com/file/6318! !http://www.xp-dev.com/file/6319! !http://www.xp-dev.com/file/6320! p. -- We neeed to indicate where Maven was installed. Add a M2_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-maven-2.2.1@ in this case. _Be sure to omit any quotation marks around the path even if it contains spaces._ !http://www.xp-dev.com/file/6321! p. -- add the CATALINA_HOME variable in the system variables with the path to your unzipped files @E:\programs\org\apache\apache-tomcat-6.0.32@ in this case. !http://www.xp-dev.com/file/6323! p. -- if it is not already present and showing the correct value, add or correct the JAVA_HOME variable in the system variables with the path to your unzipped files @E:\programs\com\oracle\java\jdk@ in this case. More complete instructions are on the [Get the project into Eclipse] Wiki page. !http://www.xp-dev.com/file/6335! p. -- add the MAVEN_OPTS environment variable in the system variables to specify JVM properties, e.g. the value @-Xms256m -Xmx512m@. This environment variable can be used to supply extra options to Maven. @-Dfile.encoding=UTF-8@ forces all created web pages to use the optimum character set for web work. @-XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ solves a severe memory management problem in 64-bit Windows. These settings should work for you: @-Dfile.encoding=UTF-8 -Xms256m -Xmx512m -XX:CompileCommand=exclude,org/apache/velocity/runtime/directive/Foreach,render@ !http://www.xp-dev.com/file/6322! p. -- To make it easy to get to the MOWa project directory create a variable named @MOWA_HOME@ and for give the value supply the path of the top-level directory of the package you extracted from subversion. (@E:\projects\ontology@, in the case of this guide.) !http://www.xp-dev.com/file/6413! p. -- Maven keeps local copies of artifacts it collects up around the Internet, for fulfilling external dependencies in your project. You need to tell it where to put them, because you are going to want to refer to that location from within your projects. The environment variable name must be M2_REPO, and we want to put it with the meta stuff, so the variable value should be @%MOWA_HOME%\meta\.m2\repository@. !http://www.xp-dev.com/file/6414! So, in the project you checked out of subversion, in the directory @meta@, create subdirectories like this (Windows Explorer won't let you do it, so you have to open a command line): (Don't close the Environment Variables option sheet yet, we're still going to need it.) @C:\>e:@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2@ @E:\projects>mkdir %MOWA_HOME%\meta\.m2\repository@ @E:\projects>cd %M2_REPO%@ @E:\projects\ontology\meta\.m2\repository>@ The result should look like this : !http://www.xp-dev.com/file/6411! Now all reference to the Maven repository can be through the variable @%M2_REPO%@. However, since that stuff will not be version controlled, we must tell Tortoise to ignore it: !http://www.xp-dev.com/file/6412! p. -- add the binary executables directories of all three of the following Java @%JAVA_HOME%\bin@, Maven @%M2_HOME%\bin@ and TomCat @%CATALINA_HOME%\bin@ to the system variable @Path@. The inserted text should look like this: @%JAVA_HOME%\bin;%M2_HOME%\bin;%CATALINA_HOME%\bin;@ !http://www.xp-dev.com/file/6324! p. -- open a Windows command line window and check your work with each of these commands : @dir %JAVA_HOME%\bin\java.exe /B /S@ @dir %CATALINA_HOME%\bin\startup.bat /B /S@ @dir %M2_HOME%\bin\mvn /B /S@ @java -version@ @catalina version@ @mvn --version@ (NOTE: inconsistent minus signs? They really are that way. Yes.) The result should look like this: !http://www.xp-dev.com/file/6396! h3. What's all that for? What you've done is register, in a central place, the locations of these important components so they know how to find each other. h2. Configurations We're not done yet. Now we need to do some configurations. h3. TomCat Administrator Account You can't do much with TomCat until you have set up an administrator account: You need two lines like these in the configuration file: @<role rolename="manager"/>@ @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You'll find the configuration file here: @%CATALINA_HOME%\conf\tomcat-users.xml@ The result should look like this: !http://www.xp-dev.com/file/6400! h3. TomCat Server port WWW servers serve HTML pages to human beings. But this is going to be a Semantic Web server serving semantically consistent resources to other systems, including our own WWW server that we'll want to set up in later steps. Port 80 is the standard networking access port for WWW service. We won't be using that. Instead, to avoid collisions with other services, we'll use 8765. You'll need to change Catalina's standard connector port from 8080 to 8765. @<Connector port="8765" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>@ The file to edit is @%CATALINA_HOME%\conf\server.xml@ The end-result should look like this: !http://www.xp-dev.com/file/6402! h3. Start it up In TomCat's bin directory you run the startup command: @E:\programs\org\apache\apache-tomcat-6.0.32\bin>startup@ It opens a second window (here, the green one) and shows you its initialization steps. !http://www.xp-dev.com/file/6401! To check that everything is healthy, go to this URL : @http://rest.mowa.justtrade.net:8765/@ You should see this: !http://www.xp-dev.com/file/6406! Click on the link @TomCat Manager@ in the side-bar on the left, and then supply the manager user name and password you used above in the file @%CATALINA_HOME%\conf\tomcat-users.xml@ : @<user username="mowa_user" password="someDumbPWord" roles="manager"/>@ You should see something like this : !http://www.xp-dev.com/file/6407! When you have entered those credentials correctly this ought to appear: !http://www.xp-dev.com/file/6408!

hasan.bramwell picture
hasan.bramwell updated Wiki Set up Maven and Tomcat

View View full history