Installation information
for the W3C Markup Validator

Table of Contents

Other installation guides

The installation guide we provide here is a rather generic set of instructions, which should work on most systems. To our knowledge, the following platform-specific guides are also available and can be of interest :

Related documentation

This installation guides presumes knowledge of the Source availability for the Markup Validator.

We recommend that developers wishing to contribute on the Markup Validator or modify it go through this installation procedure once, to get familiar with the system.

Installing on packaged systems

The easiest way to install released versions of the Markup Validator is to use the packages created for some platforms by contributors: Debian GNU/Linux and Fedora Core packages are available.

Installing from source (generic case)

These instructions are strongly inspired from Nick Talbott's guide for Slackware Linux. Thanks Nick!

Download

Download the Validator's Tar Ball and the DTD library from our site.

Alternatively, if you want to work on the latest development version, you can download both from our CVS repository, but you should be aware that this version may not work at all.

(Read more about retrieving the source)

Prerequisites

Apart from a properly configured Web server, the Validator needs a SGML parser -- that does all the hard work --, Perl (version 5.6.0 or newer) and several Perl modules used by the "check" CGI script.

SGML Parser: OpenSP

The SGML parser we're currently using is OpenSP 1.5, which can be found on the OpenJade home page.

Perl Modules

The canonical list of Perl modules we use can be found in the source for the "check" CGI script. There is a bunch of lines that of the form "use Foo::Bar" where each "Foo::Bar" represents a module. Most modules can be found on CPAN (minimum versions in parenthesis after the name). The following list was complete when CVS spit out: $Date: 2005-01-09 19:46:19 $. :-)

One easy - and strongly recommended - way to take care of all these Perl module dependencies is to install Bundle-W3C-Validator from CPAN. See the documentation included with it for more details.

List of required Perl module distributions
CGI.pm >= 2.81
The all-singing, all-dancing, everything-and-the-kitchen-sink, Perl CGI library. This takes care of all those niggly little bits of CGI for us and make options parsing and file upload a breeze.
Config-General >= 2.19
Configuration file handling.
HTML-Parser >= 3.25
Minimal HTML parser used for preparse and finding metadata.
HTML-Template >= 2.6
Template system which allows us to separate Validator's logic and presentation.
libwww-perl >= 5.60
Gisle Aas' most excellent WWW library for Perl. This is where our support for downloading pages off the net comes from. Version 5.60 or newer is required, however we strongly suggest a (much) newer version. Validator's support for compressed responses is available with version 5.802 and later.
Net-IP
IP address manipulation.
Set-IntSpan
Efficient set operations.
Text-Iconv
Perl-native interface to the (g)libc iconv(3) library. Handles character set conversion issues.
URI
Library to handle URIs and escaping special characters in them.

Install the various necessary components:

  1. The installation guide assumes that you have a working Web server. We suggest the popular Apache server, which is used for the W3C Markup Validation service. The validator may work with other Web servers than the popular Apache, but we can not guarantee that it will. You will also need a working installation of the Perl language (standard on most Web servers).

  2. Proceed with the Prerequisites, as detailed above.

  3. Create a directory for the validator's installation. On Unix-based systems, the default will be /usr/local/validator.This directory will be referred as [validatorpath] throughout this guide.

  4. Unpack the archives of the validator and DTD library into [validatorpath]

    The [validatorpath] directory should now have subdirectories named htdocs, httpd, config and sgml-lib (if you used CVS, the latter is actually in the htdocs subdirectory, but that is not really important).

Configure

Configuration files

For reference, here is an overview of all the configuration files for the Markup Validator.

The validator uses a number of configuration files -- most of which are really mapping tables of some form -- to avoid having to check in a new version of the code every time a new version of HTML comes out. All configuration files can be found in $CVSROOT/validator/htdocs/config/.

To really understand what each does you should read the source, but here is a short description to get you started.

