I want to indent my apache2 virtual host config files. I came to know how to make indent XML files, but the virtual host config files are not valid XML files. For example, if I try to use xmllint given in XMH2 on XM2, I get an error:
$ cat 000-default.conf | Xmllint --format - -:: 1: Parser Error: The parsing attribute name of the error is & lt; VirtualHost *: 80 & gt; ^ -: 1: Parser error: error of attributes build & lt; VirtualHost *: 80 & gt; ^ -: 1: Parser error: the end of the start tag virtual host line 1 could not be found & lt; VirtualHost *: 80 & gt; ^ -: 1: Parser error: additional content at the end of the document & lt; VirtualHost *: 80 & gt; ^
How can anybody put a clue on it? As you say, Apache 2 config files are not XML files
xmllint
There is a program (with other things) reformat XML files. This will not work on apache2 config files, therefore do not use xmllint
on apache2 config files, and you will avoid errors mentioned above.
It would be better to use an editor (see for emacs apache2 mode), or a program written to redefine apache 2 config files.
Comments
Post a Comment