If you are using Tomcat as the application server, there are some configuration items you can set to improve performance. This is mainly setting Tomcat to run in server mode and increasing the amount of memory available to Tomcat e.g. so that jobs don't run out of memory.
If Tomcat was installed as a service
Note:
ART_HOME\WEB-INF\work
, ART_HOME\js-templates
and ART_HOME\WEB-INF\thymeleaf
directories.If Tomcat is run from a batch file
Create a file named setenv.bat in the TOMCAT_HOME\bin directory (or edit it if it exists) and set the configuration options in the JAVA_OPTS environment variable e.g.
set JAVA_OPTS=-server -Xmx1024m
Create a file named setenv.sh in the TOMCAT_HOME/bin directory (or edit it if it exists) and set the configuration options in the JAVA_OPTS environment variable e.g.
export JAVA_OPTS="-server -Xmx512m"
You can use the Apache HTTP Server as a front end to your application that resides on Tomcat. This can be done for a number of reasons, including clustering or enabling access to the application from a more familiar url.
There are a number of ways to run Tomcat behind Apache.
Ensure the following lines in your Apache httpd.conf file are uncommented
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so
Add an item at the end of the httpd.conf file to indicate how ART will be accessed by users and how Apache will communicate with Tomcat e.g
ProxyPass /art http://localhost:8080/art ProxyPassReverse /art http://localhost:8080/art
That's it. Start Apache and Tomcat (the order of starting and stopping doesn't matter), and now you can access ART from the url localhost/art (i.e <apache-server>/art
).
If you have Apache 2.2 and above, you can use mod_proxy_ajp
Ensure the following lines in your Apache httpd.conf file are uncommented
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so
Ensure you have an AJP connector defined in the TOMCAT_HOME\conf\server.xml file e.g.
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
Add an item at the end of the httpd.conf file to indicate how ART will be accessed by users and how Apache will communicate with Tomcat e.g
ProxyPass /art ajp://localhost:8009/art ProxyPassReverse /art ajp://localhost:8009/art
Note that this definition uses the ajp protocol and port 8009, which is the port defined for the AJP connector in Tomcat's server.xml
That's it. Start Apache and Tomcat (the order of starting and stopping doesn't matter), and now you can access ART from the url localhost/art (i.e <apache-server>/art
).
If you need more powerful proxying features, you can download, configure and use the mod_jk connector. This is slightly more involving than the other two methods already mentioned and you can use the instructions available at http://www3.ntu.edu.sg/home/ehchua/programming/howto/ApachePlusTomcat_HowTo.html to get it working.
Note:
For Ubuntu/Debian, instead of using LoadModule to enable the modules, use a2enmod from the command line, e.g.
a2enmod proxy_ajp a2enmod proxy a2enmod proxy_http
Also for Ubuntu/Debian, add the ProxyPass and ProxyPassReverse items to the apache2.conf file instead of httpd.conf.
Discussion: ART Error: Connection to the ART Repository is not available.