Bug 9906 - error parsing config file
error parsing config file
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: phhttpd (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Zach Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-03-01 16:15 EST by Brock Organ
Modified: 2015-05-17 21:40 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-03-07 11:01:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Brock Organ 2000-03-01 16:15:59 EST
using the following valid phhttpd.conf file we get a parse error:

[root@test95 /root]# phhttpd -c /etc/phhttpd.conf.space
/etc/phhttpd.conf.space:1: error: Extra spaces at the beginning of the
document are not allowed


^
couldn't parse config file /etc/phhttpd.conf.space
[root@test95 /root]#

below (between the -'s) is the EXACT file (note whitespace IS important):


-------------- BEGIN FILE --------------------




<phhttpd>


<global>
	<tunnel file="/var/run/phhttpd/tunnel.socket" mode="0600" />
	<control file="/var/run/phhttpd/control.socket" mode="0600" />
	<mime file="/etc/mime.types" />
	<maxfds num="5000" />
</global>





<logging>

	<template name="logtemplate">
		<route source="access" type="file" file="/var/log/phhttpd/access.log"
mode="0660" />
		<route source="referer" type="file" file="/var/log/phhttpd/referer.log"
mode="0660" />
		<route source="agent" type="file" file="/var/log/phhttpd/agent.log"
mode="0660" />
	</template>
</logging>



<virtual docroot="/home/httpd/html">




	<name>localhost</name>

	<listen v4="*" port="80"/>




	<md5 />
	<logs>

		<applytemplate name="logtemplate" />
	</logs>
</virtual>

</phhttpd>
------------------ END FILE ------------------
note that the above file is the exact copy of the /etc/phhttpd.conf
packaged, except with the text of the comments removed ...

The file below is the exact text of the above, but with excess whitespace
removed ... phhttpd parses and starts running using this conf file ...

------------------- BEGIN FILE -------------------------
<phhttpd>
<global>
	<tunnel file="/var/run/phhttpd/tunnel.socket" mode="0600" />
	<control file="/var/run/phhttpd/control.socket" mode="0600" />
	<mime file="/etc/mime.types" />
	<maxfds num="5000" />
</global>
<logging>
	<template name="logtemplate">
		<route source="access" type="file" file="/var/log/phhttpd/access.log"
mode="0660" />
		<route source="referer" type="file" file="/var/log/phhttpd/referer.log"
mode="0660" />
		<route source="agent" type="file" file="/var/log/phhttpd/agent.log"
mode="0660" />
	</template>
</logging>
<virtual docroot="/home/httpd/html">
	<name>localhost</name>
	<listen v4="*" port="80"/>
	<md5 />
	<logs>
		<applytemplate name="logtemplate" />
	</logs>
</virtual>
</phhttpd>
---------------- END FILE ---------------------

The final example uses the stock /etc/phhttpd.conf file; again it appears
like there is trouble parsing the file:

[root@test95 /root]# phhttpd -c /etc/phhttpd.conf
[root@test95 /root]# no control path specified in the config file.

[root@test95 /root]#

But the stock conf file is the same as the two files in our examples
here... so all three files SHOULD be valid conf files, but phhttpd only
accepts one of them ...
Comment 1 Zach Brown 2000-03-02 10:53:59 EST
libxml is not happy when whitespace is the first thing in the config file.
I will try and update the documentation to reflect this.

I wasn't able to reproduce the 'no control path'.. with your config file
and phhttpd-0.1.0-2.  It was also able to use the example config file
as well, comments or not.

Am I on crack?
Comment 2 Zach Brown 2000-03-07 11:01:59 EST
libxml changed how it deals with xml that starts with a comment (which
I'm told is illegal.  OK :)).  6.1's libxml happily returned the parsed
document by ignoring the comment.  6.2's happily returned an empty document.
So the config file has been updated with BIG WARNINGS against doing things
that libxml doesn't like.

Note You need to log in before you can comment on or make changes to this bug.