You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Dave [Hawk-Systems]" <da...@hawk-systems.com> on 2003/07/11 06:51:34 UTC

[users@httpd] testing httpd.conf => httpd -t doesn't catch include/path errors

have noticed that -t doesn't catch errors in httpd.conf files for included conf
files.  is there a way to have apache pull in all the included conf files and
ensrue that they all conform and will result in a successful restart?

Currently we pull in each virtual host via a seperate conf file,  quite often a
missing or erroneous path to a log file or directory will not show up on a
"httpd -t", but bring the server to a halt when the actual restart is attempted.
not good.

thanks

Dave



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] testing httpd.conf => httpd -t doesn't catch include/path errors

Posted by "Dave [Hawk-Systems]" <da...@hawk-systems.com>.
>> Currently we pull in each virtual host via a seperate conf file,  quite
>often a
>> missing or erroneous path to a log file or directory will not show up on a
>> "httpd -t", but bring the server to a halt when the actual restart is
>attempted.
>> not good.
>
>I don't think that is a correct problem description. From my experience,
>the -t switch do catch syntax errors in the httpd.conf as well included
>files, but errors such as bad paths of logs and directories aren't checked
>in either the httpd.conf nor in included files.

this may be where the assumption of inluded files came in since that is where
all the log paths are stored, and that is where all the failures end up
occuring.

>After taking a peek at the docs, I can see that this assumption of mine is
>correct. They clearly states that the -t switch is a "syntax test" only; bad
>paths are not syntax errors:
>http://httpd.apache.org/docs-2.0/programs/httpd.html
>
>I'd think it would be a too complex task to check paths without actually
>starting the server.

after a more detailed review of the docs on this matter
(http://httpd.apache.org/docs/stopping.html)
I may try scripting a test of the config first by starting as another user to
see if we can generate the errors and intelligently fix them prior to executing
the restart.

Anyone have sample code for this already before I reinvent the wheel?

Dave



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] testing httpd.conf => httpd -t doesn't catch include/path errors

Posted by Robert Andersson <ro...@profundis.nu>.
Dave [Hawk-Systems wrote:
> Currently we pull in each virtual host via a seperate conf file,  quite
often a
> missing or erroneous path to a log file or directory will not show up on a
> "httpd -t", but bring the server to a halt when the actual restart is
attempted.
> not good.

I don't think that is a correct problem description. From my experience,
the -t switch do catch syntax errors in the httpd.conf as well included
files, but errors such as bad paths of logs and directories aren't checked
in either the httpd.conf nor in included files.

After taking a peek at the docs, I can see that this assumption of mine is
correct. They clearly states that the -t switch is a "syntax test" only; bad
paths are not syntax errors:
http://httpd.apache.org/docs-2.0/programs/httpd.html

I'd think it would be a too complex task to check paths without actually
starting the server.

Regards,
Robert Andersson




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org