The AGTEK WebApps are written as a web application using the Apache Tomcat application server. The web app hosts a REST api that the browser side portion can use to interact with the AGTEK Access server. Initial deployments of the AccessWeb app are likely to be deployed on a separate AWS EC2 instance, which might be behind a load balancer, or may include several instances to assist shouldering the load.
Configuring the deployment environment is picky enough that a detailed recipe is required to be successful. This page details that configuration. Note that this does NOT discuss the development environment, nor does it does where you will obtain the AccessWeb.war application image.
Because of the intertwined nature of some of these packages, you may need to revisit some configurations a couple of times.
wget https://dl.eff.org/certbot-auto chmod a+x certbo-auto
JAVA_HOME=/home/ec2-user/jdk1.8.0_144 export JAVA_HOME JRE_HOME=$JAVA_HOME export JRE_HOME PATH=$JAVA_HOME/bin:$PATH export PATH TOMCAT_HOME=/home/ec2-user/apache-tomcat-9.0.0.M26 export TOMCAT_HOME
get-certs
script to /home/ec2-user (from the AccessWeb GIT repository /tools directory)chmod a+x get-certs
Tomcat needs to have a few configuration files modified prior to execution.
conf/server.xml
to create a port 80 connector:<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" />
conf/server.xml
to create a port 443 connector:<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true"> <SSLHostConfig> <Certificate certificateKeystoreFile=".keystore" certificateKeystorePassword="accessweb" certificateKeyAlias="tomcat" type="RSA" /> </SSLHostConfig> </Connector>
conf/web.xml
to add some security restrictions (toward end of the file):<!-- AGTEK SETTING --> <security-constraint> <web-resource-collection> <web-resource-name>Entire Application</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <!-- auth-constraint goes here if you requre authentication --> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
The script get-certs
is used to register the app server with letsencrypt.
This script create the Tomcat keystore, fetch the certificate and install it into the
Tomcat keystore. Run the script:
./get-certs
Once the Tomcat configuration has done, and this step has been done you should be able to run Tomcat. Note: You need to also install AccessWeb.war.
For the pourposes of this document, we're assuming you are setting up “test.agtek.com”.