Deployment runthrough on Windows » History » Version 10

Chris Cannam, 2014-09-30 10:56 AM

1 1 Chris Cannam
h1. Deployment runthrough on Windows
2 1 Chris Cannam
3 5 Chris Cannam
This is an example deployment on a 32-bit Windows 7 host.
4 1 Chris Cannam
5 5 Chris Cannam
See [[Deployment runthrough]] for a typical Linux deployment.
6 5 Chris Cannam
7 5 Chris Cannam
See [[Deployment troubleshooting]] for notes about Java and Tomcat versions and on things that might go wrong.
8 5 Chris Cannam
9 1 Chris Cannam
h2. 1. Obtain the current code from Mercurial repository
10 3 Chris Cannam
11 1 Chris Cannam
I use "EasyMercurial":http://easyhg.org/ as my Windows Mercurial client. Use "Open" -> "Remote repository" and provide @https://code.soundsoftware.ac.uk/hg/human-echolocation-java-webapp@ as the remote repository URL, cloning to a folder called @human-echolocation-java-webapp@ in my Documents folder. (See "screenshot":/attachments/download/1182/Screenshot%20-%20300914%20-%2008_51_01.png.)
12 3 Chris Cannam
13 1 Chris Cannam
h2. 2. Install the MATLAB Compiler Runtime
14 1 Chris Cannam
15 5 Chris Cannam
Navigate to http://www.mathworks.co.uk/products/compiler/mcr/ and find the download URL. (I am using release R2013b here.) Download and run the installer, accepting its default installation path of @C:\Program Files\MATLAB\MATLAB Compiler Runtime@.
16 5 Chris Cannam
17 6 Chris Cannam
h2. 3. Install Java and Tomcat
18 6 Chris Cannam
19 10 Chris Cannam
Navigate to http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html to download (in our case) Java 7 JDK. Run the installer and install to the default path.
20 1 Chris Cannam
21 10 Chris Cannam
Now make sure the JAVA_HOME environment variable points to the JDK just installed, and not to the JRE runtime (this is necessary for use of the Ant build tool later). To do this, go to the Windows Control Panel, search for "environment" and open the environment variable dialog. Add a new user environment variable setting JAVA_HOME to the JDK location. (See screenshot)
22 10 Chris Cannam
23 8 Chris Cannam
Navigate to http://tomcat.apache.org/ and download the "32-bit/64-bit Windows Service installer" for (in our case) Tomcat 7. Again we accept the default path (@C:\Program Files\Apache Software Foundation\Tomcat 7.0@). Note that the installer asks you to set a username and password for the Tomcat administrator login -- this is optional, but it will save some configuration later if you set a password now. (See "screenshot":/attachments/download/1183/Screenshot%20-%20300914%20-%2010_05_03.png)
24 9 Chris Cannam
25 1 Chris Cannam
When installation is complete, you will be given the option to start Tomcat -- accept it. You should then be able to open the URL @http://127.0.0.1:8080/manager/html@ in a browser to see the Tomcat manager page. You will be asked for a username and password to access it -- these should be the same ones you provided during installation.
26 10 Chris Cannam
27 10 Chris Cannam
h2. 4. Bring dependent JAR files into the webapp folder
28 10 Chris Cannam
29 10 Chris Cannam
Copy @C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\servlet-api.jar@ and @C:\Program Files\MATLAB\MATLAB Compiler Runtime\v82\toolbox\javabuilder\jar\javabuilder.jar@ into the @human-echolocation-java-webapp@ folder.
30 10 Chris Cannam
31 10 Chris Cannam
h2. 5. Install Apache Ant
32 10 Chris Cannam
33 10 Chris Cannam
Ant is the tool used to build the webapp project. (One could install an entire development environment such as Eclipse, as well, but that is beyond the scope of this page!)
34 10 Chris Cannam
35 10 Chris Cannam
Navigate to http://ant.apache.org/bindownload.cgi and download the Zip archive of the current version of Ant.
36 10 Chris Cannam
37 10 Chris Cannam
38 10 Chris Cannam
39 10 Chris Cannam
h2. 6. Build the WAR file bundle