osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it interesting to add some filepath checks to apachectl -t ?


but httpd is invoked from it and already checks if document root exists and if does not it does not start, and log directory is always writable unless selinux is involved because those are written with root. So I am not sure what is the gain here.

El dom., 2 sept. 2018 13:41, Yann Ylavic <ylavic.dev@xxxxxxxxx> escribió:
Hi Stéphane,

sorry for the delay.

>
> On 03/07/2018 22:57, Stéphane Blondon wrote:
> > Hello,
> >
> > `apachectl -t` checks the configuration files. The documentation
> > explains it's not complete.
> > It seems paths (for DocumentRoot for example) or the write access for
> > log directory are not checked. (tested with apache v.2.4.25.)
> >
> > Are you interested by such a feature?

Sure, improvements are always welcome!

> > If I understand the code properly, the check is done by
> > ap_run_test_config(), called in main.c. However, I don't find the
> > definition of the function in the httpd-2.4.33 archive.

apr_run_*() functions run the hooks registered with ap_hook_*(), so
you may want to search for "test_config" in the sources and see how
such functions are implemented/hooked (and how hooks mechanism work in
general for that case).
Then possibly add your code in one of the hooks or create a new hook
if that fits better.

> >
> > I have no idea if I have the skills to implement that in C but I can
> > look for it.

Thanks!

Regards,
Yann.