A Web Developer's Diary

How to build the Quercus WAR file yourself and install it in your local Maven repository

7/8/2012

0 Comments

 
If you ever need to compile Quercus from source and install it into your local Maven repository, this post is just for you. You need to have Subversion (or Git), Maven and Ant installed. Here are the steps:
 svn co svn://svn.caucho.com/home/svn/svnroot/resin/trunk resin
cd resin
ant quercus.war
mvn install:install-file -Dfile=dist/quercus-4_0-snap.war -DgroupId=com.caucho -DartifactId=quercus -Dversion=4.0-SNAPSHOT -Dpackaging=war
Some time ago I had to download the Resin/Quercus source from an unofficial mirror repository on github, because the official Caucho SVN repository located at svn.caucho.com was down. This mirror repository is still available, but at the time of writing it seems a little outdated. If you are interested, perform these steps instead:
 git clone https://github.com/mdaniel/svn-caucho-com-resin.git
cd svn-caucho-com-resin
ant quercus.war
mvn install:install-file -Dfile=dist/quercus-4_0-snap.war -DgroupId=com.caucho -DartifactId=quercus -Dversion=4.0-SNAPSHOT -Dpackaging=war
The Quercus webapp is now installed in your local Maven repository as version 4.0-SNAPSHOT. Include in your project's pom.xml as follows:
<project>
...
<dependencies>
...
<dependency>
<groupId>com.caucho</groupId>
<artifactId>quercus</artifactId>
<version>4.0-SNAPSHOT</version>
<type>war</type>
</dependency>
...
</dependencies>
...
</project>
If you would like to see the other build targets for Resin/Quercus, execute the following command:
ant -p
Bonus tip: you can always find a recent version of the Quercus WAR file at http://www.caucho.com/download/quercus-4.0.x.war, replacing 'x' with the latest version, e.g. http://www.caucho.com/download/quercus-4.0.28.war. You can find the latest version number by looking at Caucho Resin's version number on the website's download page. I figured this out once by guessing URLs to download the latest version. The Quercus website is not updated frequently enough to keep up with newer releases, but the files are actually there.
0 Comments

Loading webfonts of Amazon CloudFront the right way

6/29/2012

21 Comments

 
When loading webfonts of Amazon's CDN Cloudfront, a problem arises in FF and IE9. The fonts are not rendered! This is because a header is missing and these browsers refuse to render them due to security reasons. The fix is really easy, add these lines to your .htaccess file:
 <FilesMatch "\.(ttf|otf|eot|woff|svg)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>
Then the next step is to invalidate the font files that are cached on the CDN (you can do this through the AWS control panel). Wait until CloudFront refreshes the files and voila, it will serve the webfonts with the Access-Control-Allow-Origin header set and FF and IE9 will render them normally!
21 Comments

    Author

    Blog about random challenges of a web developer.

    Archives

    April 2015
    May 2013
    January 2013
    July 2012
    June 2012

    Categories

    All
    Aws
    Cdn
    Code Igniter
    Css
    H2database
    Jamp
    Java
    Javascript
    Magento
    Maven
    Mysql
    Opencl
    Php
    Play-framework
    Quercus
    Scala
    Ubuntu

    RSS Feed

Powered by Create your own unique website with customizable templates.