To run Elastic COBOL programs as web applications, we first need to install a Web Application Server. For this example we are going to use Apache Tomcat 7 which can be downloaded and installed for free.
Using CATALINA_BASE: /home/pi/tomcat7 Using CATALINA_HOME: /home/pi/tomcat7 Using CATALINA_TMPDIR: /home/pi/tomcat7/temp Using JRE_HOME: /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt Using CLASSPATH: /home/pi/tomcat7/bin/bootstrap.jar:/home/pi/tomcat7/bin/tomcat-juli.jar
You should now be able to access Tomcat's management console by entering the following into your browser:
Use the web.xml file (the application's deployment descriptor) that is attached to this article to create a copy on your Raspberry Pi.
$ cp /tmp/web.xml WEB-INF
$ jar cf register.war register.html register.cbl WEB-INF
This creates a WAR (Web application ARchive) application package that can be deployed to Tomcat.
Deploying & Executing the Application Package
$ cp register.war $HOME/tomcat7/webapps
This will "hot deploy" the application to Tomcat.
Installation of the application will take a minute or so. You will know that the application has been successfully deployed when the Tomcat management console lists the application as "Running" (true).
You should now be able to access the deployed application by entering the following in your browser:
This will display the web form that is going to invoke the Elastic COBOL register servlet.
You can fill out the form (required fields are in bold), or you can simply scroll down to the bottom of the form and click "Register Software". This will cause the COBOL servlet to process the empty form and report back:
You can click on "register.cbl" at the top of the page to view the application source in the browser.
If you want to shutdown your Tomcat server, do the following: