h3. * *
# *- Configure
- tomcat-users.xml
*
Open - $
\- {CATALINA_HOME}/conf/tomcat-users.xml
- with
- a
- text
- editor.
Create the following 2 uses:
{code}- Create the following 2 uses:
Code Block |
---|
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<user username="script" password="XXXXXXXX" roles="manager-script"/>
<user username="gui" password="YYYYYYYY" roles="manager-gui"/>
|
{code}
*•* The *script* user will be used to deploy your application to the Tomcat server.
*•* The *gui* user will be used to access the Tomcat Manager.
\\
{color:red}Be sure to change the passwords to passwords of your choice.{color}
When you are satisified that everything is correct, save your changes.
# *Install the - • The script user will be used to deploy your application to the Tomcat server.
• The gui user will be used to access the Tomcat Manager. Be sure to change the passwords to passwords of your choice. When you are satisified that everything is correct, save your changes. - Install the ojdbc6-11.2.0.3.jar
*
Install - the
- ojdbc6-11.2.0.3.jar
- in
- either
- the
- $
\- {CATALINA_HOME}/lib
- or
- the
- $
\- {CATALINA_HOME}/common/lib
- directory.
The - The ojdbc6-11.2.0.3.jar
- has
- to
- go
- into
- only
- one
- directory.
\\
\\
If you do not have the -
If you do not have the ojdbc6-11.2.0.3.jar, - you
- can
[- download
- the
- ojdbc6-11.2.0.3.jar
| ^ojdbc6-11.2.0.3.jar] - now
- and
- save
- it
- to
- your
- workstation.
# *Configure
Anchor |
---|
| Configure context.xml |
---|
| Configure context.xml |
---|
|
- Configure context.xml
*
Open - $
\- {CATALINA_HOME}/conf/context.xml
- with
- a
- text
- editor.
## For -
- For non-Windows
- systems,
- change
- the
- <context>
- tag
- to
- the
- following:
{
} |
---|
<Context crossContext="true" useHttpOnly="false">
|
{code}
- For
- Windows
- systems,
- change
- the
- <context>
- tag
- to
- the
- following"
{
} |
---|
<Context antiResourceLocking="true" crossContext="true" useHttpOnly="false">
|
{code}
{note}
By setting *antiResourceLocking* to true, Tomcat will prevent any file locking. This will significantly impact startup time of applications, but allows full webapp hot deploy and undeploy on platforms or configurations where file locking can occur. If not specified, the default value is false.
\\
\\
Please note that setting this to true has some side effects, including the disabling of JSP reloading in a running server: see Bugzilla 37668.
\\
\\
Please note that setting this flag to true in applications that are outside the appBase for the Host (the webapps directory by default) will cause the application to be deleted on Tomcat shutdown. You probably don't want to do this, so think twice before setting antiResourceLocking=true on a webapp that's outside the appBase for its Host.
{note}
{note}
By default, *Tomcat 7 sets HttpOnly to false on all session cookies*. This prevents any client side script from accessing the session ID.
DWR uses the session cookie (and the session ID) to protect against cross site scripting attacks. With HTTPOnly set to false, DWR will start popping up “CSRF Security Error” dialogs.
To prevent DWR from popping up “CSRF Security Error” dialogs, *useHttpOnly* must be set to *true*.
{note}
## Add the following Resource Definition anywhere between the <context> and </context> tags:
{code} Note |
---|
By setting antiResourceLocking to true, Tomcat will prevent any file locking. This will significantly impact startup time of applications, but allows full webapp hot deploy and undeploy on platforms or configurations where file locking can occur. If not specified, the default value is false.
Please note that setting this to true has some side effects, including the disabling of JSP reloading in a running server: see Bugzilla 37668.
Please note that setting this flag to true in applications that are outside the appBase for the Host (the webapps directory by default) will cause the application to be deleted on Tomcat shutdown. You probably don't want to do this, so think twice before setting antiResourceLocking=true on a webapp that's outside the appBase for its Host. |
Note |
---|
By default, Tomcat 7 sets HttpOnly to false on all session cookies. This prevents any client side script from accessing the session ID. DWR uses the session cookie (and the session ID) to protect against cross site scripting attacks. With HTTPOnly set to false, DWR will start popping up “CSRF Security Error” dialogs. To prevent DWR from popping up “CSRF Security Error” dialogs, useHttpOnly must be set to true. |
Anchor |
---|
| add a resource definition |
---|
| add a resource definition |
---|
|
- Add the following Resource Definition anywhere between the <context> and </context> tags:
Code Block |
---|
<Resource name="jdbc/MitsisDS"
auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@//earth-vault-2.mit.edu:1523/sundev11"
username="XXXXXXXX"
password="YYYYYYYY"
maxActive="20"
maxIdle="10"
maxWait="-1"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true" />
<ResourceLink global="jdbc/MitsisDS" name="jdbc/MitsisDS" type="javax.sql.DataSource"/>
|
{code}
{color:red}If your - If your project's
- JNDI
- name
- is
- something
- other
- than
*- MitsisDS
*- ,
- then
- you
- must
- change
*- MitsisDS
* - in
- the
- above
- to
- your
- project's
- JNDI
- name.
If you - If you don't
- know
- what
- JNDI
- name
- to
- use,
- your
- team
- leader
- can
- get
- it
- for
- you.
{color}
{color:red}Be sure to change the *username* and *password*.{color}
{note}
You can have more than 1 Resource Definition in your context.xml. The only restriction is that each Resource Definition must have a unique *name*. Also, for each new Resource Definition, you should also add a corresponding ResourceLink. [At the bottom of this page| #context.mxl example] is an example of a context that contains multiple Resource Definitions.
{note}
\\
When you are satisified that everything is correct, save the changes.
# *Configure setenv.bat* (setenv.bat is for Windows system.)
{color:red}For non-Windows systems use setenv.sh and convert the code below using the appropriate replacement for *set*.{color}
## Open $\ Be sure to change the username and password. Note |
---|
You can have more than 1 Resource Definition in your context.xml. The only restriction is that each Resource Definition must have a unique name. Also, for each new Resource Definition, you should also add a corresponding ResourceLink. At the bottom of this page is an example of a context that contains multiple Resource Definitions. |
When you are satisified that everything is correct, save the changes.
- Configure setenv.bat (setenv.bat is for Windows system.)
For non-Windows systems use setenv.sh and convert the code below using the appropriate replacement for set. - Open ${CATALINA_HOME}/bin/setenv.bat
- with
- a
- text
- editor.
If the - If the setenv.bat
- file
- does
- not
- exist,
- create
- it.
## - Add
- the
- following
- to
- setenv.bat:
{
} |
---|
set JAVA_HOME=/path/to/Java/jdk1.6.0_27
set PATH= |
"%PATH%;/path/to/maven/apache-maven-2.2.1/bin |
"
set MAVEN_OPTS=-Djavax.net.ssl.trustStore=/path/to/keystores/serverTrustStore.jks -Djavax.net.ssl.trustStorePassword=changeit
set CATALINA_OPTS=-Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.keyStorePassword=changeit -Djavax.net.ssl.trustStore=/path/to/keystores/serverTrustStore.jks -Djavax.net.ssl.keyStore=/path/to/keystores/registrar.jks -Dlogs.dir=${user.home}
set JAVA_OPTS=-server -Xmx1024m -Xms1024m -XX:MaxPermSize=1024m
echo MAVEN_OPTS=%MAVEN_OPTS%
echo CATALINA_OPTS=%CATALINA_OPTS%
echo JAVA_OPTS=%JAVA_OPTS%
|
{code}
- Be
- sure
- to
- change
- the
- following:
##* *
*
##* *
*
##* *
*
JKS.
{note}
FOR MAC USERS:
You can download a [MAC plugin for managing Environmental Variables | Install the Oracle OC4J 10.1.3.5 standalone server^RCEnvironment-1.4.X.dmg] to set the above environment variables.
{note)
# *Test the Tomcat installation*
## Open a cmd window, cd to $\
- Test the Tomcat installation
- Open a cmd window, cd to ${CATALINA_HOME}/bin
- and
- start
- the
- tomcat
- server.
## - Open
- a
- browse
- and
- go
- to
- the
- URL:
- http://localhost:8080/manager/html.
## - When
- prompted
- for
- the
- username
- and
- password,
- use
*- gui
* - for
- the
- user
- name
- and
- enter
- the
- password
- that
- you
- choose
- in
- Step
- 1
- above.
If
- everything
- was
- done
- correctly,
- you
- will
- have
- the
- following
- page
- displayed:
!tomcatManager002.jpg!
h4. {color:green}Configure Tomcat 7 is now complete{color}
Image Added
|