Web server configuration question -- this has to do with stuff that happens at config time, i.e. when the server reads the config files. For Apache, this happens when you do
service apache2 restart or
I would like to check for the existence of a file without actually including it. There should be an error identifying the file if it isn't found.
Does either Apache or Nginx support such a thing?
@woozle https://httpd.apache.org/docs/2.4/mod/core.html#iffile that what you are looking for?
Not quite sure how you can manually send a debug message to the log though...
@FiXato Aha! Yes, that looks like it should work.
When you run
apachectl configtest, it puts any error messages on the console, which is all I need.
@FiXato ...oh, but I see what you mean: it only does a thing if the file does exist; what I need is for something to happen if it does not...
Will poke around with this.
The filename in the section directive can take the same forms as the test variable in the section, i.e. the test can be negated if the ! character is placed directly before filename.
@FiXato It's a bit jank, but this seems to work:
have some bad syntax to throw an error
On the internet, everyone knows you're a cat — and that's totally okay.