Installation
Java Installation.
Setting Environment Variable:
- export JAVA_HOME=<Location of Java SDK install folder.>
- export PATH=$JAVA_HOME/bin:$PATH
ANT Installation.
Setting Environment Variable:
- export ANT_HOME=<Location of ANT install folder.>
- export PATH=$ANT_HOME/bin:$PATH
Set MCS_HOME
- export MCS_HOME=<Location of MCS Install Directory>
- Also source $MCS_HOME/setenv.sh
Tomcat Setup (5.5)
- export CATALINA_OPTS=-Dmcs.home=$MCS_HOME.
Build configuration
- In $MCS_HOME build.xml file
Set the tomcat.dir property <property name="tomcat.dir" value="<location-where-tomcat-is-installed>" />
Axis2 (1.4.x) Installation.
Setting Environment Variable:
- export AXIS2_HOME=$lt;Location of Axis download folder.>
- export PATH=$AXIS2_HOME/bin:$PATH
Setting Classpath
- export CLASSPATH= .:$AXIS2_HOME/lib/activation-1.1.jar:$AXIS2_HOME/lib/axiom-api-1.2.7.jar:$AXIS2_HOME/lib/axiom-impl-1.2.7.jar:$AXIS2_HOME/lib/axis2-adb-1.4.1.jar:$AXIS2_HOME/lib/axis2-kernel-1.4.1.jar:$AXIS2_HOME/lib/geronimo-stax-api_1.0_spec-1.0.1.jar:$AXIS2_HOME/lib/XmlSchema-1.4.2.jar:$AXIS2_HOME/lib/backport-util-concurrent-3.1.jar:$AXIS2_HOME/lib/neethi-2.0.4.jar:$AXIS2_HOME/lib/wstx-asl-3.2.4.jar:$AXIS2_HOME/lib/commons-httpclient-3.1.jar:$AXIS2_HOME/lib/commons-codec-1.3.jar:$AXIS2_HOME/lib/wsdl4j-1.6.2.jar:$MCS_HOME/lib/mcs-client.jar:$AXIS2_HOME/lib/log4j-1.2.15.jar:$AXIS2_HOME/lib/commons-logging-1.1.1.jar:$CLASSPATH
MYSQL Classpath
- cp <Path to MYSQL JDBC Type 4 Driver>.jar to $CATALINA_HOME/common/lib
Apache Database Connection Pool
- cp $MCS_HOME/lib/commons-*.jar $CATALINA_HOME/common/lib
Compiling MCS
- cd $MCS_HOME
- ant compile
Deploying the Service.
- ant deploy
- Restart the Tomcat Server.
Building Client JAR
- ant client-jar
Changing the MCS Properties file. ($MCS_HOME/etc/mcs.properties)
- Set mcs.rest.serviceurl to the URL of the deployed webservice.
- Set mcs.db.host to the hostname or IP of the machine hosting the database.
- Set mcs.db.user to the database user name.
- Set mcs.db.pass to the database password.
- Set transport-protocol to https if using secured transport, http otherwise.
- Set port to the port number of Tomcat server on which SSL has been enabled.
- certificate.type to type of certificate
- certificate.path Path to certificate file.
- certificate.password Password to access certificate file.
- Optionally specify values for trustore type, file, password.
Security Setup
$CATALINA_HOME/conf/server.xml
- <Connector acceptCount="100" clientAuth="want" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="8443" scheme="https" secure="true" sslProtocol="TLS" keystoreFile="Path-To-KeyStore-File" keystorePass="Password-Of-KeyStore-File" truststoreFile=" Path-To-KeyStore-File " truststorePass=" Password-Of-KeyStore-File" />
Note: Trust Store attributes are optional.
Importing an existing key and certificate in a key store
The Key tool utility does not allow importing existing certificates into a key store.
To import existing key and certificate in a key store we have provided a utility code.
1. Convert the certificate and key file in to DER format using following commands.
openssl pkcs8 -topk8 -inform PEM -in key.pem -outform DER -nocrypt -out key.der openssl x509 -in -inform PEM -out -outform DER
2. Run the server utility as follows
java edu.isi.pegasus.mcs.common.util.ServerKeystoreBuilder
The utility creates a new key store file at the location.