Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 3318  / 2 Years ago, sun, december 5, 2021, 10:45:24

How to install and use w3c markup validator on Ubuntu 13.10 locally? I know I can install it by installing following packages:



sudo apt-get install libapache2-mod-perl2   
sudo apt-get install w3c-markup-validator


but how do I configure it to use it same way as on-line version (that is by web browser), but locally?


More From » 13.10

 Answers
7

Good news! So if you have apache2 already installed, you install W3C Validator and Perl:



sudo apt-get install w3c-markup-validator libapache2-mod-perl2


The issue is that the w3c-markup-validator package hasn't been updated to install properly on 13.10+ (I'm on 14.04). To fix it manually:



sudo ln -s /etc/w3c/httpd.conf /etc/apache2/conf-enabled/w3c-markup-validator.conf


I then had an issue where /usr/lib/cgi-bin didn't have the correct permissions. This is due to a problem in /etc/apache2/conf-available/serve-cgi-bin.conf where it will only give the correct permission if the module is being loaded. It appears this version of perl isn't listed in the IfModule statement. To fix this:



sudo gedit /etc/apache2/conf-available/serve-cgi-bin.conf


You want it to look like this:



<IfModule mod_alias.c>
<IfModule mod_cgi.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>

<IfModule mod_cgid.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>

<IfModule mod_perl.c>
Define ENABLE_USR_LIB_CGI_BIN
</IfModule>

<IfDefine ENABLE_USR_LIB_CGI_BIN>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
</IfDefine>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


Once you're done with these steps you have to symlink validator's html directory to /var/www/html:



sudo ln -s /usr/share/w3c-markup-validator/html /var/www/html/w3c-validator 


Once the file is linked and the changes are in place, all you have to do is restart the Apache server:



sudo service apache2 restart


Check that it's all working



http://localhost/w3c-validator


CSS might be missing from validator page in the browser, but validation should work well.


[#25034] Tuesday, December 7, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
etzelmortg

Total Points: 430
Total Questions: 105
Total Answers: 106

Location: Suriname
Member since Sun, Jun 13, 2021
3 Years ago
;