remya5151
Posts: 10
Joined: Fri Mar 08, 2013 6:58 am

installing tomcat and deploying war file

hi
i need for make an installer for my web application.for this how your product can be used? i need to use tomcat web application or enterprise?
i have two scenarios
one is

1 install the war file to a remote tomcat server . installer will ask the tomcat url, username and password and will deploy the war file to that server
2. restart the server
3. lanuch the website
other is

1. install tomcat in the system if not available
2. deploy the war file
3. restart the server
4. lanuch the website

please help me to do this?
Thanks
Remya
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: installing tomcat and deploying war file

Hello Remya,

In order to achieve what you want you can use our "Tomcat Web Application" installer template. Also, please note that the "Tomcat Web Application" template will create an "Enterprise" project type too.
1 install the war file to a remote tomcat server . installer will ask the tomcat url, username and password and will deploy the war file to that server
I'm afraid I don't fully understand your scenario. Can you give us more details about this (maybe exemplify)? Normally, the installation package it is deployed in a local installation folder. However, if the current installing user has permissions to access a network path, then you should be able to install your war file to a network path. Also, you can take a look on our "Network browser" thread which could be useful for you.
2. restart the server
In order to achieve this you can create your own custom action. For example, you can write a BAT file which will restart the Tomcat server and launch it using a "Launch file or open URL" custom action.
3. lanuch the website
In order to achieve this you can launch your application URL on [Finish] button. Just go to "Dialogs" page -> "ExitDialog" and select [Finish] button. In the "Finish Actions" tab check "Launch application at the end of installation" option and add your application URL like this:

Code: Select all

http://localhost:8080/file.html
Also, you can add a "Launch file or open URL" custom action without sequence like this:

Code: Select all

Command: http://localhost:8080/file.html
and run it on a button push.
1. install tomcat in the system if not available
2. deploy the war file
For this you can add our "Apache Tomcat" predefined prerequisite to your project. Then, you should add the war file in "Files and Folders" page.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
remya5151
Posts: 10
Joined: Fri Mar 08, 2013 6:58 am

Re: installing tomcat and deploying war file

Hi Daniel,
Thanks for your reply.
if i put the war file "Files and Folders" page, then how it will get deployed in tomcat.and also i need to start to start tomcat server and launch the site in browser after installation. how this can be done?
Thanks
Remya
sudheerkosuru
Posts: 4
Joined: Thu Mar 07, 2013 7:18 am

Re: installing tomcat and deploying war file

Hi remya

In order to run your application you need place your war file in tomcat../webapps folder,so you need to search and identify webapps folder.
1.Go to Search-->Click on [ New Search Wizard ] toolbar button,follow wizard with next button

a) Select option search for file type and set a name provided in text-box below(ex:TOMCAT_WEBAPPS)and click on next.

b)provide the name of folder as webapps and beside option In a specific folder click on folder,a new window pops-up with Target Computer and folders in it,select program files and change depth to 6 or 7 and click on next and follow wizard,it will also provide a option to validate search of folder.if everyt thng goes well u should get succes or failure status.

2.Go to File and Folders option,right click in component listing folders in Target Computer,In the Dialog window select New Folder-->property based,This should open a new dialog box with user Define properties ,with listed (TOMCAT_WEBAPPS) select property and click on OK.

3.Now TOMCAT_WEBAPPS is listed in second component under Target Computer,select and Place your war file.

4.Go to Install Parameters,Under Installation Folders,beside Application Folder click on EDIT and replace value by select [TOMCAT_WEBAPPS] Folder.

Thus while installing your setup file check for webapps folder and places application war file in tomcat ..webapps folder in target machine.

Regards
Sudheer Kosuru
Attachments
for step 4
for step 4
3.png (162.16 KiB) Viewed 7265 times
dialog box for step 2
dialog box for step 2
2.png (174.32 KiB) Viewed 7265 times
dialog box for 1.b
dialog box for 1.b
1.png (17.09 KiB) Viewed 7265 times
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: installing tomcat and deploying war file

Hello Remya,
if i put the war file "Files and Folders" page, then how it will get deployed in tomcat.
As sudheerkosuru mentioned in the above post you can create a folder search in "Files and Folders" page which will search for tomcat folder on target machine. Then, on "Files and Folders" page you can add a property-based folder using the search associated property.
and also i need to start to start tomcat server
In order to achieve this you can add the Tomcat Windows Service Installer package as a prerequisite to your package. Also, you can take a look on our "Tomcat Service" thread which debates a similar issue.
and launch the site in browser after installation.
In order to achieve this, as I already mentioned in my previous post, you can go to "Dialogs" page -> "ExitDialog" and select [Finish] button. In the "Finish Actions" tab check "Launch application at the end of installation" option and add your application URL like this:

Code: Select all

http://localhost:8080/file.html
All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”