การติดตั้ง Marmoset
เนื้อหา
SubmitServer
ให้ทำตามคู่มือ marmoset จนกระทั่งสั่งติดตั้ง ant production.install จากนั้นให้คัดลอกไฟล์ต่าง ๆ เอง ดังนี้:
ตัวอย่าง Config ที่แก้
server.xml
--- server.xml 2010-08-19 22:45:13.000000000 +0700
+++ /etc/tomcat6/server.xml 2010-09-18 07:09:01.600653343 +0700
@@ -22,9 +22,9 @@
<Server port="8005" shutdown="SHUTDOWN">
<!--APR library loader. Documentation at /docs/apr.html -->
- <!--
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
- -->
+
+
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
@@ -80,11 +80,12 @@
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
- <!--
+
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
+ keystoreFile="/etc/tomcat6/ssl/marmosetKeystore"
+ keystorePass="PASSWORD"
clientAuth="false" sslProtocol="TLS" />
- -->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
@@ -131,6 +132,9 @@
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
+<Context path="" docBase="submitServer" debug="0"
+reloadable="true"/>
+
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
web.xml
แก้ตามในคู่มือ marmoset
--- web.xml 2009-05-14 06:15:14.000000000 +0700
+++ /etc/tomcat6/web.xml 2010-09-17 17:57:26.155673917 +0700
@@ -1191,4 +1191,26 @@
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
+
+<context-param>
+ <param-name>authentication.service</param-name>
+ <param-value>edu.umd.cs.submitServer.GenericStudentPasswordAuthenticationService</param-value>
+</context-param>
+<context-param>
+ <param-name>database.server.jdbc.url</param-name>
+ <param-value> jdbc:mysql://localhost/submitserver</param-value>
+</context-param>
+<context-param>
+ <param-name>database.user</param-name>
+ <param-value>MYSQLUSER</param-value>
+</context-param>
+<context-param>
+ <param-name>database.password</param-name>
+ <param-value>MYSQLPASSWORD</param-value>
+</context-param>
+<context-param>
+ <param-name>database.driver</param-name>
+ <param-value>com.mysql.jdbc.Driver</param-value>
+</context-param>
+
</web-app>
policy.d/04webapps.policy
ควรต้องตั้ง permission ให้ดีกว่านี้
--- policy.d/04webapps.policy 2010-08-19 22:45:11.000000000 +0700
+++ /etc/tomcat6/policy.d/04webapps.policy 2010-09-18 00:29:59.447935207 +0700
@@ -5,6 +5,9 @@
// In addition, a web application will be given a read FilePermission
// and JndiPermission for all files and directories in its document root.
grant {
+ // this is for testing
+ permission java.security.AllPermission;
+
// Required for JNDI lookup of named JDBC DataSource's and
// javamail named MimePart DataSource used to send mail
permission java.util.PropertyPermission "java.home", "read";
ขั้นตอนที่ต้องระวัง
- ต้องคัดลอกไฟล์ .war และ .jar เอง อย่าลืมคัดลือก log4j.jar ใส่ใน /usr/share/tomcat6/lib ด้วย
- เพื่อให้ log4j เก็บค่าได้ ต้องตั้ง permission
- ติดตั้ง SSL:
- ดูขั้นตอนเพิ่มเติมที่ http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html ใช้ APR
- mysql driver