0

I writing a script, which find specific LoadModule directive in Apache configuration and fix path in it after software reinstall. For that I need to find where root configuration file placed. To do that I parse output of apache2 -V (or httpd -V, depend of OS). But Apache don't show this settings if configuration files is corrupted (which is why I need to fix them). Instead, it throw an error:

httpd: Syntax error on line 355 of /etc/httpd/conf/httpd.conf: Cannot load **** into server: ****: cannot open shared object file: No such file or directory

Is there any way to invoke apache2 -V even with corrupted configuration files? Also any way to find where root configuration placed will be good.

OS: CentOS 7, Apache 2.4.6

2
  • Have you considered replacing the entire httpd.conf with your own? Jan 29, 2018 at 13:18
  • @JohnMahowald That script supposed to be shipped on machines which I cannot control. Also on recent Ubuntu and Windows apache2 -V works even with incorrect config.
    – Flowneee
    Jan 29, 2018 at 13:45

0

You must log in to answer this question.

Browse other questions tagged .