This post is about the deployment of website in tomcat. The detail step describes as follows.
Step 1: Install mysql database.
Unzip the file MYSQL55·0·67.zip and install mysql. Configure the database charset and root's password.
Step 2: Install the management tool of mysql.
Unzip the file Navicat_for_MySQL_9.0.15.rar and install it.
Step 3: Restore the database.
3.1) Create the database xxx
3.2) In the management tool of mysql, select the database xxx and click the "new backup" button, then click the "new restore" button.
3.3) Browse the backup file ***.psc and restore it.
Step 4: Deploy the website.
Copy the folder "apache-tomcat-6.0.30" to your disk.
Step 5: modify the mysql connected password in your project.
Open the file "xxx\WEB-INF\classes\applicationContext.xml" and modify the password.
Step 6: Install the JDK6.
6.1) Click the executive file jdk-6u16-windows-i586.exe and install it.
6.2) Configure the environment path of java.
"C:\Program Files\Java\jdk1.6.0_16\bin"
Step 7: Configure the domain name.
Open the file "apache-tomcat-6.0.30\conf\server.xml" and add the following codes:
<Host name="xxx.com" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
-->
<!--
<Context docBase="C:\Program Files\apache-tomcat-6.0.30\webapps\dhulab" path="" reloadable="true" />
-->
</Host>
Step 8: Modify the port to 80.
Open the file "apache-tomcat-6.0.30\conf\server.xml" and modify it as follows:
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
Step 9: Repair the timeout problem of the mysql database.
Open the file "xxx\WEB-INF\classes\applicationContext.xml" and modify it as follows:
<property name="url" value="jdbc:mysql://localhost/xxx?autoReconnect=true&autoReconnectForPools=true"></property>
<property name="username" value="root"></property>
<property name="password" value="****"></property>
<property name="validationQuery" value="SELECT 1"/>
<property name="testOnBorrow" value="true"/>
Attention!: using the "&" to replace the "&".
Step 10: Start the tomcat.
Step 11: Browse your website in the browser.