You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stéphane Blondon <st...@gmail.com> on 2019/01/13 21:31:20 UTC

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

Hello,

sorry for the huge 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.)

On 02/09/2018 13:56, Daniel Ferradal wrote:
> 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


You're right: I tested with a more recent version (2.4.37) and
'DocumentRoot' path and logs directories ('ErrorLog' and 'CustomLog')
are checked.

I wonder if `apachectl -t` should provide a warning if the path for
'Directory' directive does not exist.

For example, <Directory /var/www/demo>
if /var/www/demo does not exist, `apachectl -t` does not complain. I
though it would display a warning like AH00112 for DocumentRoot:
Warning: DocumentRoot [/var/www/demo] does not exist


Regards,
Stéphane


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

Posted by Stéphane Blondon <st...@gmail.com>.
Le lun. 14 janv. 2019 à 18:33, William A Rowe Jr <wr...@rowe-clan.net> a écrit :
>
> There should not be a 'warn' level emit for a non-existent directory. Unlike the
> DocumentRoot or Alias, which are searched, <Directory > blocks describe
> protection. It's entirely reasonable to protect paths which aren't physically on
> the system at the current moment or in the current deployment. Something
> at the 'debug' level would be entirely reasonable, perhaps even at 'info' level.

`apachectl -t -e DEBUG` does not display a message about the
non-existent directory.
So I guess this check is not done. I will see if I can code the check
(as debug or info level) or I will add a wishlist bug in the
bugtracker.

Regards
-- 
Stéphane

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

Posted by William A Rowe Jr <wr...@rowe-clan.net>.
There should not be a 'warn' level emit for a non-existent directory.
Unlike the
DocumentRoot or Alias, which are searched, <Directory > blocks describe
protection. It's entirely reasonable to protect paths which aren't
physically on
the system at the current moment or in the current deployment. Something
at the 'debug' level would be entirely reasonable, perhaps even at 'info'
level.


On Sun, Jan 13, 2019 at 3:39 PM Stéphane Blondon <st...@gmail.com>
wrote:

> Hello,
>
> sorry for the huge 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.)
>
> On 02/09/2018 13:56, Daniel Ferradal wrote:
> > 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
>
>
> You're right: I tested with a more recent version (2.4.37) and
> 'DocumentRoot' path and logs directories ('ErrorLog' and 'CustomLog')
> are checked.
>
> I wonder if `apachectl -t` should provide a warning if the path for
> 'Directory' directive does not exist.
>
> For example, <Directory /var/www/demo>
> if /var/www/demo does not exist, `apachectl -t` does not complain. I
> though it would display a warning like AH00112 for DocumentRoot:
> Warning: DocumentRoot [/var/www/demo] does not exist
>
>
> Regards,
> Stéphane
>
>