Top Page

How to deploy your web application

UTGB Shell has the embedded web server, so there is no need to read descriptions in this page if you just want to browse web server on your desktop PCs. This page is writtein for administrators of server machines who try to run UTGB applications using Apache and Tomcat web servers.

Install Tomcat Web Server

Web applications generated by UTGB shell is writeen in Java. So, you have to install Tomcat (http://tomcat.apache.org/), which is a web server for web applications written in Java. Tomcat version 5.5.26 or higher is recommended. See the installation instruction here: http://www.xerial.org/trac/Xerial/wiki/WebApplication/Tomcat

Install SQLite JDBC

Web applications generated by UTGB shell use SQLite JDBC database driver. Because of the problem described here, you have to manually install SQLite JDBC to the Tomcat.

  • First, download sqlite-jdbc-3.5.9.jar.
  • Put the jar file into (TOMCAT_HOME)/lib folder. (for Tocmat 6.x)

Set up Tomcat Manger

In order to deploy your web application generated by UTGB Shell, you have to set up tomcat-manager's account in the (TOMCAT_HOME)/conf/tomcat-users.xml file:

  • (TOMCAT_HOME)/!conf/tomcat-users.xml
  • <?xml version='1.0' encoding='utf-8'?>
    <tomcat-users>
      <role rolename="manager"/>
      <role rolename="admin"/>
      <user username="tomcat-admin" password="pass" roles="admin,manager"/>
    </tomcat-users>
  • Then, restart the tomcat to load the above configuration change.

Create settings.xml file

Next, you have to create !.m2/settings.xml file in your home directory:

  • (HOME)/!.m2/settings.xml
  • <settings>
     <servers>
      <server>
        <id>tomcat</id>
        <username>tomcat-admin</username>
        <password>pass</password>
       </server>
     </servers>
    </settings>
  • In this file, write the same usernamae and password described in the tomcat-users.xml file.

Deploy Your Web Application to the Tomcat

Now, you are ready to install your web browser. Type utgb deploy in your project folder. Suppose that your web application name is 'myapp' (which is generated by 'utgb create myapp' command):

> cd myapp
> utgb deploy

Then, access the http://localhost:8080/myapp

How to use both Apache and Tomcat servers simultaneously

  • In short, Add the follwoing settings in your Apache's configuration file, httpd.conf (which is usually placed at /etc/httpd/conf/httpd.conf):

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so 

ProxyPass /myapp ajp://localhost:8009/myapp
ProxyPassReverseCookiePath / /

With this configuration, web accesses to !http://(your hostname)/!myapp are internally redirected to the Tomcat server (!http://localhost:8080/!myapp) as if !http://(your hostname)/!myapp is the true web address for the web user.