Tomcat 6
Tomcat 6
This section explains how to deploy Elastic Path web applications on a Tomcat 6 production server.
Note: Before you begin
Make sure that:
- A Java 7 JDK or JRE is installed.
- Oracle Weblogic 11g is installed.
- You have the Web Application .WAR files that were specifically built for Weblogic. For more information, see Elastic_Path_Maven_Commands.html#BuildingWARFiles.
- You have synchronized the date and time of all application servers with the date and time of your database server.
Installing Java Advanced Imaging
If you are using Storefront, you must install Java Advanced Imaging into your production server's JDK as detailed below:
- Go to: http://download.java.net/media/jai/builds/release/1_1_3/
- Download and unzip jai-1_1_3-lib.zip
- Copy the contents of JAI_HOME\lib to your Java_HOME\jre\lib\ext directory.
Creating a .keystore file
In order to use SSL on your production server, you must create a .keystore file.
- Open the command prompt and input the following command to begin creating the .keystore file.
keytool -genkey -alias ElasticPath -keyalg RSA
- Enter in a password, full name, organizational unit, organization, city, state, and country code when promoted.
- When prompted to enter a key password, press Return to generate the .keystore file in your home directory.
Configuring Tomcat
Configuring Startup Scripts
- In <Tomcat_HOME>\bin, open catalina.bat (catalina.sh for Linux) with a text editor.
- Modify JAVA_OPTS to include the following:
-Xmx1024m -XX:MaxPermSize=512m -Dsun.lang.ClassLoader.allowArraySyntax=true
Configuring Connectors
- With an XML editor, open server.xml located in <Tomcat_HOME>\conf
- In server.xml, replace the HTTP Connector element as shown below:
Before After <Tomcat_HOME>\conf\server.xml <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" acceptCount="100" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="150" URIEncoding="UTF-8"/commerce-legacy/>
- In server.xml, replace the SSL Connector element as shown below:
Before After <Tomcat_HOME>\conf\server.xml <!-- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" /> -->
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true" secure="true" enableLookups="false" disableUploadTimeout="true" keystoreFile="HOME\.keystore" keystorePass="PASSWORD" acceptCount="100" maxThreads="25" scheme="https" clientAuth="false" sslProtocol="TLS" URIEncoding="UTF-8"/commerce-legacy/>
where PASSWORD is the password you entered into the .keystore file and and HOME is your home directory.
Deploying Web Applications
Creating Context Files
- In <Tomcat_HOME>\conf, create a directory named Catalina
- Create a subdirectory in Catalina named after your hostname. ie. localhost
- For each web application you want to deploy:
- In your hostname subdirectory, create an xml file named <CONTEXT_PATH>.xml. We recommend using the following context paths:
Web Application
Context Path.xml Name
Cortex API
cortex
Cortex Studio studio - In <CONTEXT_PATH>.xml, insert the following code:
<?xml version='1.0' encoding='UTF-8'?> <Context> <Resource auth="Container" name="mail/Session" type="javax.mail.Session"/commerce-legacy/> <Resource name="jdbc/epjndi" auth="Container" scope="Shareable" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" removeAbandoned="true" username="USER" password="PASSWORD" driverClassName="DRIVER" url="JDBC_URL" /> </Context>
- Replace USER and PASSWORD with the information of an account that can access your database.
- Replace DRIVER with the JDBC Driver that corresponds to your DBMS and JDBC_URL with your Database Connection URL
- where HOSTNAME, PORT, DBNAME, and SID correspond to your specific database.
- In your hostname subdirectory, create an xml file named <CONTEXT_PATH>.xml. We recommend using the following context paths:
Deploying .WAR files
- Place the Web Application .WAR files in <Tomcat_HOME>\webapps
- Rename the copied .WAR file with its context path. For example, if you created storefront.xml, you rename the storefront WAR file to storefront.war.
Note: Deploy the Search Server to use Cortex Search
You must have the search server deployed and running to use Cortex API's search functionality.