Middlebury

Difference between revisions of "CAS Administration"

Line 1: Line 1:
 
Documentation about administering our CAS server infrastructure.
 
Documentation about administering our CAS server infrastructure.
  
= Setting up a development environment =
+
= Application Deployment =
 +
 
 +
== Setting up a development environment ==
 
* General
 
* General
 
** Install Apache Tomcat
 
** Install Apache Tomcat
 +
** Install the [http://dev.mysql.com/downloads/connector/j/3.1.htmll MySQL connector] JDBC driver
 
** Install Maven 2
 
** Install Maven 2
** Get the CAS source code
 
** build CAS with Maven
 
 
* [http://www.adamfranco.com/2009/06/19/setting-up-a-cas-development-on-os-x/ Setting up CAS development on OS X] - Adam's cheat-sheet for OS X.
 
* [http://www.adamfranco.com/2009/06/19/setting-up-a-cas-development-on-os-x/ Setting up CAS development on OS X] - Adam's cheat-sheet for OS X.
  
= Accessing the source code =
+
== Accessing the source code ==
  
 
Our CAS source-code is maintained as a "[https://wiki.jasig.org/display/CASUM/Maintaining+local+customizations+using+Maven+2 Maven overlay]" that includes just our customized files. All other (non-customized) files are automatically downloaded as part of the Maven build process.
 
Our CAS source-code is maintained as a "[https://wiki.jasig.org/display/CASUM/Maintaining+local+customizations+using+Maven+2 Maven overlay]" that includes just our customized files. All other (non-customized) files are automatically downloaded as part of the Maven build process.
Line 16: Line 17:
 
<pre>git clone git@chisel.middlebury.edu:midd-cas.git</pre>
 
<pre>git clone git@chisel.middlebury.edu:midd-cas.git</pre>
  
= Updating the source code =
+
Once you have cloned the Git repository, you should have a directory called <code>midd-cas</code>.
 +
 
 +
This directory contains the following files:
 +
* <code>README.txt</code>
 +
* <code>pom.xml</code> - The Maven configuration file. This tells Maven which version of CAS and each library to use and where to find them.
 +
* <code>src/</code> - contains our customized source-code and configuration files.
 +
* <code>target/</code> - the directory where maven will put the compiled <code>war</code> package.
 +
 
 +
=== Building/Running CAS ===
 +
 
 +
<pre>cd midd-cas/</pre>
 +
 
 +
==== Update the configuration if needed ====
 +
<pre>vim src/main/webapp/WEB-INF/deployerConfigContext.xml</pre>
 +
The configuration file committed to the Git repository on chisel is almost identical to the one in production. If you commit and push changes to this file, then update production, these changes will come through.
 +
 
 +
The current development configuration (in the source repository) refers to a database on chisel that holds the ticket registry and the services configuration. It is fine to continue to use this database if you wish. If not, you can configure another database. Look for the following lines at the bottom of the <code>deployerConfigContext.xml</code>:
 +
<pre>    <bean
 +
id="dataSource"
 +
class="org.apache.commons.dbcp.BasicDataSource"
 +
p:driverClassName="com.mysql.jdbc.Driver"
 +
 
 +
p:url="jdbc:mysql://chisel.middlebury.edu:3306/db_name?autoReconnect=true"
 +
p:password="password"
 +
p:username="username" />
 +
</pre>
 +
 
 +
==== Build the war package ====
 +
<pre>mvn clean package</pre>
 +
 
 +
==== Deploy the package ====
 +
Deploying the package involves stopping tomcat, then deleting the CAS files from its <code>webapps/</code> directory and putting the new <code>war</code> file in that directory. When tomcat is started, it will extract the various resources from the <code>war</code> file and run the application.
 +
 
 +
<pre>sudo tomcatctl stop
 +
sudo rm -R  /opt/local/share/java/tomcat5/webapps/cas*
 +
sudo cp target/cas.war /opt/local/share/java/tomcat5/webapps/cas.war
 +
sudo tomcatctl start
 +
</pre>
 +
 
 +
 
 +
== Updating the source code ==
 +
 
 +
 
 +
== Deploying in production ==
 +
 
 +
== Configuration ==
 +
 
 +
= Run-time Administration =
  
 +
== Allowed Services Configuration ==
  
= Deploying in production =
+
== Troubleshooting Errors ==
  
[[Category:CAS]]
+
= To-Do list =
 +
* [https://wiki.jasig.org/display/CASUM/EhcacheTicketRegistry Multicast Ticket Registry for high availability] - Currently the ticket-registry database is a single point of failure. Updating to a ticket-registry implementation that allows each CAS server to validate its peers without a single intermediary will help ensure high availability.

Revision as of 13:55, 9 May 2011

Documentation about administering our CAS server infrastructure.

Application Deployment

Setting up a development environment

Accessing the source code

Our CAS source-code is maintained as a "Maven overlay" that includes just our customized files. All other (non-customized) files are automatically downloaded as part of the Maven build process.

To get our CAS source code, clone from our central Git repository on chisel. (if you don't have access, send Adam Franco your ssh public key.)

git clone git@chisel.middlebury.edu:midd-cas.git

Once you have cloned the Git repository, you should have a directory called midd-cas.

This directory contains the following files:

  • README.txt
  • pom.xml - The Maven configuration file. This tells Maven which version of CAS and each library to use and where to find them.
  • src/ - contains our customized source-code and configuration files.
  • target/ - the directory where maven will put the compiled war package.

Building/Running CAS

cd midd-cas/

Update the configuration if needed

vim src/main/webapp/WEB-INF/deployerConfigContext.xml

The configuration file committed to the Git repository on chisel is almost identical to the one in production. If you commit and push changes to this file, then update production, these changes will come through.

The current development configuration (in the source repository) refers to a database on chisel that holds the ticket registry and the services configuration. It is fine to continue to use this database if you wish. If not, you can configure another database. Look for the following lines at the bottom of the deployerConfigContext.xml:

    <bean
id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
p:driverClassName="com.mysql.jdbc.Driver"

p:url="jdbc:mysql://chisel.middlebury.edu:3306/db_name?autoReconnect=true"
p:password="password"
p:username="username" />

Build the war package

mvn clean package

Deploy the package

Deploying the package involves stopping tomcat, then deleting the CAS files from its webapps/ directory and putting the new war file in that directory. When tomcat is started, it will extract the various resources from the war file and run the application.

sudo tomcatctl stop
sudo rm -R  /opt/local/share/java/tomcat5/webapps/cas*
sudo cp target/cas.war /opt/local/share/java/tomcat5/webapps/cas.war
sudo tomcatctl start


Updating the source code

Deploying in production

Configuration

Run-time Administration

Allowed Services Configuration

Troubleshooting Errors

To-Do list

  • Multicast Ticket Registry for high availability - Currently the ticket-registry database is a single point of failure. Updating to a ticket-registry implementation that allows each CAS server to validate its peers without a single intermediary will help ensure high availability.