This page last changed on Feb 09, 2012 by brian.

About seadog.wf.mbari.org

Seadog acts as the web application server for the Deep-sea Guide on the Western Flyer. All content is servered via an instance of Tomcat. All DSG content and applications exist in /opt/dsg.

Tomcat

Tomcat resides in /opt/dsg/tomcat/apache-tomcat-7.0.23 and is visible via port 8082. It has been configured to run on non-default ports so that it does not interact with another Tomcat on Seadog that is running JIRA on the default ports. This instance of Tomcat has been modified to serve static DSG content stored in /opt/dsg/www.

"Configure Tomcat to Serve Static Files

Suppose you have a /var/project/images directory which stores a number of images for your project. If you want this directory to be exposed through http protocol, all you have to do is to add a <Context> parameter to the <Host> section of Tomcat's server.xml:

<Server port="8025" shutdown="SHUTDOWN">
  ...
  <Service name="Catalina">
    ...
    <Engine defaultHost="localhost" name="Catalina">
      ...
      <Host appBase="webapps"
          autoDeploy="false" name="localhost" unpackWARs="true"
          xmlNamespaceAware="false" xmlValidation="false">
        ...
        <Context
            docBase="/var/project/images"
            path="/project/images" />
      </Host>
    </Engine>
  </Service>
</Server>

Note that docBase parameter is set to the path on hard drive and path parameter is set to the context path for your files. Now, if you have a /var/project/images/sample.png file, it can be seen at http://localhost:8084/project/images/sample.png.

Source

The startup script is located at /etc/init.d/tomcat-dsg. It is run under the user tomcat. Files added under /opt/dsg should all belong to the group tomcat!!. Brian Schlining has sudo permissions on /sbin/service and /sbin/chkservice. To restart tomcat run:

sudo /sbin/service tomcat-dsg restart

Configure Tomcat Manager application to handle large files

When I attempted to upload the dsg.war I got the following error:

org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: 
the request was rejected because its size (53887121) exceeds the configured maximum (52428800)

By default the Manager app only allows WARS upto 50MB to be uploaded; the dsg.war was just slightly larger. To resolve this, I edited \webapps\manager\WEB-INF\web.xml and changed the max-file-size and max-request-size to something larger. The block to be edited looks like:

<multipart-config> 
    <!-- 52MB max --> 
    <max-file-size>52428800</max-file-size> 
    <max-request-size>52428800</max-request-size> 
    <file-size-threshold>0</file-size-threshold> 
</multipart-config>

Static Content

Static content was copied as follows:

  1. Knowledgebase Images
    ssh seadog.wf.mbari.org
    cd /opt/dsg/www/vars/knowledgebase
    scp -r brian@eione.mbari.org:/var/www/website/images/dsg images
  2. Deep-sea Guide Artifacts
    ssh seadog.wf.mbari.org
    cd /opt/dsg/www/dsg
    scp -r brian@seaspray.shore.mbari.org:/var/www/html/dsg/artifacts artifacts

Database Replication

Replication from equinox.shore.mbari.org to alaskanwind.wf.mbari.org is run nightly. The following SQL is executed after replication:

-- For DSG_KB run the following:

UPDATE 
  Media 
SET 
  url = REPLACE(url, 'http://seaspray.shore.mbari.org/dsg',
        'http://seadog.wf.mbari.org:8082/www/vars/knowledgebase/images') 
WHERE 
  url IS NOT NULL


-- For DSG run the following:

UPDATE 
  URLArtifact 
SET 
  url = REPLACE(url, 'http://seaspray.shore.mbari.org/dsg', 
        'http://seadog.wf.mbari.org:8082/www/dsg') 
WHERE 
  url IS NOT NULL
Document generated by Confluence on Feb 03, 2026 15:43