eref.cfg
Contains the mappings from element names to an URL fragment (relative to a configurable URL) for their definitions. Used in output when the "Show Source Input" option is enabled.
fpis.cfg
Maps FPIs to plain text version strings.
frag.cfg
Maps error messages to an URL fragment identifier where an explanation of that error can be found.
type.cfg
Maps MIME/HTTP Content-Types to an internal "document type" which is used for treating HTML, XML, and XHTML in different ways.
validator.conf
Main configuration file. Gives various parameters (such as the address of the maintainer and the URL for the "Home Page") and the locations of the other configuration files and mapping tables.
Configure the Web server

The following instructions are for the Apache Web server, and should be adapted if you plan on using another server.

  1. Edit the configuration of your Web server to refer to the specific configuration file for the Validation service.

    This can be done by adding this line:

    Include [validatorpath]/httpd/conf/validator-httpd.conf
  2. Copy [validatorpath]/httpd/conf/httpd.conf to [validatorpath]/httpd/conf/validator-httpd.conf and start editing this file.

  3. You may want to set up a "virtual server" for the service. This can be done by adding something similar to the following :

    <VirtualHost 127.0.0.1>                                                               
    	DocumentRoot [validatorpath]/htdocs/                        
    	ServerName validator.example.org
    </VirtualHost>

    AND/OR you may want to have the service at a specific location on your Web server, which can be configured as follows :

    Alias /validator/ [validatorpath]/htdocs/
  4. Finish editing this HTTP server configuration file, adapting all the directory references to reflect the paths used in your installation.

  5. Now restart the Web server to activate the updated configuration.

    For Apache this is done by typing into a shell, as System Administrator: apachectl graceful (or, for older versions of Apache apachectl configtest then apachectl restart)

Configure the Validator itself
  1. Create the directory /etc/w3c and create a file called validator.conf using the file [validatorpath]/htdocs/config/validator.conf as template.

  2. Make changes to reflect where files are in your installation.

    This file is well commented and this should be relatively straightforward.

Check the installation

  1. Point your browser at the new site.

  2. Check the error log of the Web server to get clues on what may be wrong if you get any server errors.

Help us improve this installation guide by sending us your feedback if you install the validator on your local system!

Troubleshooting a new installation

It is not always easy to troubleshoot an incomplete, or failed, installation of the Markup Validator. While the instructions given in this page should help most people install the validator successfully on their system, bad luck, a forgotten step or a broken component can make things go sour.

Double check the installation steps

The first sound thing to do if the installation failed would be to check that you did not forget any step while installing. properly copying and editing the configuration file is among the common mistakes, for example.

Check the logs

The error logs for your Web server should be a good first place to look for hints on what is wrong with your installation.

Check the dependencies

A common problem with a newly installed validator is a validator that is apparently running but marking anything as "invalid", without giving any error message as output.

This is somewhat typical of a problem with OpenSP. Cross-check that you actually have a version above 1.5, by running onsgmls --version.

The miracle debug options

If the validator is misbehaving, you can try forcing various debug options by appending to the URL the following string: &debug=1&errors=1&esis=1&verbose=1

This can sometimes provide you with error messages that would not have appeared anywhere in non-debug mode, and can be helpful to diagnose the problem

If all fails...

Don't hesitate to contact the public mailing-list www-validator@w3.org with all the details you can provide on what you did, tried, and what went wrong...

Post-install options

if the installation succeeded, you should be able to now use the Markup Validator on your own system and network. You may want to give the validator a look and feel specific to your Web site. The easiest way to achieve this is to edit header.html and footer.html (in the htdocs directory), the header and footer markup snippets used to build all pages for the validator.

You may also edit the Style Sheets (in the same directory), especially base.css You may however want to avoid editing the other CSS files too heavily, there is a risk you could make the output of the validator unusable.

Credits and Acknowledgments

The Validator Team wishes to thank Nick Talbott and Stephen Yoch for their help in creating the following installation instructions. Thanks also to all the people who use and review the guide to make it better and better!