Build guide for W3C CSS Validator
Pull request Compare This branch is even with tlvince:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
readme.mkd

readme.mkd

Building the W3C CSS Validation Service from source

Preamble

This guide provides a step-by-step walk-through to build and install the W3C CSS Validation Service (herein referred to as CSS Validator) from its source files. It assumes minimal prior system administration experience, uses the latest versions and includes all functionality of the validator. The target Linux distribution is Ubuntu Precise, though each step will be similar for any distribution.

Installing Ubuntu

Note: this section can be skipped if you're already familiar with installing Ubuntu and/or have a Linux system running.

We will be using a Vagrant managed VirtualBox install as a base system.

  1. Download and install Vagrant from a pre-built package
  2. From the command line, download an Ubuntu Precise box with:

    vagrant box add precise32 http://files.vagrantup.com/precise32.box
    
  3. Create an instance of Ubuntu Precise with:

    mkdir cssvalidator
    cd cssvalidator
    vagrant init
    
  4. Edit the generated Vagrantfile and tell Vagrant to use the precise32 box:

    config.vm.box = "precise32"
    
  5. Uncomment and edit the following line in the generated Vagrantfile to enable port forwarding:

    config.vm.forward_port 8080, 8080
    
  6. Launch the virtual machine:

    vagrant up
    

Your Ubuntu virtual machine should now be up and running. Confirm by running:

vagrant ssh

Installing CSS Validator

1. Installing CSS Validator dependencies

  1. Install build packages:

    sudo apt-get update
    sudo apt-get install build-essential cvs
    
  2. Install CSS Validator dependencies:

    sudo apt-get install default-jdk ant
    

2. Install CSS Validator

Download CSS Validator

mkdir ~/build
cd ~/build
export CVSROOT=":pserver:anonymous@dev.w3.org:/sources/public"
cvs login
CVS password: anonymous
cvs get 2002/css-validator

3. Install a Java Servlet container

Here, we'll be using Tomcat but the same principles apply to any Java Servlet container.

  1. Install Tomcat

    sudo apt-get install tomcat7
    
  2. Configure CSS Validator to use Tomcat by replacing the following line in ~/build/2002/css-validator/build.xml:

    <property name="servlet.lib" value="/usr/share/java/servlet-2.3.jar"/>
    

    ... with

      <property name="servlet.lib" value="/usr/share/java/tomcat-servlet-api-3.0.jar"/>
    

4. Build CSS Validator

To build the CSS Validator WAR file, run:

cd ~/build/2002/css-validator
ant war

5. Deploy CSS Validator

Deploy the CSS Validator WAR file with:

sudo cp ~/build/2002/css-validator/css-validator.war /var/lib/tomcat7/webapps

6. Launch Tomcat

Note: Ubuntu's default configuration starts Tomcat on install and at system startup.

Start Tomcat using:

sudo service tomcat7 start

Validator should now be set up and ready to go. Browse to http://localhost:8080/css-validator to see it running.

References

The author would like to thank the CSS Validator Team's official install guide, which forms the basis of much of this document.

License

Copyright 2012 Tom Vincent http://tlvince.com/contact, licensed under the Creative Commons Attribution 3.0 Unported License.