Installation Documentation for The W3C Markup Validation Service (Windows, Apache)
Markup Validation Service Check the markup (HTML, XHTML, …) of Web documents Installing the W3C-Validator on a Apache under Windows Table of Contents About this guide Needed programs and other prerequisites Directory Structure Installation of the Programs Integration of the Perl Modules Configuration of the Apache Web server Adaptation of the hosts-File Configuration of the Validator Adaptation of the check-Script Hints About this guide This guide for the installation of the W3C Markup Validator was contributed by David Tibbe.
It is also available in german . See the generic installation guide for instructions on how to install the Markup Validator on other platforms and links to other platform-specific guides . Needed programs and other prerequisites The first prerequisite to run the validator on your system is a Web server. This guide will assume that the server is already installed, and its configuration will not be discussed here. The server used in this guide is Apache 2, and the instructions should be applicable to most versions of Apache.
The Markup Validator itself is basically a script written in Perl, so you will need that, too. ActivePerl (version 5.8), is one of the options, and thanks to its installer should not be difficult to set up. Of course, you will also need the Validator itself. It is available for download as two tar-archives: the validator itself (~300kB), and a collection of DTDs (~400kB). The validator relies on a number of Perl libraries, or "modules".
At Active State , has a list of all available modules for Active Perl. In this list is also mentioned if a module is "Core" (which means it is build in) or if it is downloadable. For the validator, the following modules are required: Class-Accessor Config-General Encode-HanExtra HTML-Encoding HTML-Parser HTML-Template JSON Net-IP SGML-Parser-OpenSP XML-LibXML XML-NamespaceSupport XML-SAX XML-LibXML-Common ...and the following are optional: Encode-JIS2K HTML-Tidy You can get each of them in a single package at ActiveState.
They are also packed ready-to-install in a single zip-file , (courtesy of the guide's author). Finally you will need some calm and patience. A whole installation of the validator (including the Apache and Perl) will take about an hour if you do not have much experience. Directory Structure It might be a good idea to think about the directories the program should be installed to. Just clicking "Next" in all installation routines is not a very good idea.
One suggested method is to have a directory C:\www in which all programs concerning the Web server are located (in subfolders, obviously). For instance, Apache is installed in C:\www\Apache2 , Perl in C:\www\perl , the Perl modules unzipped in C:\www\pmm , the validator itself in C:\www\validator and finally the DTD-Collection in C:\www\sgml-lib The rest of this guide will assume that these paths are being used. If you want to use another directory structure, you will have to adapt the instructions and sample configuration to your own setup.
Installation of the Programs Next, you will be installing all the programs and libraries one after the other. The Apache Web server should first be installed and successfully started. As mentioned, this will not be explained in here, but you will find a lot of How-Tos all over the net, e.g. in the Documentation on the Apache site The only thing that is important to know is that the installation routine will create a subfolder Apache2 by itself.
Therefore, you will want to choose C:\www as installation directory, and Apache will be installed to C:\www\Apache2 . Adding the Perl Modules Since Perl 5.8.8 build 817.91 PPM has a GUI . It is quite easy to use, if you do have any problems have a look at its documentation. You can add the modules from the downloaded package or directly from the web. If you want to install them from a local repository, you have to add it first (if you don't want to do so, just skip this step).
That can be done within in the preferences dialogue (Edit -> Preferences -> Repositories). Click the Folder-Icon, select C:\www\ppm and name the repository "Local", for example. Click "Add" and then "OK". When you type the first letters of the desired package, the long list is getting shorter and only matching packages are shown. Select the one you want to install, select "Install..." from the context menu. When you have done that for all packages, click the little green arrow in the to of the window.
In the little status window on the bottom you will see the progress and success of each installation. Exit PPM when all packages have been installed. Configuration of the Apache Web server The first file to edit is the httpd.conf located at C:\www\Apache2\conf , the central configuration file of your Apache. It is recommended to make a backup before editing it. The validator pages are composed by using SSI . Therefore, the Apache has to load the required module.
In "Section 1 Global Environment", the different modules are loaded. SSI needs mod_include for working. The line LoadModule include_module modules/mod_include.so has to be unquoted (by deleting the # at the beginning of the line) or added completely if the module is not loaded yet. The next step is to create a virtual host. It is needed, because the validator should be run from a different directory and logically separated from the default host.
At the end of the httpd.conf , in "Section 3: Virtual Hosts", the following lines have to be added: NameVirtualHost 127.0.0.2:80 <VirtualHost 127.0.0.2:80> ServerName validator.example.org DocumentRoot "C:/www/validator/htdocs" ErrorLog logs/error_validator.log CustomLog logs/access_validator.log common ScriptAlias /cgi-bin "C:/www/validator/httpd/cgi-bin" ScriptAlias /check "C:/www/validator/httpd/cgi-bin/check" AddType text/html .html AddOutputFilter INCLUDES .html <Directory "C:/www/validator/htdocs"> Options ExecCGI Includes Indexes MultiViews AddEncoding x-gzip .gz <Files *.js.gz> ForceType application/javascript </Files> <Files *.css.gz> ForceType text/css </Files> AllowOverride None Order deny,allow Allow from localhost </Directory> <Directory "C:/www/validator/httpd/cgi-bin"> Options ExecCGI Includes Indexes MultiViews AllowOverride None Order deny,allow Allow from localhost </Directory> </VirtualHost> It may be that the httpd.conf is splitted into more than one file.
The other files will be located in the C:\www\Apache2\conf\extra folder. If there is a file named httpd-vhosts.conf edit this one and make sure that it will be included in the httpd.con (there must be a line # Local access to the Apache HTTP Server Manual Include conf/extra/httpd-manual.conf The meaning of all these lines will not be discussed here. Who is interested in their sense can have a look to the manual or in one of the many How-Tos found by Google.
Just some short notes about: The first line specifies the IP-address, the validator should run at. It is a loop back address, so the validator will be accessible only from your machine. The following lines specify the name of the host, the locations of the log files and some "short cuts" for the cgi-bin directory and check-script. The next three lines make the Apache parsing HTML-files for SSI-directives. The last two sections set some permission for the used directories.
The files error_validator.log and access_validator.log can be found in the C:\www\Apache2\logs -directory. They log every request and error occurring on this host and give you some helpful advices in these cases. Finally, the Apache has to be restarted so that the changes take effect. You can do that by choosing the shortcut in the Apache-program group ( Start , Programs , Apache HTTP Server , Control Apache Server Restart ).
A DOS-box will appear shortly; when it disappears, the Apache is restarted. When you call http://127.0.0.2/ in your browser, you should see the well-known site from https://validator.w3.org/ . In the configuration file of the Apache, a name for th
The rest of this page is on the live site.