How to add comment in apache httpd.conf not as a complete line?
I believe only #
is parsed as there is no real need for it. But if you really need you can use IfDefine
block, which will be ignored unless a matching variable has a definition.
<IfDefine myexisterenceIsForJustAComment>
...
</IfDefine>
Look at discussion at : https://bugzilla.redhat.com/show_bug.cgi?id=1349546
Not sure if these are supported in latest versions (< httpd-2.2.15-53) but you can try below which was supported in earlier versions. You may be in luck if you are on older version.
In earlier/older versions of Apache, I remember it was okay to include a comment at the end of a line (wrapped in double quotation marks), like so:
<Limit GET >
Order Allow,Deny
Allow from all
Deny from xxx.xxx.xxx "# I am in inline comment"
</Limit>
The documentation states that it is not possible:
... Lines that begin with the hash character "#" are considered comments, and are ignored. Comments may not be included on the same line as a configuration directive ...