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 ...
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?
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.