Install brat on Apache2

By | December 23, 2013

Install brat

download, unzip and run ./install.

Change the webapp location in Apache2

  1. in etc/apache2/sites-avialble, in default add Alias /brat "/home/brat"
  2. restart apache2:
sudo service apache2 reload

Enable CGI

Add the following code in default

<Directory /home/ypeng/brat>
            AllowOverride Options Indexes FileInfo Limit
            AddType application/xhtml+xml .xhtml
            AddType font/ttf .ttf
            # For CGI support
            AddHandler cgi-script .cgi
            # Comment out the line above and uncomment the line below for FastCGI
            #AddHandler fastcgi-script fcgi
</Directory>

Adjust fonts

To speed up the load of fonts, we can change the family to Google fonts. Go to brat/client/serc/visualizer.js. Around line 3074, change the webFontConfig to

var webFontConfig = {
          custom: {
            families: [
              'Open Sans',
              'Open Sans',
              //        'Ubuntu',
              'Open Sans'
            ],
            /* For some cases, in particular for embedding, we need to
              allow for fonts being hosted elsewhere */
            urls: webFontURLs !== undefined ? webFontURLs : [
              "http://fonts.googleapis.com/css?family=Open+Sans:700",
              "http://fonts.googleapis.com/css?family=Open+Sans",
              'http://fonts.googleapis.com/css?family=Open+Sans:300'
            ],
          },

While using the Embedded visualization, change the webFontURLs to

var webFontURLs = [
    "http://fonts.googleapis.com/css?family=Open+Sans:700",
    "http://fonts.googleapis.com/css?family=Open+Sans",
    'http://fonts.googleapis.com/css?family=Open+Sans:300'
];

Change the webapp location in Tomcat6

1.in /etc/tomcat6/Catalina/localhost, add isimp.xml

<Context path="/examples" 
    docBase="/home/ypeng/examples" />
  1. restart tomcat6: sudo service tomcat6 restart

Leave a Reply

Your email address will not be published. Required fields are marked *